5454import org .geysermc .geyser .network .GameProtocol ;
5555import org .geysermc .geyser .network .GeyserServerInitializer ;
5656import org .geysermc .geyser .network .netty .handler .RakConnectionRequestHandler ;
57- import org .geysermc .geyser .network .netty .handler .RakGeyserRateLimiter ;
5857import org .geysermc .geyser .network .netty .handler .RakPingHandler ;
59- import org .geysermc .geyser .network .netty .proxy .ProxyServerHandler ;
6058import org .geysermc .geyser .ping .GeyserPingInfo ;
6159import org .geysermc .geyser .ping .IGeyserPingPassthrough ;
6260import org .geysermc .geyser .skin .SkinProvider ;
@@ -107,8 +105,6 @@ public final class GeyserServer {
107105 private final ServerBootstrap bootstrap ;
108106 private EventLoopGroup playerGroup ;
109107
110- @ Getter
111- private final ExpiringMap <InetSocketAddress , InetSocketAddress > proxiedAddresses ;
112108 private int listenCount ;
113109
114110 private ChannelFuture [] bootstrapFutures ;
@@ -136,14 +132,6 @@ public GeyserServer(GeyserImpl geyser, int threadCount) {
136132 this .listenCount = 1 ;
137133 }
138134
139- if (this .geyser .config ().advanced ().bedrock ().useHaproxyProtocol () || this .geyser .config ().advanced ().bedrock ().useWaterdogpeForwarding ()) {
140- this .proxiedAddresses = ExpiringMap .builder ()
141- .expiration (30 + 1 , TimeUnit .MINUTES )
142- .expirationPolicy (ExpirationPolicy .ACCESSED ).build ();
143- } else {
144- this .proxiedAddresses = null ;
145- }
146-
147135 this .broadcastPort = geyser .config ().advanced ().bedrock ().broadcastPort ();
148136 }
149137
@@ -174,16 +162,12 @@ private void modifyHandlers(ChannelFuture future) {
174162 // Add proxy handler
175163 boolean isProxyProtocol = this .geyser .config ().advanced ().bedrock ().useHaproxyProtocol ();
176164 if (isProxyProtocol ) {
177- channel . pipeline (). addFirst ( "proxy-protocol-decoder" , new ProxyServerHandler ());
165+ // TODO
178166 }
179167
180- boolean isWhitelistedProxyProtocol = isProxyProtocol && !this .geyser .config ().advanced ().bedrock ().haproxyProtocolWhitelistedIps ().isEmpty ();
181- if (Boolean .parseBoolean (System .getProperty ("Geyser.RakRateLimitingDisabled" , "false" )) || isWhitelistedProxyProtocol ) {
168+ if (Boolean .parseBoolean (System .getProperty ("Geyser.RakRateLimitingDisabled" , "false" ))) {
182169 // We would already block any non-whitelisted IP addresses in onConnectionRequest so we can remove the rate limiter
183170 channel .pipeline ().remove (RakServerRateLimiter .NAME );
184- } else {
185- // Use our own rate limiter to allow multiple players from the same IP
186- channel .pipeline ().replace (RakServerRateLimiter .NAME , RakGeyserRateLimiter .NAME , new RakGeyserRateLimiter (channel ));
187171 }
188172 });
189173 }
@@ -268,20 +252,11 @@ public boolean onConnectionRequest(InetSocketAddress inetSocketAddress) {
268252 }
269253 }
270254
271- String ip ;
272- if (geyser .config ().logPlayerIpAddresses ()) {
273- if (this .proxiedAddresses != null ) {
274- ip = this .proxiedAddresses .getOrDefault (inetSocketAddress , inetSocketAddress ).toString ();
275- } else {
276- ip = inetSocketAddress .toString ();
277- }
278- } else {
279- ip = "<IP address withheld>" ;
280- }
255+ String ip = geyser .config ().logPlayerIpAddresses () ? inetSocketAddress .toString () : "<IP address withheld>" ;
281256
282257 ConnectionRequestEvent requestEvent = new ConnectionRequestEvent (
283- inetSocketAddress ,
284- this . proxiedAddresses != null ? this . proxiedAddresses . get ( inetSocketAddress ) : null
258+ inetSocketAddress ,
259+ null
285260 );
286261 geyser .eventBus ().fire (requestEvent );
287262 if (requestEvent .isCancelled ()) {
@@ -297,16 +272,7 @@ public boolean onConnectionRequest(InetSocketAddress inetSocketAddress) {
297272
298273 public BedrockPong onQuery (Channel channel , InetSocketAddress inetSocketAddress ) {
299274 if (geyser .config ().debugMode () && PRINT_DEBUG_PINGS ) {
300- String ip ;
301- if (geyser .config ().logPlayerIpAddresses ()) {
302- if (this .proxiedAddresses != null ) {
303- ip = this .proxiedAddresses .getOrDefault (inetSocketAddress , inetSocketAddress ).toString ();
304- } else {
305- ip = inetSocketAddress .toString ();
306- }
307- } else {
308- ip = "<IP address withheld>" ;
309- }
275+ String ip = geyser .config ().logPlayerIpAddresses () ? inetSocketAddress .toString () : "<IP address withheld>" ;
310276 geyser .getLogger ().debug (GeyserLocale .getLocaleStringLog ("geyser.network.pinged" , ip ));
311277 }
312278
0 commit comments