update to types

This commit is contained in:
Josh Burman
2019-03-11 14:35:33 -04:00
parent 8fa7f98493
commit cdd6179992
28 changed files with 518 additions and 39 deletions

42
dist/server/channels/channelBase.js vendored Normal file
View File

@ -0,0 +1,42 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class ChannelBase {
constructor(id) {
this.clients = [];
this.id = id;
console.log('channel created');
}
addClient(client) {
console.log(client.data);
if (this.clientExists(client.id)) {
console.log('client already exits in channel');
}
else {
this.clients.push(client);
console.log('added client to channel');
}
}
clientExists(id) {
for (let client of this.clients) {
if (client.id == id) {
return client;
}
}
return null;
}
broadcastMessage(from, message) {
for (let client of this.clients) {
if (client != from) {
client.ws.send(message);
console.log(`sent to ${client.id}: %s`, message);
console.log(message);
}
else {
console.log('client is same as sender');
}
}
}
}
;
exports.default = ChannelBase;
//# sourceMappingURL=channelBase.js.map