From 6d58fb5514fc67e266d30ce2da7bf25d5aba9b52 Mon Sep 17 00:00:00 2001 From: Him188 Date: Sun, 18 Apr 2021 14:37:16 +0800 Subject: [PATCH] Ensure fast login succeed, fix #1199 --- .../kotlin/network/handler/QQAndroidBotNetworkHandler.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mirai-core/src/commonMain/kotlin/network/handler/QQAndroidBotNetworkHandler.kt b/mirai-core/src/commonMain/kotlin/network/handler/QQAndroidBotNetworkHandler.kt index 2bf384f0d..bd7316d0c 100644 --- a/mirai-core/src/commonMain/kotlin/network/handler/QQAndroidBotNetworkHandler.kt +++ b/mirai-core/src/commonMain/kotlin/network/handler/QQAndroidBotNetworkHandler.kt @@ -244,10 +244,10 @@ internal class QQAndroidBotNetworkHandler(coroutineContext: CoroutineContext, bo private val fastLoginOrSendPacketLock = Mutex() - private suspend fun doFastLogin(): Boolean { + private suspend fun doFastLogin() { fastLoginOrSendPacketLock.withLock { val login10 = WtLogin10(bot.client).sendAndExpect(ignoreLock = true) - return login10 is WtLogin.Login.LoginPacketResponse.Success + check(login10 is WtLogin.Login.LoginPacketResponse.Success) { "Fast login failed: $login10" } } }