Ensure fast login succeed, fix #1199

This commit is contained in:
Him188 2021-04-18 14:37:16 +08:00
parent 09475efbda
commit 6d58fb5514

View File

@ -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" }
}
}