@@ -233,7 +233,7 @@ private ServerBootstrap createBootstrap() {
233233 .childHandler (serverInitializer );
234234 }
235235
236- public boolean onConnectionRequest (InetSocketAddress inetSocketAddress ) {
236+ public boolean onConnectionRequest (InetSocketAddress inetSocketAddress , InetSocketAddress clientAddress ) {
237237 List <String > allowedProxyIPs = geyser .config ().advanced ().bedrock ().haproxyProtocolWhitelistedIps ();
238238 if (geyser .config ().advanced ().bedrock ().useHaproxyProtocol () && !allowedProxyIPs .isEmpty ()) {
239239 boolean isWhitelistedIP = false ;
@@ -250,11 +250,11 @@ public boolean onConnectionRequest(InetSocketAddress inetSocketAddress) {
250250 }
251251 }
252252
253- String ip = geyser .config ().logPlayerIpAddresses () ? inetSocketAddress .toString () : "<IP address withheld>" ;
253+ String ip = geyser .config ().logPlayerIpAddresses () ? clientAddress .toString () : "<IP address withheld>" ;
254254
255255 ConnectionRequestEvent requestEvent = new ConnectionRequestEvent (
256- inetSocketAddress ,
257- null // TODO
256+ clientAddress ,
257+ geyser . config (). advanced (). bedrock (). useHaproxyProtocol () ? inetSocketAddress : null
258258 );
259259 geyser .eventBus ().fire (requestEvent );
260260 if (requestEvent .isCancelled ()) {
@@ -268,9 +268,9 @@ public boolean onConnectionRequest(InetSocketAddress inetSocketAddress) {
268268 return true ;
269269 }
270270
271- public BedrockPong onQuery (Channel channel , InetSocketAddress inetSocketAddress ) {
271+ public BedrockPong onQuery (Channel channel , InetSocketAddress inetSocketAddress , InetSocketAddress clientAddress ) {
272272 if (geyser .config ().debugMode () && PRINT_DEBUG_PINGS ) {
273- String ip = geyser .config ().logPlayerIpAddresses () ? inetSocketAddress .toString () : "<IP address withheld>" ;
273+ String ip = geyser .config ().logPlayerIpAddresses () ? clientAddress .toString () : "<IP address withheld>" ;
274274 geyser .getLogger ().debug (GeyserLocale .getLocaleStringLog ("geyser.network.pinged" , ip ));
275275 }
276276
0 commit comments