Refactored caching of drop rates. Whittling away at MBServerStatics.

This commit is contained in:
2023-02-19 08:25:58 -05:00
parent 3fd2f519eb
commit 70ca0a1df3
7 changed files with 55 additions and 43 deletions
-20
View File
@@ -406,26 +406,6 @@ public class MBServerStatics {
public static int SPATIAL_HASH_BUCKETSY = 12288;
public static float MAX_PLAYER_X_LOC = 129999;
public static float MAX_PLAYER_Y_LOC = -97000;
public static String NO_DELETE_COMBAT = "Can't delete items when in Combat with another player.";
/*
* Rates
*/
public static float EXP_RATE_MOD = 2f; // Probably don't want to declare
// as final.
public static float GOLD_RATE_MOD = 1.0f; // Probably don't want to declare
// as final.
public static float DROP_RATE_MOD = 1.0f; // Probably don't want to declare
// as final.
// Hotzones
public static float HOT_EXP_RATE_MOD = 2.0f; // Probably don't want to
// declare as final.
public static float HOT_GOLD_RATE_MOD = 1.5f; // Probably don't want to
// declare as final.
public static float HOT_DROP_RATE_MOD = 1.8f; // Probably don't want to
// declare as final.
/*
* Ranges
+4 -8
View File
@@ -483,14 +483,10 @@ public class WorldServer {
Logger.info("Running garbage collection...");
System.gc();
//set rates from config file
Logger.info("Setting rates based on conf file...");
MBServerStatics.EXP_RATE_MOD = Float.parseFloat(ConfigManager.MB_NORMAL_RATE.getValue());
MBServerStatics.GOLD_RATE_MOD = Float.parseFloat(ConfigManager.MB_NORMAL_RATE.getValue());
MBServerStatics.DROP_RATE_MOD = Float.parseFloat(ConfigManager.MB_NORMAL_RATE.getValue());
MBServerStatics.HOT_EXP_RATE_MOD = Float.parseFloat(ConfigManager.MB_HOTZONE_RATE.getValue());
MBServerStatics.HOT_GOLD_RATE_MOD = Float.parseFloat(ConfigManager.MB_HOTZONE_RATE.getValue());
MBServerStatics.HOT_DROP_RATE_MOD = Float.parseFloat(ConfigManager.MB_HOTZONE_RATE.getValue());
//set drop rates from config file
Logger.info("Setting drop rates...");
Enum.DropRateType.init();
return true;
}