PaperSpigot-Parent/CraftBukkit-Patches/0033-Allow-Disabling-of-Command-Logging.patch

38 lines
1.5 KiB
Diff
Raw Normal View History

From 8123ddb10e530f8f513253a31a957a0c0cc2b545 Mon Sep 17 00:00:00 2001
2014-04-12 06:18:37 +02:00
From: md_5 <md_5@live.com.au>
Date: Fri, 21 Jun 2013 18:01:29 +1000
Subject: [PATCH] Allow Disabling of Command Logging
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 253a448..c581334 100644
2014-04-12 06:18:37 +02:00
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -942,7 +942,7 @@ public class PlayerConnection implements PacketPlayInListener {
private void handleCommand(String s) {
org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.startTiming(); // Spigot
// CraftBukkit start - whole method
- this.c.info(this.player.getName() + " issued server command: " + s);
+ if ( org.spigotmc.SpigotConfig.logCommands ) this.c.info(this.player.getName() + " issued server command: " + s); // Spigot
CraftPlayer player = this.getPlayer();
2014-04-12 06:18:37 +02:00
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
index 98fcb47..afd6b56 100644
--- a/src/main/java/org/spigotmc/SpigotConfig.java
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
@@ -130,4 +130,10 @@ public class SpigotConfig
config.addDefault( path, def );
return config.getString( path, config.getString( path ) );
}
+
+ public static boolean logCommands;
+ private static void logCommands()
+ {
+ logCommands = getBoolean( "commands.log", true );
+ }
}
--
2014-04-19 01:15:23 +02:00
1.9.1
2014-04-12 06:18:37 +02:00