more tests, added ability to remove clients from a channel
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user