added command logging

This commit is contained in:
Boos 2012-03-21 00:30:28 +01:00
parent 6a02ee55ec
commit 74d65f309a
4 changed files with 27 additions and 9 deletions

View File

@ -43,6 +43,7 @@ public class boosConfigManager {
conf.addDefault("options.options.cancel_warmup_on_sprint",
false);
conf.addDefault("options.options.clear_on_restart", false);
conf.addDefault("options.options.command_logging", false);
conf.addDefault("options.units.seconds", "seconds");
conf.addDefault("options.units.minutes", "minutes");
conf.addDefault("options.units.hours", "hours");
@ -333,6 +334,11 @@ public class boosConfigManager {
"options.options.cancel_warmup_on_sneak", false);
}
public static boolean getCommandLogging() {
return conf.getBoolean(
"options.options.command_logging", false);
}
public static boolean getBlocked2(Player player, String pre) {
boolean blocked = false;
pre = pre.toLowerCase();

View File

@ -106,6 +106,11 @@ public class boosCoolDown extends JavaPlugin {
return usingPermissions;
}
public static void commandLogger(String player, String command) {
log.info("[" + "boosLogger" + "] " + player + " used command "
+ command);
}
private boolean setupEconomy() {
if (usingVault) {
RegisteredServiceProvider<Economy> economyProvider = getServer()

View File

@ -34,7 +34,6 @@ public class boosCoolDownListener implements Listener {
String message = event.getMessage();
Player player = event.getPlayer();
boolean on = true;
on = isPluginOnForPlayer(player);
if (on) {
@ -61,9 +60,11 @@ public class boosCoolDownListener implements Listener {
preSub = preCommand + ' ' + preSub;
preSubCheck = preSubCheck(player, preSub);
if (preCDCheck(player, preSub) > 0) {
preSubCheck = 0;}
preSubCheck = 0;
}
if (prePriceCheck(player, preSub) > 0) {
preSubCheck = 0;}
preSubCheck = 0;
}
if (preSubCheck >= 0) {
blocked = blocked(player, preSub);
this.checkCooldown(event, player, preSub, messageSub);
@ -283,6 +284,9 @@ public class boosCoolDownListener implements Listener {
.getPrice(player, pre)) {
boosPriceManager
.payForCommand(player, pre, message);
if (boosConfigManager.getCommandLogging()) {
boosCoolDown.commandLogger(player.getName(), message);
}
} else {
boosPriceManager
.payForCommand(player, pre, message);
@ -300,6 +304,9 @@ public class boosCoolDownListener implements Listener {
boosChat.sendMessageToPlayer(player, msg);
return false;
}
if(!event.isCancelled()){
boosCoolDown.commandLogger(player.getName(), pre);
}
return false;
}

View File

@ -1,6 +1,6 @@
name: boosCooldown
main: cz.boosik.boosCooldown.boosCoolDown
version: 2.2.4 beta
version: 2.3.0 beta
author: boosik
softdepend: [Vault,PermissionsEX]
description: >