From 099b180a0745d2d884c340be00ceb851ee3c8973 Mon Sep 17 00:00:00 2001 From: Xander Lenstra <71121390+xlenstra@users.noreply.github.com> Date: Tue, 7 Dec 2021 20:38:45 +0100 Subject: [PATCH 1/3] Band-aided a bug where players in multiplayer games were waiting for themselves. (#5768) (cherry picked from commit 22b3997c28da4eb75c1b633625d5c006b17934d8) --- core/src/com/unciv/logic/GameInfo.kt | 2 +- core/src/com/unciv/ui/worldscreen/WorldScreen.kt | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/logic/GameInfo.kt b/core/src/com/unciv/logic/GameInfo.kt index f609de8676..5725b045f2 100644 --- a/core/src/com/unciv/logic/GameInfo.kt +++ b/core/src/com/unciv/logic/GameInfo.kt @@ -120,7 +120,7 @@ class GameInfo { } /** Get a civ by name - * @throws NoSuchElementException if no civ of than name is in the game (alive or dead)! */ + * @throws NoSuchElementException if no civ of that name is in the game (alive or dead)! */ fun getCivilization(civName: String) = civilizations.first { it.civName == civName } fun getCurrentPlayerCivilization() = currentPlayerCiv fun getCivilizationsAsPreviews() = civilizations.map { it.asPreview() }.toMutableList() diff --git a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt index bbc4552f8f..1cceb955b5 100644 --- a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt +++ b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt @@ -335,7 +335,12 @@ class WorldScreen(val gameInfo: GameInfo, val viewingCiv:CivilizationInfo) : Bas val latestGame = OnlineMultiplayer().tryDownloadGame(gameInfo.gameId) // if we find the current player didn't change, don't update - if (gameInfo.currentPlayer == latestGame.currentPlayer) { + // Additionally, check if we are the current player, and in that case always stop + // This fixes a bug where for some reason players were waiting for themselves. + if (gameInfo.currentPlayer == latestGame.currentPlayer + && gameInfo.turns == latestGame.turns + && latestGame.currentPlayer != gameInfo.getPlayerToViewAs().civName + ) { Gdx.app.postRunnable { loadingGamePopup.close() } shouldUpdate = true return From e3d86db66d4436dffe9ff777a25ff5dcfd2348f4 Mon Sep 17 00:00:00 2001 From: yairm210 Date: Tue, 7 Dec 2021 21:39:48 +0200 Subject: [PATCH 2/3] 3.18.7-patch1 --- buildSrc/src/main/kotlin/BuildConfig.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/BuildConfig.kt b/buildSrc/src/main/kotlin/BuildConfig.kt index 691c404f4d..6670731b52 100644 --- a/buildSrc/src/main/kotlin/BuildConfig.kt +++ b/buildSrc/src/main/kotlin/BuildConfig.kt @@ -4,7 +4,7 @@ object BuildConfig { const val kotlinVersion = "1.5.30" const val appName = "Unciv" const val appCodeNumber = 652 - const val appVersion = "3.18.7" + const val appVersion = "3.18.7-patch1" const val gdxVersion = "1.10.0" const val roboVMVersion = "2.3.1" From 41c328286b5ead686d24c9be4f71c86069ff48a1 Mon Sep 17 00:00:00 2001 From: yairm210 Date: Tue, 7 Dec 2021 21:49:36 +0200 Subject: [PATCH 3/3] 3.18.7-patch1 --- buildSrc/src/main/kotlin/BuildConfig.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/BuildConfig.kt b/buildSrc/src/main/kotlin/BuildConfig.kt index 6670731b52..0466302ab6 100644 --- a/buildSrc/src/main/kotlin/BuildConfig.kt +++ b/buildSrc/src/main/kotlin/BuildConfig.kt @@ -3,7 +3,7 @@ package com.unciv.build object BuildConfig { const val kotlinVersion = "1.5.30" const val appName = "Unciv" - const val appCodeNumber = 652 + const val appCodeNumber = 654 const val appVersion = "3.18.7-patch1" const val gdxVersion = "1.10.0"