update to types
This commit is contained in:
30
dist/server/clients/clientBase.js
vendored
Normal file
30
dist/server/clients/clientBase.js
vendored
Normal 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
|
Reference in New Issue
Block a user