Add option to force default server

This commit is contained in:
md_5 2013-01-05 20:59:41 +11:00
parent 73bc6561f2
commit d622041d45
2 changed files with 3 additions and 1 deletions

View File

@ -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.

View File

@ -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);