mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-07 16:40:43 +08:00
Ensure fast login succeed, fix #1199
This commit is contained in:
parent
09475efbda
commit
6d58fb5514
@ -244,10 +244,10 @@ internal class QQAndroidBotNetworkHandler(coroutineContext: CoroutineContext, bo
|
|||||||
|
|
||||||
private val fastLoginOrSendPacketLock = Mutex()
|
private val fastLoginOrSendPacketLock = Mutex()
|
||||||
|
|
||||||
private suspend fun doFastLogin(): Boolean {
|
private suspend fun doFastLogin() {
|
||||||
fastLoginOrSendPacketLock.withLock {
|
fastLoginOrSendPacketLock.withLock {
|
||||||
val login10 = WtLogin10(bot.client).sendAndExpect(ignoreLock = true)
|
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" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user