mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-12 19:10:12 +07:00
Avoid ANR errors when attempting to start a MP game when server takes too long to respond
This commit is contained in:
parent
a914571b8e
commit
78c02df317
@ -113,9 +113,11 @@ class NewGameScreen(
|
||||
private fun startGameAvoidANRs(){
|
||||
// Don't allow players to click the game while we're checking if it's ok
|
||||
Gdx.input.inputProcessor = null
|
||||
val success = startGame()
|
||||
// if it is successful, the player should wait for the new screen, not touch the old one
|
||||
if (!success) Gdx.input.inputProcessor = stage
|
||||
Concurrency.run { // even just *checking* can take time
|
||||
val success = startGame()
|
||||
// if it is successful, the player should wait for the new screen, not touch the old one
|
||||
if (!success) Gdx.input.inputProcessor = stage
|
||||
}
|
||||
}
|
||||
|
||||
private fun startGame(): Boolean {
|
||||
|
Loading…
Reference in New Issue
Block a user