Improve network availability check

This commit is contained in:
Him188 2020-05-07 10:45:19 +08:00
parent 5cd027dfa9
commit a1322076fc

View File

@ -150,7 +150,7 @@ internal object HighwayHelper {
// require(commandId == 2 || commandId == 1) { "bad commandId. Must be 1 or 2" }
val socket = PlatformSocket()
while (client.bot.network.isActive) {
while (client.bot.network.areYouOk() && client.bot.isActive) {
try {
socket.connect(EmptyCoroutineContext, serverIp, serverPort)
break