more tests, added ability to remove clients from a channel
This commit is contained in:
11
dist/server/channels/channelBase.js
vendored
11
dist/server/channels/channelBase.js
vendored
@ -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) {
|
||||
|
Reference in New Issue
Block a user