mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-29 06:51:30 -04:00
Fixed MP refresher not working after rate limit (#6847)
This commit is contained in:
parent
fa2c5f7cde
commit
919812f775
@ -61,6 +61,7 @@ import kotlinx.coroutines.flow.flow
|
|||||||
import kotlinx.coroutines.flow.launchIn
|
import kotlinx.coroutines.flow.launchIn
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import kotlin.concurrent.timer
|
import kotlin.concurrent.timer
|
||||||
|
import kotlin.concurrent.timerTask
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unciv's world screen
|
* Unciv's world screen
|
||||||
@ -394,9 +395,9 @@ class WorldScreen(val gameInfo: GameInfo, val viewingCiv:CivilizationInfo) : Bas
|
|||||||
stopMultiPlayerRefresher()
|
stopMultiPlayerRefresher()
|
||||||
val restartAfter : Long = ex.limitRemainingSeconds.toLong() * 1000
|
val restartAfter : Long = ex.limitRemainingSeconds.toLong() * 1000
|
||||||
|
|
||||||
timer("RestartTimerTimer", true, restartAfter, 0) {
|
Timer("RestartTimerTimer", true).schedule(timerTask {
|
||||||
multiPlayerRefresherJob = multiPlayerRefresher.launchIn(CRASH_HANDLING_DAEMON_SCOPE)
|
multiPlayerRefresherJob = multiPlayerRefresher.launchIn(CRASH_HANDLING_DAEMON_SCOPE)
|
||||||
}
|
}, restartAfter)
|
||||||
} catch (ex: Throwable) {
|
} catch (ex: Throwable) {
|
||||||
postCrashHandlingRunnable {
|
postCrashHandlingRunnable {
|
||||||
loadingGamePopup.reuseWith("Couldn't download the latest game state!", true)
|
loadingGamePopup.reuseWith("Couldn't download the latest game state!", true)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user