24 lines
402 B
JavaScript
24 lines
402 B
JavaScript
function Client()
|
|
{
|
|
/**
|
|
* @type {string}
|
|
*/
|
|
this.id = null;
|
|
/**
|
|
* @type {import("websocket").connection}
|
|
*/
|
|
this.socket = null;
|
|
/**
|
|
* @type {Date}
|
|
*/
|
|
this.created_at = null;
|
|
|
|
this.store = new Map();
|
|
this.rooms = new Set();
|
|
};
|
|
|
|
Client.prototype.send = function(obj){
|
|
this.socket.sendUTF(JSON.stringify(obj));
|
|
};
|
|
|
|
exports.Client = Client; |