summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-09-08 21:10:26 +0100
committerKHobbits <rob@khobbits.co.uk>2012-09-08 21:10:26 +0100
commit78a580bc40125c7c2e35a1f0237b635a442f85ec (patch)
tree328d35d81029ebeb0b14cfa5307cb7a97bd3bd03
parent8c4d6ad4dfebce04f019059f18e1f4281b6502b0 (diff)
downloadEssentials-78a580bc40125c7c2e35a1f0237b635a442f85ec.tar
Essentials-78a580bc40125c7c2e35a1f0237b635a442f85ec.tar.gz
Essentials-78a580bc40125c7c2e35a1f0237b635a442f85ec.tar.lz
Essentials-78a580bc40125c7c2e35a1f0237b635a442f85ec.tar.xz
Essentials-78a580bc40125c7c2e35a1f0237b635a442f85ec.zip
Log to console the effects of /sudo
-rw-r--r--Essentials/src/com/earth2me/essentials/ISettings.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandsudo.java18
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));
}
-
}
}