mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-22 10:05:12 +01:00
Fix late Bungee connection cancelling
This commit is contained in:
parent
26de3fe573
commit
3ba2191829
@ -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
|
||||
|
@ -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();
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user