diff --git a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/BotImpl.kt b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/BotImpl.kt index b3adda8a6..da52de868 100644 --- a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/BotImpl.kt +++ b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/BotImpl.kt @@ -27,6 +27,7 @@ import net.mamoe.mirai.event.subscribeAlways import net.mamoe.mirai.network.ForceOfflineException import net.mamoe.mirai.network.LoginFailedException import net.mamoe.mirai.qqandroid.network.BotNetworkHandler +import net.mamoe.mirai.qqandroid.network.DefaultServerList import net.mamoe.mirai.qqandroid.network.closeAndJoin import net.mamoe.mirai.supervisorJob import net.mamoe.mirai.utils.* @@ -91,7 +92,11 @@ internal abstract class BotImpl constructor( } bot.logger.info { "Connection lost, retrying login" } - bot.asQQAndroidBot().client.serverList.removeAt(0) + bot.asQQAndroidBot().client.run { + if (serverList.isEmpty()) { + serverList.addAll(DefaultServerList) + } else serverList.removeAt(0) + } var failed = false val time = measureTime {