From fa82e0ab961d110cb6ef761d896b00c01479aa53 Mon Sep 17 00:00:00 2001 From: ME1312 Date: Mon, 24 Aug 2020 12:04:21 -0400 Subject: [PATCH] More debug messages --- .../Bungee/Library/ConfigUpdater.java | 2 +- .../ME1312/SubServers/Bungee/SubProxy.java | 17 +++++++++------- SubServers.Creator/src/Paper/build.sh | 8 ++++---- .../net/ME1312/SubServers/Sync/ExProxy.java | 20 +++++++++---------- .../Sync/Library/ConfigUpdater.java | 2 +- 5 files changed, 26 insertions(+), 23 deletions(-) diff --git a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Library/ConfigUpdater.java b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Library/ConfigUpdater.java index 70e1f712..e982f28e 100644 --- a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Library/ConfigUpdater.java +++ b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Library/ConfigUpdater.java @@ -150,7 +150,7 @@ public class ConfigUpdater { if (i > 0) { YAMLSection settings = new YAMLSection(); settings.set("Version", ((now.compareTo(was) <= 0)?was:now).toString()); - if (updated.getMap("Settings", new YAMLSection()).contains("RemotePlayer-Cache-Interval")) settings.set("RemotePlayer-Cache-Interval", updated.getMap("Settings").getRawString("RemotePlayer-Cache-Interval")); + if (updated.getMap("Settings", new YAMLSection()).contains("RPEC-Check-Interval")) settings.set("RPEC-Check-Interval", updated.getMap("Settings").getRawString("RPEC-Check-Interval")); settings.set("Disabled-Overrides", updated.getMap("Settings", new YAMLSection()).getRawStringList("Disabled-Overrides", Collections.emptyList())); YAMLSection smart_fallback = new YAMLSection(); diff --git a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/SubProxy.java b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/SubProxy.java index ba98eef1..8ece09ad 100644 --- a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/SubProxy.java +++ b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/SubProxy.java @@ -999,15 +999,18 @@ public final class SubProxy extends BungeeCord implements Listener { @EventHandler(priority = Byte.MIN_VALUE) public void resetPlayer(PlayerDisconnectEvent e) { - fallbackLimbo.remove(e.getPlayer().getUniqueId()); - SubCommand.players.remove(e.getPlayer().getUniqueId()); + UUID id = e.getPlayer().getUniqueId(); + fallbackLimbo.remove(id); + SubCommand.players.remove(id); + Logger.get("SubServers").info("PlayerDisconnectEvent(" + id + ")"); synchronized (rPlayers) { - if (rPlayers.containsKey(e.getPlayer().getUniqueId()) && (!rPlayerLinkP.containsKey(e.getPlayer().getUniqueId()) || rPlayerLinkP.get(e.getPlayer().getUniqueId()).isMaster())) { - RemotePlayer player = rPlayers.get(e.getPlayer().getUniqueId()); - rPlayerLinkS.remove(e.getPlayer().getUniqueId()); - rPlayerLinkP.remove(e.getPlayer().getUniqueId()); - rPlayers.remove(e.getPlayer().getUniqueId()); + if (rPlayers.containsKey(id) && (!rPlayerLinkP.containsKey(id) || rPlayerLinkP.get(id).isMaster())) { + Logger.get("SubServers").info("RP::Remove(" + id + ")"); + RemotePlayer player = rPlayers.get(id); + rPlayerLinkS.remove(id); + rPlayerLinkP.remove(id); + rPlayers.remove(id); for (Proxy proxy : SubAPI.getInstance().getProxies().values()) if (proxy.getSubData()[0] != null) { ((SubDataClient) proxy.getSubData()[0]).sendPacket(new PacketExSyncPlayer(mProxy.getName(), false, player)); diff --git a/SubServers.Creator/src/Paper/build.sh b/SubServers.Creator/src/Paper/build.sh index 9c2b4cda..cd090642 100644 --- a/SubServers.Creator/src/Paper/build.sh +++ b/SubServers.Creator/src/Paper/build.sh @@ -44,9 +44,9 @@ if [[ $__RETURN -eq 0 ]]; then exit 4 fi else - echo ERROR: Failed downloading Paper. Is PaperMC.io down? - __Restore - rm -Rf "$0" - exit 3 + echo ERROR: Failed downloading Paper. Is PaperMC.io down? + __Restore + rm -Rf "$0" + exit 3 fi exit 2 \ No newline at end of file diff --git a/SubServers.Sync/src/net/ME1312/SubServers/Sync/ExProxy.java b/SubServers.Sync/src/net/ME1312/SubServers/Sync/ExProxy.java index 29c90aa9..c7182284 100644 --- a/SubServers.Sync/src/net/ME1312/SubServers/Sync/ExProxy.java +++ b/SubServers.Sync/src/net/ME1312/SubServers/Sync/ExProxy.java @@ -250,7 +250,6 @@ public final class ExProxy extends BungeeCord implements Listener { ArrayList add = new ArrayList(); for (ProxiedPlayer player : getPlayers()) { if (!rPlayers.containsKey(player.getUniqueId())) { // Add players that don't exist - Logger.get("SubServers").info("RPEC::Add(" + player.getUniqueId() + ")"); RemotePlayer p = new RemotePlayer(player); rPlayerLinkP.put(player.getUniqueId(), p.getProxy().toLowerCase()); rPlayers.put(player.getUniqueId(), p); @@ -261,7 +260,6 @@ public final class ExProxy extends BungeeCord implements Listener { ArrayList remove = new ArrayList(); for (NamedContainer player : proxy.getPlayers()) { // Remove players that shouldn't exist if (getPlayer(player.get()) == null) { - Logger.get("SubServers").info("RPEC::Remove(" + player + ")"); remove.add(rPlayers.get(player.get())); rPlayerLinkS.remove(player.get()); rPlayerLinkP.remove(player.get()); @@ -270,7 +268,6 @@ public final class ExProxy extends BungeeCord implements Listener { } for (UUID player : Util.getBackwards(rPlayerLinkP, api.getName().toLowerCase())) { // Remove players that shouldn't exist (internally) if (getPlayer(player) == null) { - Logger.get("SubServers").info("RPEC::Internal(" + player + ")"); rPlayerLinkS.remove(player); rPlayerLinkP.remove(player); rPlayers.remove(player); @@ -537,17 +534,20 @@ public final class ExProxy extends BungeeCord implements Listener { @EventHandler(priority = Byte.MIN_VALUE) public void resetPlayer(PlayerDisconnectEvent e) { - fallbackLimbo.remove(e.getPlayer().getUniqueId()); - SubCommand.permitted.remove(e.getPlayer().getUniqueId()); + UUID id = e.getPlayer().getUniqueId(); + fallbackLimbo.remove(id); + SubCommand.permitted.remove(id); synchronized (rPlayers) { - if (rPlayers.containsKey(e.getPlayer().getUniqueId()) && (!rPlayerLinkP.containsKey(e.getPlayer().getUniqueId()) || rPlayerLinkP.get(e.getPlayer().getUniqueId()).equalsIgnoreCase(api.getName()))) { + if (rPlayers.containsKey(id) && (!rPlayerLinkP.containsKey(id) || rPlayerLinkP.get(id).equalsIgnoreCase(api.getName()))) { + RemotePlayer player = rPlayers.get(id); + rPlayerLinkS.remove(id); + rPlayerLinkP.remove(id); + rPlayers.remove(id); + if (api.getSubDataNetwork()[0] != null) { - ((SubDataClient) api.getSubDataNetwork()[0]).sendPacket(new PacketExSyncPlayer(false, rPlayers.get(e.getPlayer().getUniqueId()))); + ((SubDataClient) api.getSubDataNetwork()[0]).sendPacket(new PacketExSyncPlayer(false, player)); } - rPlayerLinkS.remove(e.getPlayer().getUniqueId()); - rPlayerLinkP.remove(e.getPlayer().getUniqueId()); - rPlayers.remove(e.getPlayer().getUniqueId()); } } } diff --git a/SubServers.Sync/src/net/ME1312/SubServers/Sync/Library/ConfigUpdater.java b/SubServers.Sync/src/net/ME1312/SubServers/Sync/Library/ConfigUpdater.java index 9fae6542..f08bf16c 100644 --- a/SubServers.Sync/src/net/ME1312/SubServers/Sync/Library/ConfigUpdater.java +++ b/SubServers.Sync/src/net/ME1312/SubServers/Sync/Library/ConfigUpdater.java @@ -74,7 +74,7 @@ public class ConfigUpdater { if (i > 0) { YAMLSection settings = new YAMLSection(); settings.set("Version", ((now.compareTo(was) <= 0)?was:now).toString()); - if (updated.getMap("Settings", new YAMLSection()).contains("RemotePlayer-Cache-Interval")) settings.set("RemotePlayer-Cache-Interval", updated.getMap("Settings").getRawString("RemotePlayer-Cache-Interval")); + if (updated.getMap("Settings", new YAMLSection()).contains("RPEC-Check-Interval")) settings.set("RPEC-Check-Interval", updated.getMap("Settings").getRawString("RPEC-Check-Interval")); settings.set("Disabled-Overrides", updated.getMap("Settings", new YAMLSection()).getRawStringList("Disabled-Overrides", Collections.emptyList())); YAMLSection smart_fallback = new YAMLSection();