check for internet before starting a mp game to avoid freeze (#6679)

* 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

* check for internet before starting a mp game to avoid freeze

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. A slight modification has been done to the code to catch an error caused by InetAddress

* Revert "Merge remote-tracking branch 'origin/master-noInternet' into master-noInternet"

This reverts commit bd6474b50d, reversing
changes made to f52ad60b51.
This commit is contained in:
alexban011
2022-05-03 00:41:08 +03:00
committed by GitHub
parent 031cb4fc14
commit 898b1ca056
10 changed files with 67 additions and 25 deletions

View File

@ -35,15 +35,15 @@ open class AndroidLauncher : AndroidApplication() {
val fontFamily = settings.fontFamily
// Manage orientation lock
val limitOrientationsHelper = LimitOrientationsHelperAndroid(this)
limitOrientationsHelper.allowPortrait(settings.allowAndroidPortrait)
val platformSpecificHelper = PlatformSpecificHelpersAndroid(this)
platformSpecificHelper.allowPortrait(settings.allowAndroidPortrait)
val androidParameters = UncivGameParameters(
version = BuildConfig.VERSION_NAME,
crashReportSysInfo = CrashReportSysInfoAndroid,
fontImplementation = NativeFontAndroid(Fonts.ORIGINAL_FONT_SIZE.toInt(), fontFamily),
customSaveLocationHelper = customSaveLocationHelper,
limitOrientationsHelper = limitOrientationsHelper
platformSpecificHelper = platformSpecificHelper
)
game = UncivGame(androidParameters)