Skip to content

Commit

Permalink
[core] avoid potential endless login on receiving login result 180
Browse files Browse the repository at this point in the history
  • Loading branch information
StageGuard committed Sep 6, 2023
1 parent cfbb880 commit 82483f0
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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) },
Expand Down

0 comments on commit 82483f0

Please sign in to comment.