From f2673c5876551214cfa0f1915b21936787b0e20b Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 28 Feb 2015 12:59:40 +1100 Subject: [PATCH] Kick only in online mode: #1382 --- .../bungee/connection/InitialHandler.java | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 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 1e8a0f3b..c5082683 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 @@ -416,20 +416,23 @@ public class InitialHandler extends PacketHandler implements PendingConnection private void finish() { - // Check for multiple connections - // We have to check for the old name first - ProxiedPlayer oldName = bungee.getPlayer( getName() ); - if ( oldName != null ) + if ( isOnlineMode() ) { - // TODO See #1218 - oldName.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" ) ); + // Check for multiple connections + // We have to check for the old name first + ProxiedPlayer oldName = bungee.getPlayer( getName() ); + if ( oldName != null ) + { + // TODO See #1218 + oldName.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 ) );