Commit dcbdc78c authored by 18신대성's avatar 18신대성 Committed by Chae Ho Shin

시즌 12호 머지

parent 79aad6ec
...@@ -199,7 +199,7 @@ Input.convert = function() ...@@ -199,7 +199,7 @@ Input.convert = function()
} }
if (this.convInput.length > 1) 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); else Input.input.splice(0, this.input.length - 1);
this.converted += this.convInput.slice(0, 1); this.converted += this.convInput.slice(0, 1);
this.convInput = this.convInput.slice(1, 2); this.convInput = this.convInput.slice(1, 2);
......
...@@ -89,25 +89,28 @@ io.on('connection', function(socket) ...@@ -89,25 +89,28 @@ io.on('connection', function(socket)
{ {
socket.playerData.currentRoom.announceToTarget(msg.target, 'attacked', msg); socket.playerData.currentRoom.announceToTarget(msg.target, 'attacked', msg);
//console.log('attack ' + msg.target + ' by ' + msg.attacker.id + ' with ' + msg.text); //console.log('attack ' + msg.target + ' by ' + msg.attacker.id + ' with ' + msg.text);
let target = GameServer.findPlayerSocket(msg.target); setTimeout(function()
if (target != null)
{ {
let dataToPush = let target = GameServer.findPlayerSocket(msg.target);
if (target != null)
{ {
attackerId: msg.attacker.id, let dataToPush =
attacker: msg.attacker.nickname, {
word: msg.text, attackerId: msg.attacker.id,
wordGrade: msg.grade, attacker: msg.attacker.nickname,
time: Date.now() word: msg.text,
} wordGrade: msg.grade,
time: Date.now()
}
if (target.playerData.playingData.lastAttacks.length < 5) target.playerData.playingData.lastAttacks.push(dataToPush); if (target.playerData.playingData.lastAttacks.length < 5) target.playerData.playingData.lastAttacks.push(dataToPush);
else else
{ {
target.playerData.playingData.lastAttacks.splice(0, 1); target.playerData.playingData.lastAttacks.splice(0, 1);
target.playerData.playingData.lastAttacks.push(dataToPush); target.playerData.playingData.lastAttacks.push(dataToPush);
}
} }
} }, 4000);
}); });
socket.on('defeated', function() 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