Addition of OlympiadEnabled configuration.

This commit is contained in:
MobiusDevelopment
2022-09-25 12:04:21 +00:00
parent cf32747997
commit 629cfae635
189 changed files with 1184 additions and 376 deletions

View File

@@ -554,6 +554,7 @@ public class Config
public static int WORLD_CHAT_MIN_LEVEL;
public static int WORLD_CHAT_POINTS_PER_DAY;
public static Duration WORLD_CHAT_INTERVAL;
public static boolean OLYMPIAD_ENABLED;
public static int ALT_OLY_START_TIME;
public static int ALT_OLY_MIN;
public static long ALT_OLY_CPERIOD;
@@ -2351,6 +2352,7 @@ public class Config
// Load Olympiad config file (if exists)
final PropertiesParser olympiadConfig = new PropertiesParser(OLYMPIAD_CONFIG_FILE);
OLYMPIAD_ENABLED = olympiadConfig.getBoolean("OlympiadEnabled", true);
ALT_OLY_START_TIME = olympiadConfig.getInt("AltOlyStartTime", 20);
ALT_OLY_MIN = olympiadConfig.getInt("AltOlyMin", 0);
ALT_OLY_CPERIOD = olympiadConfig.getLong("AltOlyCPeriod", 14400000);

View File

@@ -95,7 +95,10 @@ public class Hero
protected Hero()
{
init();
if (Config.OLYMPIAD_ENABLED)
{
init();
}
}
private void init()

View File

@@ -132,12 +132,19 @@ public class Olympiad extends ListenersContainer
protected Olympiad()
{
load();
AntiFeedManager.getInstance().registerEvent(AntiFeedManager.OLYMPIAD_ID);
if (_period == 0)
if (Config.OLYMPIAD_ENABLED)
{
init();
load();
AntiFeedManager.getInstance().registerEvent(AntiFeedManager.OLYMPIAD_ID);
if (_period == 0)
{
init();
}
}
else
{
LOGGER.log(Level.INFO, "Disabled.");
}
}