From 3ba21918299949671a07fd2e91d18ed38dda331e Mon Sep 17 00:00:00 2001 From: KennyTV Date: Tue, 30 Jun 2020 13:51:06 +0200 Subject: [PATCH] Fix late Bungee connection cancelling --- .../ViaVersion/bungee/handlers/BungeeServerHandler.java | 7 +++---- .../protocol1_16to1_15_2/Protocol1_16To1_15_2.java | 4 +++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bungee/src/main/java/us/myles/ViaVersion/bungee/handlers/BungeeServerHandler.java b/bungee/src/main/java/us/myles/ViaVersion/bungee/handlers/BungeeServerHandler.java index 96e27e21e..c0f6d78b4 100644 --- a/bungee/src/main/java/us/myles/ViaVersion/bungee/handlers/BungeeServerHandler.java +++ b/bungee/src/main/java/us/myles/ViaVersion/bungee/handlers/BungeeServerHandler.java @@ -64,7 +64,7 @@ public class BungeeServerHandler implements Listener { } // Set the handshake version every time someone connects to any server - @EventHandler + @EventHandler(priority = 120) public void onServerConnect(ServerConnectEvent e) { if (e.isCancelled()) { return; @@ -89,7 +89,7 @@ public class BungeeServerHandler implements Listener { } } - @EventHandler(priority = EventPriority.LOWEST) + @EventHandler(priority = -120) public void onServerConnected(ServerConnectedEvent e) { try { checkServerChange(e, Via.getManager().getConnection(e.getPlayer().getUniqueId())); @@ -98,7 +98,7 @@ public class BungeeServerHandler implements Listener { } } - @EventHandler(priority = EventPriority.LOWEST) + @EventHandler(priority = -120) public void onServerSwitch(ServerSwitchEvent e) { // Update entity id UserConnection userConnection = Via.getManager().getConnection(e.getPlayer().getUniqueId()); @@ -116,7 +116,6 @@ public class BungeeServerHandler implements Listener { } } - public void checkServerChange(ServerConnectedEvent e, UserConnection user) throws Exception { if (user == null) return; // Auto-team handling diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_16to1_15_2/Protocol1_16To1_15_2.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_16to1_15_2/Protocol1_16To1_15_2.java index 0cc700eec..b27aba8c3 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_16to1_15_2/Protocol1_16To1_15_2.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_16to1_15_2/Protocol1_16To1_15_2.java @@ -189,7 +189,9 @@ public class Protocol1_16To1_15_2 extends Protocol { String channel = wrapper.passthrough(Type.STRING); if (channel.length() > 32) { - Via.getPlatform().getLogger().warning("Ignoring incoming plugin channel, as it is longer than 32 characters: " + channel); + if (!Via.getConfig().isSuppressConversionWarnings()) { + Via.getPlatform().getLogger().warning("Ignoring incoming plugin channel, as it is longer than 32 characters: " + channel); + } wrapper.cancel(); } });