Fix late Bungee connection cancelling

This commit is contained in:
KennyTV 2020-06-30 13:51:06 +02:00
parent 26de3fe573
commit 3ba2191829
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
2 changed files with 6 additions and 5 deletions

View File

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

View File

@ -189,7 +189,9 @@ public class Protocol1_16To1_15_2 extends Protocol<ClientboundPackets1_15, Clien
handler(wrapper -> {
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();
}
});