diff --git a/src/main/java/net/md_5/bungee/Configuration.java b/src/main/java/net/md_5/bungee/Configuration.java index c199cae6..23ec2af3 100644 --- a/src/main/java/net/md_5/bungee/Configuration.java +++ b/src/main/java/net/md_5/bungee/Configuration.java @@ -133,6 +133,7 @@ public class Configuration */ public String statsUuid = UUID.randomUUID().toString(); public boolean metricsEnabled = true; + public boolean forceDefaultServer = false; /** * Load the configuration and save default values. diff --git a/src/main/java/net/md_5/bungee/InitialHandler.java b/src/main/java/net/md_5/bungee/InitialHandler.java index 4e35f24c..28872d34 100644 --- a/src/main/java/net/md_5/bungee/InitialHandler.java +++ b/src/main/java/net/md_5/bungee/InitialHandler.java @@ -77,7 +77,8 @@ public class InitialHandler implements Runnable } UserConnection userCon = new UserConnection(socket, in, out, handshake, customPackets); - userCon.connect(BungeeCord.instance.config.getServer(handshake.username, handshake.host)); + String server = (BungeeCord.instance.config.forceDefaultServer) ? BungeeCord.instance.config.defaultServerName : BungeeCord.instance.config.getServer(handshake.username, handshake.host); + userCon.connect(server); break; case 0xFE: socket.setSoTimeout(100);