UNPKG

nodito

Version:

Una librería para aprender juegos por turnos en node.

22 lines 618 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const ClientMessage_1 = require("./ClientMessage"); class Chat extends ClientMessage_1.ClientMessage { constructor() { super(...arguments); this.type = "chat"; } exec(msg, sender) { if (!msg.message.length) { return; } this.game.users.sendToAll({ message: msg.message.slice(0, 255), timestamp: (new Date()).getTime(), type: "chat", who: sender.toClient(), }); } } exports.Chat = Chat; //# sourceMappingURL=Chat.js.map