From 78a580bc40125c7c2e35a1f0237b635a442f85ec Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 8 Sep 2012 21:10:26 +0100 Subject: Log to console the effects of /sudo --- Essentials/src/com/earth2me/essentials/ISettings.java | 2 -- .../com/earth2me/essentials/commands/Commandsudo.java | 18 ++++++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java index e1781cb46..434de7ba6 100644 --- a/Essentials/src/com/earth2me/essentials/ISettings.java +++ b/Essentials/src/com/earth2me/essentials/ISettings.java @@ -110,8 +110,6 @@ public interface ISettings extends IConf boolean showNonEssCommandsInHelp(); - boolean spawnIfNoHome(); - boolean warnOnBuildDisallow(); boolean warnOnSmite(); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java b/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java index a9d2bdf3e..1d974121b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java @@ -2,6 +2,8 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.User; +import java.util.logging.Level; +import java.util.logging.Logger; import org.bukkit.Server; import org.bukkit.command.CommandSender; import org.bukkit.command.PluginCommand; @@ -13,6 +15,7 @@ public class Commandsudo extends EssentialsCommand { super("sudo"); } + private static final Logger LOGGER = Logger.getLogger("Minecraft"); @Override public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception @@ -40,8 +43,19 @@ public class Commandsudo extends EssentialsCommand final PluginCommand execCommand = ess.getServer().getPluginCommand(command); if (execCommand != null) { - execCommand.execute(user.getBase(), command, arguments); + ess.scheduleSyncDelayedTask( + new Runnable() + { + @Override + public void run() + { + LOGGER.log(Level.INFO, String.format("[Sudo] %s issued server command: /%s %s", user.getName(), command, getFinalArg(arguments, 0))); + execCommand.execute(user.getBase(), command, arguments); + } + }); + } + else { + sender.sendMessage(_("errorCallingCommand", command)); } - } } -- cgit v1.2.3