From 2bacf6572baa8a98e701946a36a6e03651b75ec2 Mon Sep 17 00:00:00 2001 From: Outfluencer Date: Sun, 15 Sep 2024 22:33:20 +0200 Subject: [PATCH] #3743: Fix infinite encrypting screen on miss configured ip-forwarding --- proxy/src/main/java/net/md_5/bungee/ServerConnector.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java index 90c5237c..0f158a65 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -137,6 +137,15 @@ public class ServerConnector extends PacketHandler public void disconnected(ChannelWrapper channel) throws Exception { user.getPendingConnects().remove( target ); + + if ( !obsolete && user.getPendingConnects().isEmpty() && thisState == State.LOGIN_SUCCESS ) + { + // this is called if we get disconnected but not have received any response after we send the handshake + // in this case probably an exception was thrown because the handshake could not be read correctly + // because of the extra ip forward data, also we skip the disconnect if another server is also in the + // pendingConnects queue because we don't want to lose the player + user.disconnect( "Unexpected disconnect during server login, did you forget to enable BungeeCord / IP forwarding on your server?" ); + } } @Override