Commit a1322076 authored by Him188's avatar Him188

Improve network availability check

parent 5cd027df
...@@ -150,7 +150,7 @@ internal object HighwayHelper { ...@@ -150,7 +150,7 @@ internal object HighwayHelper {
// require(commandId == 2 || commandId == 1) { "bad commandId. Must be 1 or 2" } // require(commandId == 2 || commandId == 1) { "bad commandId. Must be 1 or 2" }
val socket = PlatformSocket() val socket = PlatformSocket()
while (client.bot.network.isActive) { while (client.bot.network.areYouOk() && client.bot.isActive) {
try { try {
socket.connect(EmptyCoroutineContext, serverIp, serverPort) socket.connect(EmptyCoroutineContext, serverIp, serverPort)
break break
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment