Cleanup Unused GameConstants Vars & Add More Vars To ConfigLoader

This commit is contained in:
Dark98
2021-12-14 04:00:49 +00:00
parent d3f5ebc7a2
commit 3aaf413bc7
3 changed files with 12 additions and 19 deletions
+2 -1
View File
@@ -18,5 +18,6 @@
"save_timer": 120, "save_timer": 120,
"timeout": 60, "timeout": 60,
"item_requirements": true, "item_requirements": true,
"max_players": 200 "max_players": 200,
"website_total_characters_integration": false
} }
@@ -18,6 +18,8 @@ public class ConfigLoader {
if(obj.has("server_name")) if(obj.has("server_name"))
GameConstants.SERVER_NAME = obj.getString("server_name"); GameConstants.SERVER_NAME = obj.getString("server_name");
if(obj.has("server_test_version"))
GameConstants.TEST_VERSION = obj.getDouble("server_test_version");
if(obj.has("website_link")) if(obj.has("website_link"))
GameConstants.WEBSITE_LINK = obj.getString("website_link"); GameConstants.WEBSITE_LINK = obj.getString("website_link");
if(obj.has("debug")) if(obj.has("debug"))
@@ -62,6 +64,8 @@ public class ConfigLoader {
GameConstants.VARIABLE_XP_RATES[i] = rates.optInt(i); GameConstants.VARIABLE_XP_RATES[i] = rates.optInt(i);
} }
} }
if(obj.has("website_total_characters_integration"))
GameConstants.WEBSITE_TOTAL_CHARACTERS_INTEGRATION = obj.getBoolean("website_total_characters_integration");
} }
private static void initialize() { private static void initialize() {
@@ -1,7 +1,5 @@
package com.rs2; package com.rs2;
import com.rs2.game.players.Player;
public class GameConstants { public class GameConstants {
/** /**
@@ -34,25 +32,19 @@ public class GameConstants {
RESPAWN_X = 3222, RESPAWN_Y = 3218; RESPAWN_X = 3222, RESPAWN_Y = 3218;
public static boolean FILE_SERVER = true, SERVER_DEBUG = false, MEMBERS_ONLY = false, TUTORIAL_ISLAND = false, public static boolean FILE_SERVER = true, SERVER_DEBUG = false, MEMBERS_ONLY = false, TUTORIAL_ISLAND = false,
PARTY_ROOM_DISABLED = false, CLUES_ENABLED = true, ITEM_REQUIREMENTS = true, PARTY_ROOM_DISABLED = false, CLUES_ENABLED = true, ITEM_REQUIREMENTS = true,
ADMIN_CAN_TRADE = false, ADMIN_DROP_ITEMS = false, ADMIN_CAN_SELL_ITEMS = false, VARIABLE_XP_RATE = false; ADMIN_CAN_TRADE = false, ADMIN_DROP_ITEMS = false, ADMIN_CAN_SELL_ITEMS = false, VARIABLE_XP_RATE = false,
WEBSITE_TOTAL_CHARACTERS_INTEGRATION = false;
public static int[] VARIABLE_XP_RATES = new int[] {1, 2, 5, 10}; public static int[] VARIABLE_XP_RATES = new int[] {1, 2, 5, 10};
public static double XP_RATE = 1.0; public static double TEST_VERSION = 2.3, XP_RATE = 1.0;
/** /**
* The Variables Below Should Only Be Changed If You Understand What You Are Doing * The Variables Below Should Only Be Changed If You Understand What You Are Doing
*/ */
public final static int ITEM_LIMIT = 15000, MAXITEM_AMOUNT = Integer.MAX_VALUE,
public final static String SERVER_VERSION = "Server Stage v " + GameConstants.TEST_VERSION + "."; IPS_ALLOWED = 250, CONNECTION_DELAY = 100;
public final static boolean WEBSITE_TOTAL_CHARACTERS_INTEGRATION = false;
public final static double TEST_VERSION = 2.3;
public final static int ITEM_LIMIT = 15000, MAXITEM_AMOUNT = Integer.MAX_VALUE, CLIENT_VERSION = 999999, public final static boolean sendServerPackets = false, SOUND = true, GUILDS = true;
IPS_ALLOWED = 250, CONNECTION_DELAY = 100,
MESSAGE_DELAY = 6000, REQ_AMOUNT = 150;
public final static boolean sendServerPackets = false, SOUND = true, GUILDS = true,
PRINT_OBJECT_ID = false, EXPERIMENTS = false;
public static int[] SIDEBARS = { 2423, 3917, 638, 3213, 1644, 5608, 1151, public static int[] SIDEBARS = { 2423, 3917, 638, 3213, 1644, 5608, 1151,
18128, 5065, 5715, 2449, 904, 147, 962 }; 18128, 5065, 5715, 2449, 904, 147, 962 };
@@ -68,10 +60,6 @@ public class GameConstants {
public final static int NO_TELEPORT_WILD_LEVEL = 20; public final static int NO_TELEPORT_WILD_LEVEL = 20;
public final static int CASTLE_WARS_X = 2439;
public final static int CASTLE_WARS_Y = 3087;
public final static int NPC_RANDOM_WALK_DISTANCE = 5; public final static int NPC_RANDOM_WALK_DISTANCE = 5;
public final static int NPC_FOLLOW_DISTANCE = 10; public final static int NPC_FOLLOW_DISTANCE = 10;