Commit bd3b9a82 authored by 18신대성's avatar 18신대성 Committed by 18손재민

한명쯤 로딩 안돼도 2초 뒤에 강제시작하게

parent 745814fd
......@@ -82,7 +82,7 @@ class GameRoom
{
this.roomId = GameServer.getRoomNumber();
this.roomIndex = -1;
this.startCount = 3;
this.startCount = 2;
this.maxPlayer = 100;
this.nextRank = 100;
......
......@@ -106,20 +106,17 @@ io.on('connection', function(socket)
room.startTimer = setTimeout(function()
{
let deads = room.currentPlayer.filter(element => !element.isAlive);
if (room.aliveCount != 0)
if (room.aliveCount != 0 && room.currentPlayer.length - deads.length >= room.startCount)
{
console.error('[ROOM#'+room.roomId+'] FORCE START!!!');
if (room.currentPlayer.length - deads.length >= room.startCount)
room.startRoom();
deads.forEach(function(element)
{
room.startRoom();
deads.forEach(function(element)
{
element.defeat();
});
}
element.defeat();
});
clearTimeout(room.startTimer);
}
else
else if (deads.length > 0)
{
deads.forEach(function(element)
{
......
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