mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-18 08:15:19 +01:00
[#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
@ -602,15 +602,20 @@ public class BungeeCord extends ProxyServer
|
||||
{
|
||||
connectionLock.writeLock().lock();
|
||||
try
|
||||
{
|
||||
// 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