From d9920c01abef35f7aead4dafb3cef501b5d9eac1 Mon Sep 17 00:00:00 2001 From: creeper123123321 <7974274+creeper123123321@users.noreply.github.com> Date: Sun, 19 Jun 2022 09:22:57 -0300 Subject: [PATCH] fix reauth --- .../com/viaversion/aas/handler/state/LoginState.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/com/viaversion/aas/handler/state/LoginState.kt b/src/main/kotlin/com/viaversion/aas/handler/state/LoginState.kt index 0808538..82340fc 100644 --- a/src/main/kotlin/com/viaversion/aas/handler/state/LoginState.kt +++ b/src/main/kotlin/com/viaversion/aas/handler/state/LoginState.kt @@ -65,9 +65,12 @@ class LoginState : ConnectionState { private fun handleReauthResponse(packet: PluginResponse): Boolean { if (packet.id == pendingReauth) { pendingReauth = null - val buf = Unpooled.wrappedBuffer(packet.data) - callbackReauth.complete(buf.readBoolean()) - + if (packet.success) { + val buf = Unpooled.wrappedBuffer(packet.data) + callbackReauth.complete(buf.readBoolean()) + } else { + callbackReauth.complete(false) + } return true } return false