Browse Source

Drop rates are set by ConfigManager

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

19
src/engine/gameManager/ConfigManager.java

@ -96,16 +96,12 @@ public enum ConfigManager {
public static LoginServer loginServer; public static LoginServer loginServer;
public static Map<ConfigManager, Pattern> regex = new HashMap<>(); 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. // Called at bootstrap: ensures that all config values are loaded.
public static boolean init() { public static boolean init() {
Logger.info("ConfigManager: init()"); Logger.info("Loading config from environment...");
for (ConfigManager configSetting : ConfigManager.values()) for (ConfigManager configSetting : ConfigManager.values())
if (configMap.containsKey(configSetting.name())) if (configMap.containsKey(configSetting.name()))
@ -117,10 +113,17 @@ public enum ConfigManager {
return false; return false;
} }
// compile regex here // 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())); regex.put(MB_LOGIN_FNAME_REGEX, Pattern.compile(MB_LOGIN_FNAME_REGEX.getValue()));
return true; return true;
} }
// Get the value associated with this enumeration // Get the value associated with this enumeration

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

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

Loading…
Cancel
Save