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

@ -26,6 +26,17 @@ class ChannelBase {
}
return null;
}
removeClient(id) {
var index = 0;
for (let client of this.clients) {
if (client.id == id) {
this.clients.splice(index, 1);
return true;
}
index++;
}
return false;
}
broadcastMessage(from, message) {
for (let client of this.clients) {
if (client != from) {