Fixed issue #6649 by checking for internet connection before starting the game if "online multiplayer" is selected

Many thanks to @SomeTroglodyte for most of the code and for explanations
This commit is contained in:
alexban011 2022-05-02 21:07:53 +03:00
parent f293e77786
commit 3a707b8f3c

View File

@ -158,13 +158,7 @@ class MultiplayerScreen(previousScreen: BaseScreen) : PickerScreen() {
else
GameSaver.saveGame(gamePreview, gameName)
postCrashHandlingRunnable {
val mods = sequenceOf(gamePreview.gameParameters.baseRuleset) + gamePreview.gameParameters.mods.asSequence()
val missingMods = mods.filterNot { it.isEmpty() || it in RulesetCache }
if (missingMods.any())
ToastPopup("Missing mods: [${missingMods.joinToString("\n", limit = 32)}]", this, 5000L)
reloadGameListUI()
}
postCrashHandlingRunnable { reloadGameListUI() }
} catch (ex: FileNotFoundException) {
// Game is so old that a preview could not be found on dropbox lets try the real gameInfo instead
try {
@ -432,4 +426,4 @@ class MultiplayerScreen(previousScreen: BaseScreen) : PickerScreen() {
}
}
}
}