Add checks.debug flag for fast activation of all checks debug features.

This commit is contained in:
asofold 2013-03-04 01:13:40 +01:00
parent a22b259cc4
commit 1d1e428d05
2 changed files with 11 additions and 8 deletions

View File

@ -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);
}

View File

@ -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";
}