Skip to content

Commit

Permalink
Add some debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ME1312 committed Apr 13, 2021
1 parent 0ac4238 commit 5898371
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
Expand Up @@ -601,7 +601,8 @@ public void reload() throws IOException {
}

Logger.get("SubData").info("");
subdata = subprotocol.open((config.get().getMap("Settings").getMap("SubData").getRawString("Address", "127.0.0.1:4391").split(":")[0].equals("0.0.0.0"))?null:InetAddress.getByName(config.get().getMap("Settings").getMap("SubData").getRawString("Address", "127.0.0.1:4391").split(":")[0]),
subdata = subprotocol.open((config.get().getMap("Settings").getMap("SubData").getRawString("Address", "127.0.0.1:4391").split(":")[0].equals("0.0.0.0"))?
null:InetAddress.getByName(config.get().getMap("Settings").getMap("SubData").getRawString("Address", "127.0.0.1:4391").split(":")[0]),
Integer.parseInt(config.get().getMap("Settings").getMap("SubData").getRawString("Address", "127.0.0.1:4391").split(":")[1]), cipher);
} // Add new entries to Allowed-Connections
for (String s : config.get().getMap("Settings").getMap("SubData").getStringList("Whitelist", new ArrayList<String>())) {
Expand Down Expand Up @@ -1053,6 +1054,7 @@ public void fallback(ServerKickEvent e) {
}

if (!state.servers.isEmpty()) {
Logger.get("SFD").info("Triggered Fallback for " + e.getPlayer().getName() + " from " + e.getKickedFrom().getName());
e.setCancelled(true);
e.getPlayer().sendMessage(api.getLang("SubServers", "Bungee.Feature.Smart-Fallback").replace("$str$", (e.getKickedFrom() instanceof Server)?((Server) e.getKickedFrom()).getDisplayName():e.getKickedFrom().getName()).replace("$msg$", e.getKickReason()));
if (init) fallback.put(e.getPlayer().getUniqueId(), state);
Expand Down
Expand Up @@ -183,8 +183,7 @@ private void connect(Pair<DisconnectReason, DataClient> disconnect) throws IOExc
public void run() {
try {
if (reset == resetDate && (subdata.getOrDefault(0, null) == null || subdata.get(0).isClosed())) {
SubDataClient open = subprotocol.open((config.get().getMap("Settings").getMap("SubData").getRawString("Address", "127.0.0.1:4391").split(":")[0].equals("0.0.0.0"))?
null:InetAddress.getByName(config.get().getMap("Settings").getMap("SubData").getRawString("Address", "127.0.0.1:4391").split(":")[0]),
SubDataClient open = subprotocol.open(InetAddress.getByName(config.get().getMap("Settings").getMap("SubData").getRawString("Address", "127.0.0.1:4391").split(":")[0]),
Integer.parseInt(config.get().getMap("Settings").getMap("SubData").getRawString("Address", "127.0.0.1:4391").split(":")[1]));

if (subdata.getOrDefault(0, null) != null) subdata.get(0).reconnect(open);
Expand Down
Expand Up @@ -198,8 +198,7 @@ private void connect(Pair<DisconnectReason, DataClient> disconnect) throws IOExc
public void run() {
try {
if (reset == resetDate && (subdata.getOrDefault(0, null) == null || subdata.get(0).isClosed())) {
SubDataClient open = subprotocol.open((config.get().getMap("Settings").getMap("SubData").getRawString("Address", "127.0.0.1:4391").split(":")[0].equals("0.0.0.0"))?
null:InetAddress.getByName(config.get().getMap("Settings").getMap("SubData").getRawString("Address", "127.0.0.1:4391").split(":")[0]),
SubDataClient open = subprotocol.open(InetAddress.getByName(config.get().getMap("Settings").getMap("SubData").getRawString("Address", "127.0.0.1:4391").split(":")[0]),
Integer.parseInt(config.get().getMap("Settings").getMap("SubData").getRawString("Address", "127.0.0.1:4391").split(":")[1]));

if (subdata.getOrDefault(0, null) != null) subdata.get(0).reconnect(open);
Expand Down
3 changes: 1 addition & 2 deletions SubServers.Host/src/net/ME1312/SubServers/Host/ExHost.java
Expand Up @@ -275,8 +275,7 @@ private void connect(java.util.logging.Logger log, Pair<DisconnectReason, DataCl
public void run() {
try {
if (reset == resetDate && (subdata.getOrDefault(0, null) == null || subdata.get(0).isClosed())) {
SubDataClient open = subprotocol.open((config.get().getMap("Settings").getMap("SubData").getRawString("Address", "127.0.0.1:4391").split(":")[0].equals("0.0.0.0"))?
null:InetAddress.getByName(config.get().getMap("Settings").getMap("SubData").getRawString("Address", "127.0.0.1:4391").split(":")[0]),
SubDataClient open = subprotocol.open(InetAddress.getByName(config.get().getMap("Settings").getMap("SubData").getRawString("Address", "127.0.0.1:4391").split(":")[0]),
Integer.parseInt(config.get().getMap("Settings").getMap("SubData").getRawString("Address", "127.0.0.1:4391").split(":")[1]));

if (subdata.getOrDefault(0, null) != null) subdata.get(0).reconnect(open);
Expand Down
4 changes: 2 additions & 2 deletions SubServers.Sync/src/net/ME1312/SubServers/Sync/ExProxy.java
Expand Up @@ -233,8 +233,7 @@ private void connect(java.util.logging.Logger log, Pair<DisconnectReason, DataCl
public void run() {
try {
if (reset == resetDate && (subdata.getOrDefault(0, null) == null || subdata.get(0).isClosed())) {
SubDataClient open = subprotocol.open((config.get().getMap("Settings").getMap("SubData").getRawString("Address", "127.0.0.1:4391").split(":")[0].equals("0.0.0.0"))?
null:InetAddress.getByName(config.get().getMap("Settings").getMap("SubData").getRawString("Address", "127.0.0.1:4391").split(":")[0]),
SubDataClient open = subprotocol.open(InetAddress.getByName(config.get().getMap("Settings").getMap("SubData").getRawString("Address", "127.0.0.1:4391").split(":")[0]),
Integer.parseInt(config.get().getMap("Settings").getMap("SubData").getRawString("Address", "127.0.0.1:4391").split(":")[1]));

if (subdata.getOrDefault(0, null) != null) subdata.get(0).reconnect(open);
Expand Down Expand Up @@ -583,6 +582,7 @@ public void fallback(ServerKickEvent e) {
}

if (!state.servers.isEmpty()) {
Logger.get("SFD").info("Triggered Fallback for " + e.getPlayer().getName() + " from " + e.getKickedFrom().getName());
e.setCancelled(true);
e.getPlayer().sendMessage(api.getLang("SubServers", "Bungee.Feature.Smart-Fallback").replace("$str$", (e.getKickedFrom() instanceof ServerImpl)?((ServerImpl) e.getKickedFrom()).getDisplayName():e.getKickedFrom().getName()).replace("$msg$", e.getKickReason()));
if (init) fallback.put(e.getPlayer().getUniqueId(), state);
Expand Down

0 comments on commit 5898371

Please sign in to comment.