From e75efdd07be79c5b8ab73137db09fd5c0b3e9ebf Mon Sep 17 00:00:00 2001 From: Outfluencer Date: Sun, 15 Sep 2024 22:33:20 +0200 Subject: [PATCH] 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 8283286563..f459541334 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 void connected(ChannelWrapper channel) throws Exception 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( "probably miss configured ip-forwarding" ); + } } @Override