diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java index e27b245aa..5a8287543 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -146,7 +146,7 @@ public class BungeeCord extends ProxyServer private ConnectionThrottle connectionThrottle; private final ModuleManager moduleManager = new ModuleManager(); - + { // TODO: Proper fallback when we interface the manager getPluginManager().registerCommand( null, new CommandReload() ); @@ -603,14 +603,19 @@ public class BungeeCord extends ProxyServer connectionLock.writeLock().lock(); try { - connections.remove( con.getName() ); - connectionsByOfflineUUID.remove( con.getPendingConnection().getOfflineId() ); + // TODO See #1218 + if ( connections.get( con.getName() ) == con ) + { + connections.remove( con.getName() ); + connectionsByOfflineUUID.remove( con.getPendingConnection().getOfflineId() ); + } } finally { connectionLock.writeLock().unlock(); } } + @Override public Collection getDisabledCommands() { return config.getDisabledCommands(); 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 fa9753e12..8dddd189b 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 @@ -379,6 +379,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection ProxiedPlayer old = bungee.getPlayer( getName() ); if ( old != null ) { + // TODO See #1218 old.disconnect( bungee.getTranslation( "already_connected" ) ); }