From 5fbcc6b1195addc96673c8d9e70521562e12120b Mon Sep 17 00:00:00 2001 From: Outfluencer <48880402+Outfluencer@users.noreply.github.com> Date: Mon, 26 Aug 2024 12:06:34 +0200 Subject: [PATCH] #3732: Fix protocol state issue --- .../java/net/md_5/bungee/connection/InitialHandler.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java index 3bbf688b..0d745b91 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java @@ -66,6 +66,7 @@ import net.md_5.bungee.protocol.packet.Handshake; import net.md_5.bungee.protocol.packet.Kick; import net.md_5.bungee.protocol.packet.LegacyHandshake; import net.md_5.bungee.protocol.packet.LegacyPing; +import net.md_5.bungee.protocol.packet.LoginAcknowledged; import net.md_5.bungee.protocol.packet.LoginPayloadResponse; import net.md_5.bungee.protocol.packet.LoginRequest; import net.md_5.bungee.protocol.packet.LoginSuccess; @@ -690,6 +691,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection disconnect( "Unexpected custom LoginPayloadResponse" ); } + @Override + public void handle(LoginAcknowledged loginAcknowledged) throws Exception + { + // this packet should only be sent after the login success (it should be handled in the UpstreamBridge) + disconnect( "Unexpected LoginAcknowledged" ); + } + @Override public void handle(CookieResponse cookieResponse) {