summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server
diff options
context:
space:
mode:
authorTravis Watkins <amaranth@ubuntu.com>2014-05-14 14:26:21 -0500
committerTravis Watkins <amaranth@ubuntu.com>2014-05-14 14:28:52 -0500
commit89d5265da69195b3af4d3e6c05dbcb616cd9bdd9 (patch)
treefbc2804ff7e149d20988e82e1c095025fdc44d4d /src/main/java/net/minecraft/server
parentfa1b6ba834f6b65f2b84c6f167d5a748027b8308 (diff)
downloadcraftbukkit-89d5265da69195b3af4d3e6c05dbcb616cd9bdd9.tar
craftbukkit-89d5265da69195b3af4d3e6c05dbcb616cd9bdd9.tar.gz
craftbukkit-89d5265da69195b3af4d3e6c05dbcb616cd9bdd9.tar.lz
craftbukkit-89d5265da69195b3af4d3e6c05dbcb616cd9bdd9.tar.xz
craftbukkit-89d5265da69195b3af4d3e6c05dbcb616cd9bdd9.zip
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.
Diffstat (limited to 'src/main/java/net/minecraft/server')
-rw-r--r--src/main/java/net/minecraft/server/PlayerConnection.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 17978101..89ef6faf 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -941,6 +941,8 @@ public class PlayerConnection implements PacketPlayInListener {
private void handleCommand(String s) {
// CraftBukkit start - whole method
+ this.c.info(this.player.getName() + " issued server command: " + s);
+
CraftPlayer player = this.getPlayer();
PlayerCommandPreprocessEvent event = new PlayerCommandPreprocessEvent(player, s, new LazyPlayerSet());
@@ -951,7 +953,6 @@ public class PlayerConnection implements PacketPlayInListener {
}
try {
- this.c.info(event.getPlayer().getName() + " issued server command: " + event.getMessage());
if (this.server.dispatchCommand(event.getPlayer(), event.getMessage().substring(1))) {
return;
}