Commit 30e0a44f authored by 18신대성's avatar 18신대성 Committed by 18류지석

살아있는 사람 카운트를 RoomData에 추가함

parent 555b6d21
......@@ -14,6 +14,7 @@ socket.on('syncRoomData', function(msg) // {num roomNum, [] players}
console.log(msg);
RoomData.roomNum = msg.roomNum;
RoomData.players = msg.players;
RoomData.aliveCount = msg.players.length;
});
socket.on('startGame', function()
{
......@@ -41,4 +42,5 @@ socket.on('userDisconnect', function(msg) // {num index , num id, str nickname}
{
console.log(msg.index + ' / ' + msg.id + ' / ' + msg.nickname + ' disconnected');
RoomData.players[msg.index].isAlive = false;
RoomData.aliveCount--;
});
\ No newline at end of file
......@@ -25,4 +25,5 @@ PlayerData.nickname = '홍길동'; //플레이어 닉네임
var RoomData = RoomData || {};
RoomData.roomNum = -1;
RoomData.players = null;
\ No newline at end of file
RoomData.players = null;
RoomData.aliveCount = -1;
\ No newline at end of file
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