Make forced hosts take higher priority than force default. Closes #184

This commit is contained in:
md_5 2013-03-14 21:18:59 +11:00
parent 4811e7be4f
commit 704fe11b05

View File

@ -53,15 +53,14 @@ public class YamlReconnectHandler implements ReconnectHandler
{ {
ListenerInfo listener = player.getPendingConnection().getListener(); ListenerInfo listener = player.getPendingConnection().getListener();
String name; String name;
if ( listener.isForceDefault() ) String forced = listener.getForcedHosts().get( player.getPendingConnection().getVirtualHost().getHostName() );
if ( forced == null && listener.isForceDefault() )
{ {
name = listener.getDefaultServer(); forced = listener.getDefaultServer();
} else
{
String forced = listener.getForcedHosts().get( player.getPendingConnection().getVirtualHost().getHostName() );
String server = ( forced == null ) ? data.get( key( player ) ) : forced;
name = ( server != null ) ? server : listener.getDefaultServer();
} }
String server = ( forced == null ) ? data.get( key( player ) ) : forced;
name = ( server != null ) ? server : listener.getDefaultServer();
ServerInfo info = ProxyServer.getInstance().getServerInfo( name ); ServerInfo info = ProxyServer.getInstance().getServerInfo( name );
if ( info == null ) if ( info == null )
{ {