From 49f2f5f28b72bfb38b35fef21c4a03f76b468fb5 Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 19 Mar 2013 11:40:56 +1100 Subject: [PATCH] Fix issue #211 - ServerInfo.ping --- proxy/src/main/java/net/md_5/bungee/BungeeServerInfo.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeServerInfo.java b/proxy/src/main/java/net/md_5/bungee/BungeeServerInfo.java index 7a73272a..4762ce3b 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeServerInfo.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeServerInfo.java @@ -59,12 +59,14 @@ public class BungeeServerInfo extends ServerInfo @Override public void operationComplete(ChannelFuture future) throws Exception { - if ( !future.isSuccess() ) + if ( future.isSuccess() ) + { + future.channel().pipeline().get( HandlerBoss.class ).setHandler( new PingHandler( BungeeServerInfo.this, callback ) ); + } else { callback.done( null, future.cause() ); } } - } ) - .channel().pipeline().get( HandlerBoss.class ).setHandler( new PingHandler( this, callback ) ); + } ); } }