From 50d3945477d928b2e3f486f7fb5ca2a56e9bd837 Mon Sep 17 00:00:00 2001 From: DeveloperDragon <42499964+TotoTheDragon@users.noreply.github.com> Date: Tue, 20 Jun 2023 15:28:31 +0200 Subject: [PATCH] Fix/proxy protocol missing message (#3898) * Show proxy protocol ip for debug message * Make sure that first message that contains proxy protocol also gets sent. This caused issues with serverlists and console players --- .../geysermc/geyser/network/netty/GeyserServer.java | 11 ++++++++++- .../network/netty/proxy/ProxyServerHandler.java | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/network/netty/GeyserServer.java b/core/src/main/java/org/geysermc/geyser/network/netty/GeyserServer.java index 31a355011..22f46ee22 100644 --- a/core/src/main/java/org/geysermc/geyser/network/netty/GeyserServer.java +++ b/core/src/main/java/org/geysermc/geyser/network/netty/GeyserServer.java @@ -187,7 +187,16 @@ public final class GeyserServer { public BedrockPong onQuery(InetSocketAddress inetSocketAddress) { if (geyser.getConfig().isDebugMode() && PRINT_DEBUG_PINGS) { - String ip = geyser.getConfig().isLogPlayerIpAddresses() ? inetSocketAddress.toString() : ""; + String ip; + if (geyser.getConfig().isLogPlayerIpAddresses()) { + if (geyser.getConfig().getBedrock().isEnableProxyProtocol()) { + ip = this.proxiedAddresses.getOrDefault(inetSocketAddress, inetSocketAddress).toString(); + } else { + ip = inetSocketAddress.toString(); + } + } else { + ip = ""; + } geyser.getLogger().debug(GeyserLocale.getLocaleStringLog("geyser.network.pinged", ip)); } diff --git a/core/src/main/java/org/geysermc/geyser/network/netty/proxy/ProxyServerHandler.java b/core/src/main/java/org/geysermc/geyser/network/netty/proxy/ProxyServerHandler.java index 68d3a298c..0d61ed0d4 100644 --- a/core/src/main/java/org/geysermc/geyser/network/netty/proxy/ProxyServerHandler.java +++ b/core/src/main/java/org/geysermc/geyser/network/netty/proxy/ProxyServerHandler.java @@ -73,10 +73,10 @@ public class ProxyServerHandler extends SimpleChannelInboundHandler