Skip to content

Commit

Permalink
improve same uuid and name checks
Browse files Browse the repository at this point in the history
we didn't return so the login event was fired for a disconnected player
  • Loading branch information
Outfluencer authored Aug 7, 2024
1 parent c310e33 commit aadbec9
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -580,34 +580,24 @@ private void finish()
}
}

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<LoginEvent> complete = new Callback<LoginEvent>()
Expand Down

0 comments on commit aadbec9

Please sign in to comment.