Commit d8087eec authored by 18신대성's avatar 18신대성

대기실 카운트 문제 해결

parent 746de906
...@@ -82,7 +82,7 @@ class GameRoom ...@@ -82,7 +82,7 @@ class GameRoom
{ {
this.roomId = GameServer.getRoomNumber(); this.roomId = GameServer.getRoomNumber();
this.roomIndex = -1; this.roomIndex = -1;
this.startCount = 5; this.startCount = 2;
this.maxPlayer = 100; this.maxPlayer = 100;
this.nextRank = 100; this.nextRank = 100;
...@@ -143,7 +143,8 @@ class GameRoom ...@@ -143,7 +143,8 @@ class GameRoom
{ {
if (this.currentPhase === GameServer.Phase.READY) if (this.currentPhase === GameServer.Phase.READY)
{ {
this.endTime = Date.now() + 30000; // 방 대기 시간 this.countStartTime = Date.now();
this.endTime = 10000; // 방 대기 시간
this.announceToRoom('setRoomCount', this.announceToRoom('setRoomCount',
{ {
isEnable: true, endTime: this.endTime, playerCount: this.currentPlayer.length, isEnable: true, endTime: this.endTime, playerCount: this.currentPlayer.length,
...@@ -153,6 +154,7 @@ class GameRoom ...@@ -153,6 +154,7 @@ class GameRoom
} }
else if (this.currentPhase === GameServer.Phase.COUNT) else if (this.currentPhase === GameServer.Phase.COUNT)
{ {
this.endTime = this.endTime - (Time.now() - this.countStartTime);
this.announceToRoom('setRoomCount', this.announceToRoom('setRoomCount',
{ {
isEnable: true, endTime: this.endTime, playerCount: this.currentPlayer.length, isEnable: true, endTime: this.endTime, playerCount: this.currentPlayer.length,
...@@ -266,8 +268,8 @@ class GameRoom ...@@ -266,8 +268,8 @@ class GameRoom
this.startTime = Date.now(); this.startTime = Date.now();
setTimeout(function() setTimeout(function()
{ {
checkPhase(Date.now()); this.checkPhase(Date.now());
}, 6000); }.bind(this), 6000);
} }
checkPhase(checkTime) checkPhase(checkTime)
......
...@@ -70,7 +70,7 @@ socket.on('setRoomCount', function(msg) ...@@ -70,7 +70,7 @@ socket.on('setRoomCount', function(msg)
setTimeout(function() setTimeout(function()
{ {
ScenesData.roomScene.isCounting = msg.isEnable; ScenesData.roomScene.isCounting = msg.isEnable;
ScenesData.roomScene.endTime = msg.endTime; ScenesData.roomScene.endTime = Date.now() + msg.endTime;
ScenesData.roomScene.peopleCount = msg.playerCount; ScenesData.roomScene.peopleCount = msg.playerCount;
if (msg.isEnter) // generate character if (msg.isEnter) // generate character
......
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