mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-14 17:59:11 +07:00
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:
@ -425,7 +425,7 @@ class OptionsPopup(val previousScreen: BaseScreen) : Popup(previousScreen) {
|
|||||||
}
|
}
|
||||||
for (line in modLinks) {
|
for (line in modLinks) {
|
||||||
val label = Label(line.text, BaseScreen.skin)
|
val label = Label(line.text, BaseScreen.skin)
|
||||||
.apply { color = line.errorSeverityToReport.color }
|
.apply { color = line.errorSeverityToReport.color }
|
||||||
label.wrap = true
|
label.wrap = true
|
||||||
it.add(label).width(stage.width / 2).row()
|
it.add(label).width(stage.width / 2).row()
|
||||||
}
|
}
|
||||||
|
@ -9,9 +9,9 @@ class PlatformSpecificHelpersDesktop : GeneralPlatformSpecificHelpers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun isInternetConnected(): Boolean {
|
override fun isInternetConnected(): Boolean {
|
||||||
return try{
|
return try {
|
||||||
InetAddress.getByName("8.8.8.8").isReachable(500) // Parameter timeout in milliseconds
|
InetAddress.getByName("8.8.8.8").isReachable(500) // Parameter timeout in milliseconds
|
||||||
}catch (ex: Exception){
|
} catch (ex: Throwable) {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user