Update GameManager
This commit is contained in:
@@ -50,6 +50,8 @@ class GameManager(
|
|||||||
}, 20L, 20L )
|
}, 20L, 20L )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private var lobbyIdleCount: Int = 0
|
||||||
|
|
||||||
private fun gameLoop()
|
private fun gameLoop()
|
||||||
{
|
{
|
||||||
when( currentState )
|
when( currentState )
|
||||||
@@ -61,8 +63,16 @@ class GameManager(
|
|||||||
setGameState( GameState.STARTING )
|
setGameState( GameState.STARTING )
|
||||||
timer = lobbyTime
|
timer = lobbyTime
|
||||||
}
|
}
|
||||||
else Bukkit.getOnlinePlayers().forEach {
|
else
|
||||||
it.sendMsg( "game.lobby-idle", "current" to Bukkit.getOnlinePlayers().size.toString(), "min" to minPlayers.toString() )
|
{
|
||||||
|
if ( lobbyIdleCount >= 15 )
|
||||||
|
{
|
||||||
|
lobbyIdleCount = 0
|
||||||
|
Bukkit.getOnlinePlayers().forEach {
|
||||||
|
it.sendMsg( "game.lobby-idle", "current" to Bukkit.getOnlinePlayers().size.toString(), "min" to minPlayers.toString() )
|
||||||
|
}
|
||||||
|
}
|
||||||
|
lobbyIdleCount++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user