forked from BLOCKFANTASY/LOOHP-Limbo
conditionalize debug messages on debug flag
This commit is contained in:
parent
39d90d79ff
commit
a1ba8fc0b1
|
|
@ -362,6 +362,7 @@ public class ClientConnection extends Thread {
|
||||||
state = ClientState.LOGIN;
|
state = ClientState.LOGIN;
|
||||||
|
|
||||||
if (isBungeecord || isBungeeGuard) {
|
if (isBungeecord || isBungeeGuard) {
|
||||||
|
ServerProperties properties = Limbo.getInstance().getServerProperties();
|
||||||
try {
|
try {
|
||||||
String[] data = bungeeForwarding.split("\\x00");
|
String[] data = bungeeForwarding.split("\\x00");
|
||||||
String host = "";
|
String host = "";
|
||||||
|
|
@ -370,8 +371,11 @@ public class ClientConnection extends Thread {
|
||||||
String bungee = "";
|
String bungee = "";
|
||||||
String skinData = "";
|
String skinData = "";
|
||||||
int state = 0;
|
int state = 0;
|
||||||
for(int i = 0; i < data.length; i++) {
|
for (int i = 0; i < data.length; i++) {
|
||||||
Limbo.getInstance().getConsole().sendMessage(String.valueOf(i) + ": " + data[i]);
|
if (!properties.isReducedDebugInfo()) {
|
||||||
|
Limbo.getInstance().getConsole().sendMessage(String.valueOf(i) + ": " + data[i]);
|
||||||
|
}
|
||||||
|
|
||||||
switch(state) {
|
switch(state) {
|
||||||
default:
|
default:
|
||||||
Limbo.getInstance().getConsole().sendMessage(String.valueOf(i) + ": ignore data: State: " + String.valueOf(state));
|
Limbo.getInstance().getConsole().sendMessage(String.valueOf(i) + ": ignore data: State: " + String.valueOf(state));
|
||||||
|
|
@ -401,12 +405,17 @@ public class ClientConnection extends Thread {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (state != 6) {
|
||||||
|
throw new IllegalStateException("Illegal bungee state: " + String.valueOf(state));
|
||||||
|
}
|
||||||
|
|
||||||
Limbo.getInstance().getConsole().sendMessage("Host: " + host);
|
if (!properties.isReducedDebugInfo()) {
|
||||||
Limbo.getInstance().getConsole().sendMessage("Floodgate: " + floodgate);
|
Limbo.getInstance().getConsole().sendMessage("Host: " + host);
|
||||||
Limbo.getInstance().getConsole().sendMessage("clientIp: " + clientIp);
|
Limbo.getInstance().getConsole().sendMessage("Floodgate: " + floodgate);
|
||||||
Limbo.getInstance().getConsole().sendMessage("bungee: " + bungee);
|
Limbo.getInstance().getConsole().sendMessage("clientIp: " + clientIp);
|
||||||
Limbo.getInstance().getConsole().sendMessage("skinData: " + skinData);
|
Limbo.getInstance().getConsole().sendMessage("bungee: " + bungee);
|
||||||
|
Limbo.getInstance().getConsole().sendMessage("skinData: " + skinData);
|
||||||
|
}
|
||||||
|
|
||||||
bungeeUUID = UUID.fromString(bungee.replaceFirst("([0-9a-fA-F]{8})([0-9a-fA-F]{4})([0-9a-fA-F]{4})([0-9a-fA-F]{4})([0-9a-fA-F]+)", "$1-$2-$3-$4-$5"));
|
bungeeUUID = UUID.fromString(bungee.replaceFirst("([0-9a-fA-F]{8})([0-9a-fA-F]{4})([0-9a-fA-F]{4})([0-9a-fA-F]{4})([0-9a-fA-F]+)", "$1-$2-$3-$4-$5"));
|
||||||
inetAddress = InetAddress.getByName(clientIp);
|
inetAddress = InetAddress.getByName(clientIp);
|
||||||
|
|
@ -434,10 +443,12 @@ public class ClientConnection extends Thread {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
StringWriter sw = new StringWriter();
|
if (!properties.isReducedDebugInfo()) {
|
||||||
PrintWriter pw = new PrintWriter(sw);
|
StringWriter sw = new StringWriter();
|
||||||
e.printStackTrace(pw);
|
PrintWriter pw = new PrintWriter(sw);
|
||||||
Limbo.getInstance().getConsole().sendMessage(sw.toString());
|
e.printStackTrace(pw);
|
||||||
|
Limbo.getInstance().getConsole().sendMessage(sw.toString());
|
||||||
|
}
|
||||||
Limbo.getInstance().getConsole().sendMessage("If you wish to use bungeecord's IP forwarding, please enable that in your bungeecord config.yml as well!");
|
Limbo.getInstance().getConsole().sendMessage("If you wish to use bungeecord's IP forwarding, please enable that in your bungeecord config.yml as well!");
|
||||||
disconnectDuringLogin(new BaseComponent[] {new TextComponent(ChatColor.RED + "Please connect from the proxy!")});
|
disconnectDuringLogin(new BaseComponent[] {new TextComponent(ChatColor.RED + "Please connect from the proxy!")});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue