From a02b601b6c5d343475767685c0e5f39780e09c6e Mon Sep 17 00:00:00 2001 From: Gijs de Jong <14833076+oxkitsune@users.noreply.github.com> Date: Thu, 23 May 2024 20:09:53 +0200 Subject: [PATCH 1/2] Pass through packets in config state (#1326) --- .../connection/client/ClientConfigSessionHandler.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientConfigSessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientConfigSessionHandler.java index c1ed4a87ae..d9c5295db8 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientConfigSessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientConfigSessionHandler.java @@ -128,17 +128,20 @@ public boolean handle(final PluginMessagePacket packet) { public boolean handle(PingIdentifyPacket packet) { if (player.getConnectionInFlight() != null) { player.getConnectionInFlight().ensureConnected().write(packet); + return true; } - return true; + + return false; } @Override public boolean handle(KnownPacksPacket packet) { if (player.getConnectionInFlight() != null) { player.getConnectionInFlight().ensureConnected().write(packet); + return true; } - return true; + return false; } @Override From 71bb0246a8bf7507b570e6a82a99ce77a33ad19d Mon Sep 17 00:00:00 2001 From: "Pantera (Mad_Daniel)" <89838384+Pantera07@users.noreply.github.com> Date: Fri, 24 May 2024 03:12:28 +0900 Subject: [PATCH 2/2] Fix query listener reload bug (#1322) --- .../main/java/com/velocitypowered/proxy/VelocityServer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java b/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java index 1a9d71cb41..ef8217c696 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java @@ -469,11 +469,11 @@ public boolean reloadConfiguration() throws IOException { boolean queryPortChanged = newConfiguration.getQueryPort() != configuration.getQueryPort(); boolean queryAlreadyEnabled = configuration.isQueryEnabled(); boolean queryEnabled = newConfiguration.isQueryEnabled(); - if ((!queryEnabled && queryAlreadyEnabled) || queryPortChanged) { + if (queryAlreadyEnabled && (!queryEnabled || queryPortChanged)) { this.cm.close(new InetSocketAddress( configuration.getBind().getHostString(), configuration.getQueryPort())); } - if (queryEnabled && queryPortChanged) { + if (queryEnabled && (!queryAlreadyEnabled || queryPortChanged)) { this.cm.queryBind(newConfiguration.getBind().getHostString(), newConfiguration.getQueryPort()); }