Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-16 21:10:30 +01:00
Ursprung
b5dcaa2315
Commit
94e8b0df43
@ -73,6 +73,7 @@ public class VelocityConfiguration implements ProxyConfig {
|
|||||||
@Expose private final Advanced advanced;
|
@Expose private final Advanced advanced;
|
||||||
@Expose private final Query query;
|
@Expose private final Query query;
|
||||||
private final Metrics metrics;
|
private final Metrics metrics;
|
||||||
|
@Expose private boolean enablePlayerAddressLogging = true;
|
||||||
private net.kyori.adventure.text.@MonotonicNonNull Component motdAsComponent;
|
private net.kyori.adventure.text.@MonotonicNonNull Component motdAsComponent;
|
||||||
private @Nullable Favicon favicon;
|
private @Nullable Favicon favicon;
|
||||||
|
|
||||||
@ -88,8 +89,9 @@ public class VelocityConfiguration implements ProxyConfig {
|
|||||||
private VelocityConfiguration(String bind, String motd, int showMaxPlayers, boolean onlineMode,
|
private VelocityConfiguration(String bind, String motd, int showMaxPlayers, boolean onlineMode,
|
||||||
boolean preventClientProxyConnections, boolean announceForge,
|
boolean preventClientProxyConnections, boolean announceForge,
|
||||||
PlayerInfoForwarding playerInfoForwardingMode, byte[] forwardingSecret,
|
PlayerInfoForwarding playerInfoForwardingMode, byte[] forwardingSecret,
|
||||||
boolean onlineModeKickExistingPlayers, PingPassthroughMode pingPassthrough, Servers servers,
|
boolean onlineModeKickExistingPlayers, PingPassthroughMode pingPassthrough,
|
||||||
ForcedHosts forcedHosts, Advanced advanced, Query query, Metrics metrics) {
|
boolean enablePlayerAddressLogging, Servers servers,ForcedHosts forcedHosts,
|
||||||
|
Advanced advanced, Query query, Metrics metrics) {
|
||||||
this.bind = bind;
|
this.bind = bind;
|
||||||
this.motd = motd;
|
this.motd = motd;
|
||||||
this.showMaxPlayers = showMaxPlayers;
|
this.showMaxPlayers = showMaxPlayers;
|
||||||
@ -100,6 +102,7 @@ public class VelocityConfiguration implements ProxyConfig {
|
|||||||
this.forwardingSecret = forwardingSecret;
|
this.forwardingSecret = forwardingSecret;
|
||||||
this.onlineModeKickExistingPlayers = onlineModeKickExistingPlayers;
|
this.onlineModeKickExistingPlayers = onlineModeKickExistingPlayers;
|
||||||
this.pingPassthrough = pingPassthrough;
|
this.pingPassthrough = pingPassthrough;
|
||||||
|
this.enablePlayerAddressLogging = enablePlayerAddressLogging;
|
||||||
this.servers = servers;
|
this.servers = servers;
|
||||||
this.forcedHosts = forcedHosts;
|
this.forcedHosts = forcedHosts;
|
||||||
this.advanced = advanced;
|
this.advanced = advanced;
|
||||||
@ -351,6 +354,10 @@ public class VelocityConfiguration implements ProxyConfig {
|
|||||||
return pingPassthrough;
|
return pingPassthrough;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isPlayerAddressLoggingEnabled() {
|
||||||
|
return enablePlayerAddressLogging;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isBungeePluginChannelEnabled() {
|
public boolean isBungeePluginChannelEnabled() {
|
||||||
return advanced.isBungeePluginMessageChannel();
|
return advanced.isBungeePluginMessageChannel();
|
||||||
}
|
}
|
||||||
@ -386,6 +393,7 @@ public class VelocityConfiguration implements ProxyConfig {
|
|||||||
.add("advanced", advanced)
|
.add("advanced", advanced)
|
||||||
.add("query", query)
|
.add("query", query)
|
||||||
.add("favicon", favicon)
|
.add("favicon", favicon)
|
||||||
|
.add("enablePlayerAddressLogging", enablePlayerAddressLogging)
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -459,6 +467,7 @@ public class VelocityConfiguration implements ProxyConfig {
|
|||||||
Boolean preventClientProxyConnections = config.getOrElse("prevent-client-proxy-connections",
|
Boolean preventClientProxyConnections = config.getOrElse("prevent-client-proxy-connections",
|
||||||
true);
|
true);
|
||||||
Boolean kickExisting = config.getOrElse("kick-existing-players", false);
|
Boolean kickExisting = config.getOrElse("kick-existing-players", false);
|
||||||
|
Boolean enablePlayerAddressLogging = config.getOrElse("enable-player-address-logging", true);
|
||||||
|
|
||||||
return new VelocityConfiguration(
|
return new VelocityConfiguration(
|
||||||
bind,
|
bind,
|
||||||
@ -471,6 +480,7 @@ public class VelocityConfiguration implements ProxyConfig {
|
|||||||
forwardingSecret,
|
forwardingSecret,
|
||||||
kickExisting,
|
kickExisting,
|
||||||
pingPassthroughMode,
|
pingPassthroughMode,
|
||||||
|
enablePlayerAddressLogging,
|
||||||
new Servers(serversConfig),
|
new Servers(serversConfig),
|
||||||
new ForcedHosts(forcedHostsConfig),
|
new ForcedHosts(forcedHostsConfig),
|
||||||
new Advanced(advancedConfig),
|
new Advanced(advancedConfig),
|
||||||
|
@ -830,7 +830,9 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "[connected player] " + profile.getName() + " (" + getRemoteAddress() + ")";
|
boolean isPlayerAddressLoggingEnabled = server.getConfiguration().isPlayerAddressLoggingEnabled();
|
||||||
|
String playerIp = isPlayerAddressLoggingEnabled ? getRemoteAddress().toString() : "<ip address withheld>";
|
||||||
|
return "[connected player] " + profile.getName() + " (" + playerIp + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -62,6 +62,9 @@ kick-existing-players = false
|
|||||||
# configuration is used if no servers could be contacted.
|
# configuration is used if no servers could be contacted.
|
||||||
ping-passthrough = "DISABLED"
|
ping-passthrough = "DISABLED"
|
||||||
|
|
||||||
|
# If not enabled (default is true) player IP addresses will be replaced by <ip address withheld> in logs
|
||||||
|
enable-player-address-logging = true
|
||||||
|
|
||||||
[servers]
|
[servers]
|
||||||
# Configure your servers here. Each key represents the server's name, and the value
|
# Configure your servers here. Each key represents the server's name, and the value
|
||||||
# represents the IP address of the server to connect to.
|
# represents the IP address of the server to connect to.
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren