From d622041d4540177da750b6ff9b1fe14bd04b1e40 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 5 Jan 2013 20:59:41 +1100 Subject: [PATCH] Add option to force default server --- src/main/java/net/md_5/bungee/Configuration.java | 1 + src/main/java/net/md_5/bungee/InitialHandler.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) 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);