Added autoClearLogDelay

This commit is contained in:
DiddiZ
2012-01-09 01:23:44 +01:00
parent a8ad370894
commit e79b6f4262
2 changed files with 5 additions and 2 deletions

View File

@@ -31,6 +31,7 @@ public class Config extends LoggingEnabledMapping
public final boolean useBukkitScheduler;
public final boolean enableAutoClearLog;
public final List<String> autoClearLog;
public final int autoClearLogDelay;
public final boolean dumpDeletedLog;
public final boolean logCreeperExplosionsAsPlayerWhoTriggeredThese, logPlayerInfo;
public final LogKillsLevel logKillsLevel;
@@ -74,6 +75,7 @@ public class Config extends LoggingEnabledMapping
def.put("clearlog.dumpDeletedLog", false);
def.put("clearlog.enableAutoClearLog", false);
def.put("clearlog.auto", Arrays.asList("world \"world\" before 365 days all", "world \"world\" player lavaflow waterflow leavesdecay before 7 days all", "world world_nether before 365 days all", "world world_nether player lavaflow before 7 days all"));
def.put("clearlog.clearlog.autoClearLogDelay", "1h");
def.put("logging.logCreeperExplosionsAsPlayerWhoTriggeredThese", false);
def.put("logging.logKillsLevel", "PLAYERS");
def.put("logging.logPlayerInfo", true);
@@ -127,6 +129,7 @@ public class Config extends LoggingEnabledMapping
enableAutoClearLog = config.getBoolean("clearlog.enableAutoClearLog");
autoClearLog = config.getStringList("clearlog.auto");
dumpDeletedLog = config.getBoolean("clearlog.dumpDeletedLog", false);
autoClearLogDelay = parseTimeSpec(config.getString("clearlog.autoClearLogDelay").split(" "));
logCreeperExplosionsAsPlayerWhoTriggeredThese = config.getBoolean("logging.logCreeperExplosionsAsPlayerWhoTriggeredThese", false);
logPlayerInfo = config.getBoolean("logging.logPlayerInfo", true);
try {

View File

@@ -113,8 +113,8 @@ public class LogBlock extends JavaPlugin
getLogger().info("[LogBlock] Permissions plugin found.");
} else
getLogger().info("[LogBlock] Permissions plugin not found. Using Bukkit Permissions.");
if (config.enableAutoClearLog)
getServer().getScheduler().scheduleAsyncDelayedTask(this, new AutoClearLog(this));
if (config.enableAutoClearLog && config.autoClearLogDelay > 0)
getServer().getScheduler().scheduleAsyncRepeatingTask(this, new AutoClearLog(this), config.autoClearLogDelay * 20, config.autoClearLogDelay * 20);
getServer().getScheduler().scheduleAsyncDelayedTask(this, new DumpedLogImporter(this));
final Listener lbBlockListener = new LBBlockListener(this);
final Listener lbPlayerListener = new LBPlayerListener(this);