"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