[core] avoid potential endless login on receiving login result 180

This commit is contained in:
StageGuard 2023-09-06 16:04:53 +08:00
parent cfbb880b73
commit 82483f0f13
No known key found for this signature in database
GPG Key ID: F6FF8760A883492B

View File

@ -283,8 +283,13 @@ internal class WtLogin {
val t172 = t161[0x172]
if (t172 != null) {
bot.client.rollbackSig = t172
if (t172.contentEquals(bot.client.rollbackSig)) {
return LoginPacketResponse.Error(bot, 0x146, "login failed",
"login result type 180 with same t172 as the client's", "")
}
runCatching {
bot.client.rollbackSig = t172
bot.components[KeyRefreshProcessor].refreshKeysNow(bot.network)
}.fold(
onSuccess = { return LoginPacketResponse.Success(bot) },