Log to console the effects of /sudo

This commit is contained in:
KHobbits 2012-09-08 21:10:26 +01:00
parent 8c4d6ad4df
commit 78a580bc40
2 changed files with 16 additions and 4 deletions

View File

@ -110,8 +110,6 @@ public interface ISettings extends IConf
boolean showNonEssCommandsInHelp(); boolean showNonEssCommandsInHelp();
boolean spawnIfNoHome();
boolean warnOnBuildDisallow(); boolean warnOnBuildDisallow();
boolean warnOnSmite(); boolean warnOnSmite();

View File

@ -2,6 +2,8 @@ package com.earth2me.essentials.commands;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.command.PluginCommand; import org.bukkit.command.PluginCommand;
@ -13,6 +15,7 @@ public class Commandsudo extends EssentialsCommand
{ {
super("sudo"); super("sudo");
} }
private static final Logger LOGGER = Logger.getLogger("Minecraft");
@Override @Override
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception 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); final PluginCommand execCommand = ess.getServer().getPluginCommand(command);
if (execCommand != null) 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));
} }
} }
} }