This commit is contained in:
Asraelite 2016-03-27 23:46:18 +01:00
parent 27520842e3
commit 2d177c6b27
16 changed files with 228 additions and 31 deletions

View file

@ -34,13 +34,16 @@ class Connection {
}
chat(data) {
console.log(this.room);
if(this.chatCooldown > 5 || !this.room) return;
//if(this.chatCooldown > 5 || !this.room) return;
if(!data.msg) return;
wingbase.log(`${this.room}/${this.player.name}: ${data.msg}`);
this.chatCooldown++;
this.io.to(this.room).emit('chat', {
name: this.player.name,
msg: data.msg.slice(0, 100)
type: 'player',
source: this.player.name,
message: data.msg.slice(0, 100)
});
}