Commit 20c1be7c authored by 18신대성's avatar 18신대성 Committed by 18류지석

이제 게임 진행중인 룸에 안들어감. 여기까지 머지해서 사용하는거 추천

parent 40bdb4af
...@@ -35,7 +35,7 @@ GameServer.makeRoom = function() ...@@ -35,7 +35,7 @@ GameServer.makeRoom = function()
roomNum: GameServer.nextRoomNumber++, roomNum: GameServer.nextRoomNumber++,
maxPlayer: 3, maxPlayer: 3,
currentPlayer: [], currentPlayer: [],
currnetPhase: GameServer.Phase.READY, currentPhase: GameServer.Phase.READY,
rateArrangePoint: 300, rateArrangePoint: 300,
maxTypingPlayer: null, maxTypingPlayer: null,
...@@ -57,7 +57,7 @@ GameServer.enterRoom = function(roomIdx, playerData) ...@@ -57,7 +57,7 @@ GameServer.enterRoom = function(roomIdx, playerData)
this.playingRoom[roomIdx].currentPlayer.push(playerData); this.playingRoom[roomIdx].currentPlayer.push(playerData);
playerData.currentRoom = this.playingRoom[roomIdx]; playerData.currentRoom = this.playingRoom[roomIdx];
console.log('[' + playerData.id + '] entered to room #' + this.playingRoom[roomIdx].roomNum); console.log('[' + playerData.id + '] entered to room #' + this.playingRoom[roomIdx].roomNum);
if (this.playingRoom[roomIdx].currentPlayer.length >= this.startCount && this.playingRoom[roomIdx].Phase != GameServer.Phase.START) GameServer.startRoom(roomIdx); if (this.playingRoom[roomIdx].currentPlayer.length >= this.startCount) GameServer.startRoom(roomIdx);
return this.playingRoom[roomIdx]; return this.playingRoom[roomIdx];
} }
GameServer.enterEmptyRoom = function(playerData) GameServer.enterEmptyRoom = function(playerData)
...@@ -65,7 +65,7 @@ GameServer.enterEmptyRoom = function(playerData) ...@@ -65,7 +65,7 @@ GameServer.enterEmptyRoom = function(playerData)
var toEnter = -1; var toEnter = -1;
for (let i = 0; i < this.playingRoom.length; i++) for (let i = 0; i < this.playingRoom.length; i++)
{ {
if (this.playingRoom[i].currentPlayer.length < this.playingRoom[i].maxPlayer) if (this.playingRoom[i].currentPlayer.length < this.playingRoom[i].maxPlayer && this.playingRoom[i].currentPhase == this.Phase.READY)
{ {
toEnter = i; toEnter = i;
break; break;
...@@ -80,7 +80,7 @@ GameServer.enterEmptyRoom = function(playerData) ...@@ -80,7 +80,7 @@ GameServer.enterEmptyRoom = function(playerData)
GameServer.startRoom = function(roomIdx) GameServer.startRoom = function(roomIdx)
{ {
let room = this.playingRoom[roomIdx]; let room = this.playingRoom[roomIdx];
this.playingRoom[roomIdx].Phase = this.Phase.START; this.playingRoom[roomIdx].currentPhase = this.Phase.START;
this.playingRoom[roomIdx].maxTypingPlayer = room.currentPlayer[0]; this.playingRoom[roomIdx].maxTypingPlayer = room.currentPlayer[0];
this.playingRoom[roomIdx].mimTypingPlayer = room.currentPlayer[0]; this.playingRoom[roomIdx].mimTypingPlayer = room.currentPlayer[0];
......
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