#1848: Added missing call to UserConnection.connect callback for "already_connected" and "already_connecting"

This commit is contained in:
BuildTools 2016-05-05 07:24:37 -04:00 committed by md_5
parent 80b3135a93
commit 4c7c64c9b8

View File

@ -256,6 +256,10 @@ public final class UserConnection implements ProxiedPlayer
ServerConnectEvent event = new ServerConnectEvent( this, info );
if ( bungee.getPluginManager().callEvent( event ).isCancelled() )
{
if ( callback != null )
{
callback.done( false, null );
}
return;
}
@ -263,11 +267,21 @@ public final class UserConnection implements ProxiedPlayer
if ( getServer() != null && Objects.equal( getServer().getInfo(), target ) )
{
if ( callback != null )
{
callback.done( false, null );
}
sendMessage( bungee.getTranslation( "already_connected" ) );
return;
}
if ( pendingConnects.contains( target ) )
{
if ( callback != null )
{
callback.done( false, null );
}
sendMessage( bungee.getTranslation( "already_connecting" ) );
return;
}