mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
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
This commit is contained in:
parent
811aba3339
commit
50d3945477
2 changed files with 12 additions and 3 deletions
|
@ -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() : "<IP address withheld>";
|
||||
String ip;
|
||||
if (geyser.getConfig().isLogPlayerIpAddresses()) {
|
||||
if (geyser.getConfig().getBedrock().isEnableProxyProtocol()) {
|
||||
ip = this.proxiedAddresses.getOrDefault(inetSocketAddress, inetSocketAddress).toString();
|
||||
} else {
|
||||
ip = inetSocketAddress.toString();
|
||||
}
|
||||
} else {
|
||||
ip = "<IP address withheld>";
|
||||
}
|
||||
geyser.getLogger().debug(GeyserLocale.getLocaleStringLog("geyser.network.pinged", ip));
|
||||
}
|
||||
|
||||
|
|
|
@ -73,10 +73,10 @@ public class ProxyServerHandler extends SimpleChannelInboundHandler<DatagramPack
|
|||
presentAddress = new InetSocketAddress(decoded.sourceAddress(), decoded.sourcePort());
|
||||
log.debug("Got PROXY header: (from {}) {}", packet.sender(), presentAddress);
|
||||
GeyserImpl.getInstance().getGeyserServer().getProxiedAddresses().put(packet.sender(), presentAddress);
|
||||
return;
|
||||
} else {
|
||||
log.trace("Reusing PROXY header: (from {}) {}", packet.sender(), presentAddress);
|
||||
}
|
||||
|
||||
log.trace("Reusing PROXY header: (from {}) {}", packet.sender(), presentAddress);
|
||||
ctx.fireChannelRead(packet.retain());
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue