Commit 15a3a82b authored by 18손재민's avatar 18손재민

방에서 나가기 수정

parent 7affd41c
......@@ -303,7 +303,7 @@ class GameRoom
{
this.currentSocket.forEach(function(element)
{
element.emit(_message, _data);
if(element.playerData.playingData.isInThisRoom) element.emit(_message, _data);
});
}
......@@ -328,6 +328,7 @@ class Player
this.nickname = playerData.nickname;
this.playerImage = null;
this.position = null;
this.isInThisRoom = true;
this.isAlive = false;
this.rank = -1;
......@@ -383,6 +384,7 @@ class Player
console.log('['+winner.id+']' + ' winner! ' + winner.nickname);
}
}
this.isInThisRoom = false;
}
}
......
......@@ -253,6 +253,12 @@ socket.on('defeat', function(msg) // object player
socket.on('gameEnd', function(msg) // object player
{
console.log(msg.nickname + ' Win!!!!!!');
if(msg.id == RoomData.myself.id)
{
setTimeout(() => {
ScenesData.changeScene('menuScene');
}, 2000);
}
});
socket.on('attackSucceed', function(msg)
......
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