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

30
dist/server/clients/clientBase.js vendored Normal file
View File

@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class ClientBase {
constructor(data, ws) {
this.ws = ws;
this.data = data;
this.id = data.user_id;
this.channel = null;
}
getData() {
return this.data;
}
type() {
return this.data.client_type;
}
connectToChannel(channel) {
this.channel = channel;
this.ws.on('message', (message) => {
channel.broadcastMessage(this, message);
console.log('broadcasted: %s', message);
});
}
replaceWebSocket(ws) {
this.ws.close();
this.ws = ws;
}
}
;
exports.default = ClientBase;
//# sourceMappingURL=clientBase.js.map