From 1d1e428d0572394a89df8efb76f1957ba087c194 Mon Sep 17 00:00:00 2001 From: asofold Date: Mon, 4 Mar 2013 01:13:40 +0100 Subject: [PATCH] Add checks.debug flag for fast activation of all checks debug features. --- .../nocheatplus/checks/access/ACheckConfig.java | 4 +++- .../neatmonster/nocheatplus/config/ConfPaths.java | 15 ++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/access/ACheckConfig.java b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/access/ACheckConfig.java index 7b5ac4f9..2d4f461c 100644 --- a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/access/ACheckConfig.java +++ b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/access/ACheckConfig.java @@ -23,7 +23,9 @@ public abstract class ACheckConfig implements ICheckConfig { * @param pathPrefix Path prefix for the check section (example for use: prefix+"debug"). */ public ACheckConfig(final ConfigFile config, final String pathPrefix){ - debug = config.getBoolean(pathPrefix + ConfPaths.SUB_DEBUG, false); + // TODO: Path prefix construction is somewhat inconsistent with debug hierarchy ? + debug = config.getBoolean(pathPrefix + ConfPaths.SUB_DEBUG, config.getBoolean(ConfPaths.CHECKS_DEBUG, false)); + // TODO: Use lag flag where appropriate and document it (or get rid of it). lag = config.getBoolean(pathPrefix + ConfPaths.SUB_LAG, true) && config.getBoolean(ConfPaths.MISCELLANEOUS_LAG, true); } diff --git a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/config/ConfPaths.java b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/config/ConfPaths.java index 3a5a176d..2c327def 100644 --- a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/config/ConfPaths.java +++ b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/config/ConfPaths.java @@ -14,6 +14,12 @@ package fr.neatmonster.nocheatplus.config; */ public abstract class ConfPaths { + // Sub-paths that are used with different path prefixes potentially. + public static final String SUB_DEBUG = "debug"; + public static final String SUB_IGNOREPASSABLE = RootConfPaths.SUB_IGNOREPASSABLE; + public static final String SUB_ALLOWINSTANTBREAK = RootConfPaths.SUB_ALLOWINSTANTBREAK; + public static final String SUB_LAG = "lag"; + // General: public static final String SAVEBACKCONFIG = "savebackconfig"; @@ -72,7 +78,8 @@ public abstract class ConfPaths { public static final String DATA_CONSISTENCYCHECKS_MAXTIME = DATA_CONSISTENCYCHECKS + "maxtime"; private static final String CHECKS = "checks."; - + /** Debug flag to debug all checks (!), individual sections debug flags override this, if present. */ + public static final String CHECKS_DEBUG = CHECKS + SUB_DEBUG; /* * 888 88b, 888 888 888 88b, 888 * 888 88P' 888 e88 88e e88'888 888 ee 888 88P' 888,8, ,e e, ,"Y88b 888 ee @@ -562,10 +569,4 @@ public abstract class ConfPaths { public static final String COMPATIBILITY_BUKKITONLY = COMPATIBILITY + "bukkitapionly"; public static final String COMPATIBILITY_BLOCKS = COMPATIBILITY + "blocks."; - // Sub-paths that are used with different path prefixes potentially. - public static final String SUB_DEBUG = "debug"; - public static final String SUB_IGNOREPASSABLE = RootConfPaths.SUB_IGNOREPASSABLE; - public static final String SUB_ALLOWINSTANTBREAK = RootConfPaths.SUB_ALLOWINSTANTBREAK; - public static final String SUB_LAG = "lag"; - }