Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-17 05:20:14 +01:00
Make the logging of commands configurable
Dieser Commit ist enthalten in:
Ursprung
a9df92d308
Commit
da92d83b14
@ -342,6 +342,10 @@ public class VelocityConfiguration implements ProxyConfig {
|
||||
return advanced.isShowPingRequests();
|
||||
}
|
||||
|
||||
public boolean isLogCommandExecutions() {
|
||||
return advanced.isLogCommandExecutions();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return MoreObjects.toStringHelper(this)
|
||||
@ -577,6 +581,7 @@ public class VelocityConfiguration implements ProxyConfig {
|
||||
private boolean tcpFastOpen = false;
|
||||
private boolean bungeePluginMessageChannel = true;
|
||||
private boolean showPingRequests = false;
|
||||
private boolean logCommandExecutions = false;
|
||||
|
||||
private Advanced() {
|
||||
}
|
||||
@ -592,6 +597,7 @@ public class VelocityConfiguration implements ProxyConfig {
|
||||
this.tcpFastOpen = config.getOrElse("tcp-fast-open", false);
|
||||
this.bungeePluginMessageChannel = config.getOrElse("bungee-plugin-message-channel", true);
|
||||
this.showPingRequests = config.getOrElse("show-ping-requests", false);
|
||||
this.logCommandExecutions = config.getOrElse("log-command-executions", false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -631,6 +637,10 @@ public class VelocityConfiguration implements ProxyConfig {
|
||||
return showPingRequests;
|
||||
}
|
||||
|
||||
public boolean isLogCommandExecutions() {
|
||||
return logCommandExecutions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Advanced{"
|
||||
@ -643,6 +653,7 @@ public class VelocityConfiguration implements ProxyConfig {
|
||||
+ ", tcpFastOpen=" + tcpFastOpen
|
||||
+ ", bungeePluginMessageChannel=" + bungeePluginMessageChannel
|
||||
+ ", showPingRequests=" + showPingRequests
|
||||
+ ", logCommandExecutions=" + logCommandExecutions
|
||||
+ '}';
|
||||
}
|
||||
}
|
||||
|
@ -130,7 +130,9 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
|
||||
.thenComposeAsync(event -> processCommandExecuteResult(originalCommand,
|
||||
event.getResult()))
|
||||
.whenCompleteAsync((ignored, throwable) -> {
|
||||
if (server.getConfiguration().isLogCommandExecutions()) {
|
||||
logger.info("{} -> executed command /{}", player.getUsername(), originalCommand);
|
||||
}
|
||||
})
|
||||
.exceptionally(e -> {
|
||||
logger.info("Exception occurred while running command for {}",
|
||||
|
@ -117,6 +117,9 @@ bungee-plugin-message-channel = true
|
||||
# Shows ping requests to the proxy from clients.
|
||||
show-ping-requests = false
|
||||
|
||||
# Enables the logging of commands
|
||||
log-command-executions = false
|
||||
|
||||
[query]
|
||||
# Whether to enable responding to GameSpy 4 query responses or not.
|
||||
enabled = false
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren