Added console auditing

master
Joey Hines 2018-09-27 14:50:08 -05:00
parent d2c573d21c
commit c6981f7838
2 changed files with 14 additions and 0 deletions

View File

@ -19,6 +19,7 @@ import java.util.logging.Logger;
@MavenLibrary(group = "net.ess3", artifact = "Essentials", version = "2.13.1", repository = "http://repo.ess3.net/content/groups/essentials")
@MavenLibrary(group = "us.dynmap", artifact = "dynmap-api", version = "1.9.4", repository = "http://repo.mikeprimm.com/")
@MavenLibrary(group = "commons-lang", artifact = "commons-lang", version = "2.6")
public class QoL extends MavenPlugin {
private static QoL instance;

View File

@ -9,6 +9,7 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.server.ServerCommandEvent;
import xyz.etztech.core.CoreUtils;
import xyz.etztech.core.web.CoreWeb;
import xyz.etztech.qol.QoL;
@ -30,6 +31,18 @@ public class CommandPreprocessListener implements Listener {
this.plugin = plugin;
}
@EventHandler
public void onServerCommandEvent(ServerCommandEvent event) {
if (plugin.getConfig().getBoolean("audit.enabled")) {
String command = event.getCommand();
if (commandIsAuditable(command)) {
sendAuditWebhook("Console", null, command);
return;
}
}
}
@EventHandler
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {