mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-02 04:56:50 +01:00
Ensure we always log commands and log the right thing.
Waiting to log until after PlayerCommandPreprocessEvent makes the server not log anything if the event is cancelled. It also makes the server log what a plugin changed the command to instead of what the player actually tried to run. As the point of the log is to have a record of every command a player attempts to run these are both not desirable.
This commit is contained in:
parent
fa1b6ba834
commit
89d5265da6
1 changed files with 2 additions and 1 deletions
|
@ -941,6 +941,8 @@ public class PlayerConnection implements PacketPlayInListener {
|
||||||
|
|
||||||
private void handleCommand(String s) {
|
private void handleCommand(String s) {
|
||||||
// CraftBukkit start - whole method
|
// CraftBukkit start - whole method
|
||||||
|
this.c.info(this.player.getName() + " issued server command: " + s);
|
||||||
|
|
||||||
CraftPlayer player = this.getPlayer();
|
CraftPlayer player = this.getPlayer();
|
||||||
|
|
||||||
PlayerCommandPreprocessEvent event = new PlayerCommandPreprocessEvent(player, s, new LazyPlayerSet());
|
PlayerCommandPreprocessEvent event = new PlayerCommandPreprocessEvent(player, s, new LazyPlayerSet());
|
||||||
|
@ -951,7 +953,6 @@ public class PlayerConnection implements PacketPlayInListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.c.info(event.getPlayer().getName() + " issued server command: " + event.getMessage());
|
|
||||||
if (this.server.dispatchCommand(event.getPlayer(), event.getMessage().substring(1))) {
|
if (this.server.dispatchCommand(event.getPlayer(), event.getMessage().substring(1))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue