[#1218] Check which player instance we remove from the connection maps.
Legitimate but slightly sneaky fix for the issue of racing for addition / removal. An alternate fix would be a multimap.
This commit is contained in:
parent
efdedbd4e8
commit
dcc9be9dfe
@ -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<String> getDisabledCommands()
|
||||
{
|
||||
return config.getDisabledCommands();
|
||||
|
@ -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" ) );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user