From 704fe11b052d2267b9a916d538dc665839730198 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 14 Mar 2013 21:18:59 +1100 Subject: [PATCH] Make forced hosts take higher priority than force default. Closes #184 --- .../java/net/md_5/bungee/YamlReconnectHandler.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/proxy/src/main/java/net/md_5/bungee/YamlReconnectHandler.java b/proxy/src/main/java/net/md_5/bungee/YamlReconnectHandler.java index 048d73e91..2a983d5c1 100644 --- a/proxy/src/main/java/net/md_5/bungee/YamlReconnectHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/YamlReconnectHandler.java @@ -53,15 +53,14 @@ public class YamlReconnectHandler implements ReconnectHandler { ListenerInfo listener = player.getPendingConnection().getListener(); String name; - if ( listener.isForceDefault() ) + String forced = listener.getForcedHosts().get( player.getPendingConnection().getVirtualHost().getHostName() ); + if ( forced == null && listener.isForceDefault() ) { - name = 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(); + forced = listener.getDefaultServer(); } + + String server = ( forced == null ) ? data.get( key( player ) ) : forced; + name = ( server != null ) ? server : listener.getDefaultServer(); ServerInfo info = ProxyServer.getInstance().getServerInfo( name ); if ( info == null ) {