From 534148763fa65c2a3334d6bed9d32ece3e78148d Mon Sep 17 00:00:00 2001 From: Outfluencer <48880402+Outfluencer@users.noreply.github.com> Date: Thu, 22 Aug 2024 11:25:45 +0200 Subject: [PATCH] #3721: Improve same uuid and name checks We didn't return so the login event was fired for a disconnected player --- .../bungee/connection/InitialHandler.java | 26 ++++++------------- 1 file changed, 8 insertions(+), 18 deletions(-) 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 1d9a9ee5..413c8123 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 @@ -580,34 +580,24 @@ public class InitialHandler extends PacketHandler implements PendingConnection } } + ProxiedPlayer oldName = bungee.getPlayer( getName() ); + if ( oldName != null ) + { + // TODO See #1218 + disconnect( bungee.getTranslation( "already_connected_proxy" ) ); + return; + } + if ( isOnlineMode() ) { - // Check for multiple connections - // We have to check for the old name first - ProxiedPlayer oldName = bungee.getPlayer( getName() ); - if ( oldName != null ) - { - // TODO See #1218 - disconnect( bungee.getTranslation( "already_connected_proxy" ) ); - } // And then also for their old UUID ProxiedPlayer oldID = bungee.getPlayer( getUniqueId() ); if ( oldID != null ) - { - // TODO See #1218 - disconnect( bungee.getTranslation( "already_connected_proxy" ) ); - } - } else - { - // In offline mode the existing user stays and we kick the new one - ProxiedPlayer oldName = bungee.getPlayer( getName() ); - if ( oldName != null ) { // TODO See #1218 disconnect( bungee.getTranslation( "already_connected_proxy" ) ); return; } - } Callback complete = new Callback()