Close #474 - 1.5 ping to 1.6 bungee

This commit is contained in:
md_5 2013-07-01 21:20:18 +10:00
parent 5c4ea3c7a0
commit 06e732d8c7
2 changed files with 29 additions and 18 deletions

View File

@ -141,6 +141,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection
} }
private void respondToPing() private void respondToPing()
{
try
{ {
ServerInfo forced = AbstractReconnectManager.getForcedHost( this ); ServerInfo forced = AbstractReconnectManager.getForcedHost( this );
String motd = listener.getMotd(); String motd = listener.getMotd();
@ -161,6 +163,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection
+ "\00" + response.getCurrentPlayers() + "\00" + response.getCurrentPlayers()
+ "\00" + response.getMaxPlayers(); + "\00" + response.getMaxPlayers();
disconnect( kickMessage ); disconnect( kickMessage );
} catch ( Throwable t )
{
t.printStackTrace();
}
} }
@Override @Override
@ -173,7 +179,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
{ {
respondToPing(); respondToPing();
} }
}, 1000, TimeUnit.MILLISECONDS ); }, 500, TimeUnit.MILLISECONDS );
} }
@Override @Override

View File

@ -30,6 +30,11 @@ public abstract class AbstractReconnectManager implements ReconnectHandler
public static ServerInfo getForcedHost(PendingConnection con) public static ServerInfo getForcedHost(PendingConnection con)
{ {
if ( con.getVirtualHost() == null )
{
return null;
}
String forced = con.getListener().getForcedHosts().get( con.getVirtualHost().getHostString() ); String forced = con.getListener().getForcedHosts().get( con.getVirtualHost().getHostString() );
if ( forced == null && con.getListener().isForceDefault() ) if ( forced == null && con.getListener().isForceDefault() )