Commit 22c3f8fa authored by Chae Ho Shin's avatar Chae Ho Shin

Merge branch 'master' into release

parents c63c298f dcbdc78c
......@@ -199,7 +199,7 @@ Input.convert = function()
}
if (this.convInput.length > 1)
{
if (this.convInput[1].charCodeAt(0) > ''.charCodeAt(0)) Input.input.splice(0, this.input.length - 2);
if (this.convInput[1].charCodeAt(0) >= ''.charCodeAt(0)) Input.input.splice(0, this.input.length - 2);
else Input.input.splice(0, this.input.length - 1);
this.converted += this.convInput.slice(0, 1);
this.convInput = this.convInput.slice(1, 2);
......
......@@ -89,25 +89,28 @@ io.on('connection', function(socket)
{
socket.playerData.currentRoom.announceToTarget(msg.target, 'attacked', msg);
//console.log('attack ' + msg.target + ' by ' + msg.attacker.id + ' with ' + msg.text);
let target = GameServer.findPlayerSocket(msg.target);
if (target != null)
setTimeout(function()
{
let dataToPush =
let target = GameServer.findPlayerSocket(msg.target);
if (target != null)
{
attackerId: msg.attacker.id,
attacker: msg.attacker.nickname,
word: msg.text,
wordGrade: msg.grade,
time: Date.now()
}
let dataToPush =
{
attackerId: msg.attacker.id,
attacker: msg.attacker.nickname,
word: msg.text,
wordGrade: msg.grade,
time: Date.now()
}
if (target.playerData.playingData.lastAttacks.length < 5) target.playerData.playingData.lastAttacks.push(dataToPush);
else
{
target.playerData.playingData.lastAttacks.splice(0, 1);
target.playerData.playingData.lastAttacks.push(dataToPush);
if (target.playerData.playingData.lastAttacks.length < 5) target.playerData.playingData.lastAttacks.push(dataToPush);
else
{
target.playerData.playingData.lastAttacks.splice(0, 1);
target.playerData.playingData.lastAttacks.push(dataToPush);
}
}
}
}, 4000);
});
socket.on('defeated', function()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment