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