3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-26 16:12:46 +01:00

Add option to not log player IP addresses

Resolves #3246
Dieser Commit ist enthalten in:
Camotoy 2022-08-25 16:10:43 -04:00
Ursprung 6ec1ba39c6
Commit 29fcce7ec8
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F
5 geänderte Dateien mit 13 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -105,6 +105,8 @@ public interface GeyserConfiguration {
int getCustomSkullRenderDistance();
boolean isLogPlayerIpAddresses();
boolean isNotifyOnNewBedrockUpdate();
IMetricsInfo getMetrics();

Datei anzeigen

@ -148,6 +148,9 @@ public abstract class GeyserJacksonConfiguration implements GeyserConfiguration
@JsonProperty("xbox-achievements-enabled")
private boolean xboxAchievementsEnabled = false;
@JsonProperty("log-player-ip-addresses")
private boolean logPlayerIpAddresses = true;
@JsonProperty("notify-on-new-bedrock-update")
private boolean notifyOnNewBedrockUpdate = true;

Datei anzeigen

@ -84,14 +84,16 @@ public class ConnectorServerEventHandler implements BedrockServerEventHandler {
}
}
geyser.getLogger().info(GeyserLocale.getLocaleStringLog("geyser.network.attempt_connect", inetSocketAddress));
String ip = geyser.getConfig().isLogPlayerIpAddresses() ? inetSocketAddress.toString() : "<IP address withheld>";
geyser.getLogger().info(GeyserLocale.getLocaleStringLog("geyser.network.attempt_connect", ip));
return true;
}
@Override
public BedrockPong onQuery(InetSocketAddress inetSocketAddress) {
if (geyser.getConfig().isDebugMode() && PRINT_DEBUG_PINGS) {
geyser.getLogger().debug(GeyserLocale.getLocaleStringLog("geyser.network.pinged", inetSocketAddress));
String ip = geyser.getConfig().isLogPlayerIpAddresses() ? inetSocketAddress.toString() : "<IP address withheld>";
geyser.getLogger().debug(GeyserLocale.getLocaleStringLog("geyser.network.pinged", ip));
}
GeyserConfiguration config = geyser.getConfig();

Datei anzeigen

@ -135,7 +135,6 @@ import org.geysermc.geyser.util.MathUtils;
import javax.annotation.Nonnull;
import java.net.ConnectException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.nio.charset.StandardCharsets;
import java.time.Instant;
@ -1045,7 +1044,7 @@ public class GeyserSession implements GeyserConnection, CommandSender {
} else {
// Downstream's disconnect will fire an event that prints a log message
// Otherwise, we print a message here
InetAddress address = upstream.getAddress().getAddress();
String address = geyser.getConfig().isLogPlayerIpAddresses() ? upstream.getAddress().getAddress().toString() : "<IP address withheld>";
geyser.getLogger().info(GeyserLocale.getLocaleStringLog("geyser.network.disconnect", address, reason));
}
if (!upstream.isClosed()) {

Datei anzeigen

@ -175,6 +175,9 @@ force-resource-packs: true
# THIS DISABLES ALL COMMANDS FROM SUCCESSFULLY RUNNING FOR BEDROCK IN-GAME, as otherwise Bedrock thinks you are cheating.
xbox-achievements-enabled: false
# Whether player IP addresses will be logged by the server.
log-player-ip-addresses: true
# Whether to alert the console and operators that a new Geyser version is available that supports a Bedrock version
# that this Geyser version does not support. It's recommended to keep this option enabled, as many Bedrock platforms
# auto-update.