more tests, added ability to remove clients from a channel

This commit is contained in:
Josh Burman
2019-03-14 14:17:08 -04:00
parent 21f77fa4c3
commit 40691d9815
17 changed files with 316 additions and 5 deletions

View File

@ -33,6 +33,21 @@ class ChannelBase {
return null;
}
removeClient(id: number) {
var index: number = 0;
for (let client of this.clients) {
if (client.id == id) {
this.clients.splice(index, 1);
return true;
}
index++;
}
return false;
}
broadcastMessage(from: ClientBase|MHSClient|null, message: string) {
for (let client of this.clients) {
if (client != from) {