From 4c7c64c9b8092016c860cc414f94e49e3a66f63b Mon Sep 17 00:00:00 2001 From: BuildTools Date: Thu, 5 May 2016 07:24:37 -0400 Subject: [PATCH] #1848: Added missing call to UserConnection.connect callback for "already_connected" and "already_connecting" --- .../main/java/net/md_5/bungee/UserConnection.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java index a33b84ae..a5010f3e 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -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; }