Browse Source

Drop rates are set by ConfigManager

master
MagicBot 2 years ago
parent
commit
d9125566f7
  1. 13
      src/engine/gameManager/ConfigManager.java
  2. 4
      src/engine/server/world/WorldServer.java

13
src/engine/gameManager/ConfigManager.java

@ -96,16 +96,12 @@ public enum ConfigManager { @@ -96,16 +96,12 @@ public enum ConfigManager {
public static LoginServer loginServer;
public static Map<ConfigManager, Pattern> regex = new HashMap<>();
//drop rates pulled form config file
public float amountOfStuffYouGetInHotzones;
// Called at bootstrap: ensures that all config values are loaded.
public static boolean init() {
Logger.info("ConfigManager: init()");
Logger.info("Loading config from environment...");
for (ConfigManager configSetting : ConfigManager.values())
if (configMap.containsKey(configSetting.name()))
@ -117,8 +113,15 @@ public enum ConfigManager { @@ -117,8 +113,15 @@ public enum ConfigManager {
return false;
}
// Setting drop rates
Logger.info("Setting drop rates...");
Enum.DropRateType.init();
// compile regex here
Logger.info("Compiling regex");
regex.put(MB_LOGIN_FNAME_REGEX, Pattern.compile(MB_LOGIN_FNAME_REGEX.getValue()));
return true;
}

4
src/engine/server/world/WorldServer.java

@ -483,10 +483,6 @@ public class WorldServer { @@ -483,10 +483,6 @@ public class WorldServer {
Logger.info("Running garbage collection...");
System.gc();
//set drop rates from config file
Logger.info("Setting drop rates...");
Enum.DropRateType.init();
return true;
}

Loading…
Cancel
Save