13
0
geforkt von Mirrors/Velocity

Hide ip address in initial and legacy connections (#1025)

Dieser Commit ist enthalten in:
Pancake 2024-01-04 14:50:47 +01:00 committet von GitHub
Ursprung 00ef92bc5c
Commit de57563eab
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
2 geänderte Dateien mit 12 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -236,7 +236,12 @@ public class HandshakeSessionHandler implements MinecraftSessionHandler {
@Override
public String toString() {
return "[legacy connection] " + this.getRemoteAddress().toString();
boolean isPlayerAddressLoggingEnabled = connection.server.getConfiguration()
.isPlayerAddressLoggingEnabled();
String playerIp =
isPlayerAddressLoggingEnabled
? this.getRemoteAddress().toString() : "<ip address withheld>";
return "[legacy connection] " + playerIp;
}
@Override

Datei anzeigen

@ -75,7 +75,12 @@ public final class InitialInboundConnection implements VelocityInboundConnection
@Override
public String toString() {
return "[initial connection] " + connection.getRemoteAddress().toString();
boolean isPlayerAddressLoggingEnabled = connection.server.getConfiguration()
.isPlayerAddressLoggingEnabled();
String playerIp =
isPlayerAddressLoggingEnabled
? connection.getRemoteAddress().toString() : "<ip address withheld>";
return "[initial connection] " + playerIp;
}
@Override