Kick only in online mode: #1382

This commit is contained in:
md_5 2015-02-28 12:59:40 +11:00
parent e1951c5d66
commit f2673c5876

View File

@ -416,20 +416,23 @@ public class InitialHandler extends PacketHandler implements PendingConnection
private void finish() private void finish()
{ {
// Check for multiple connections if ( isOnlineMode() )
// We have to check for the old name first
ProxiedPlayer oldName = bungee.getPlayer( getName() );
if ( oldName != null )
{ {
// TODO See #1218 // Check for multiple connections
oldName.disconnect( bungee.getTranslation( "already_connected" ) ); // We have to check for the old name first
} ProxiedPlayer oldName = bungee.getPlayer( getName() );
// And then also for their old UUID if ( oldName != null )
ProxiedPlayer oldID = bungee.getPlayer( getUniqueId() ); {
if ( oldID != null ) // TODO See #1218
{ oldName.disconnect( bungee.getTranslation( "already_connected" ) );
// TODO See #1218 }
oldID.disconnect( bungee.getTranslation( "already_connected" ) ); // And then also for their old UUID
ProxiedPlayer oldID = bungee.getPlayer( getUniqueId() );
if ( oldID != null )
{
// TODO See #1218
oldID.disconnect( bungee.getTranslation( "already_connected" ) );
}
} }
offlineId = java.util.UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + getName() ).getBytes( Charsets.UTF_8 ) ); offlineId = java.util.UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + getName() ).getBytes( Charsets.UTF_8 ) );