LogAction: no longer check the config file for flags.

The optimized actions will have done that beforehand.
This commit is contained in:
asofold 2012-11-09 14:46:56 +01:00
parent 9f4896b47c
commit 4120ca9bd7

View File

@ -7,7 +7,6 @@ import fr.neatmonster.nocheatplus.actions.Action;
import fr.neatmonster.nocheatplus.checks.ViolationData; import fr.neatmonster.nocheatplus.checks.ViolationData;
import fr.neatmonster.nocheatplus.config.ConfPaths; import fr.neatmonster.nocheatplus.config.ConfPaths;
import fr.neatmonster.nocheatplus.config.ConfigFile; import fr.neatmonster.nocheatplus.config.ConfigFile;
import fr.neatmonster.nocheatplus.config.ConfigManager;
import fr.neatmonster.nocheatplus.utilities.CheckUtils; import fr.neatmonster.nocheatplus.utilities.CheckUtils;
import fr.neatmonster.nocheatplus.utilities.LogUtil; import fr.neatmonster.nocheatplus.utilities.LogUtil;
@ -71,14 +70,11 @@ public class LogAction extends ActionWithParameters {
*/ */
@Override @Override
public boolean execute(final ViolationData violationData) { public boolean execute(final ViolationData violationData) {
final ConfigFile configurationFile = ConfigManager.getConfigFile(); if (!violationData.player.hasPermission(violationData.getPermissionSilent())) {
if (configurationFile.getBoolean(ConfPaths.LOGGING_ACTIVE) && !violationData.player.hasPermission(violationData.getPermissionSilent())) {
final String message = super.getMessage(violationData); final String message = super.getMessage(violationData);
if (toChat && configurationFile.getBoolean(ConfPaths.LOGGING_INGAMECHAT)) { if (toChat) NoCheatPlus.sendAdminNotifyMessage(ChatColor.RED + "NCP: " + ChatColor.WHITE + CheckUtils.replaceColors(message));
NoCheatPlus.sendAdminNotifyMessage(ChatColor.RED + "NCP: " + ChatColor.WHITE + CheckUtils.replaceColors(message)); if (toConsole) LogUtil.logInfo("[NoCheatPlus] " + CheckUtils.removeColors(message));
} if (toFile) CheckUtils.fileLogger.info(CheckUtils.removeColors(message));
if (toConsole && configurationFile.getBoolean(ConfPaths.LOGGING_CONSOLE)) LogUtil.logInfo("[NoCheatPlus] " + CheckUtils.removeColors(message));
if (toFile && configurationFile.getBoolean(ConfPaths.LOGGING_FILE)) CheckUtils.fileLogger.info(CheckUtils.removeColors(message));
} }
return false; return false;
} }