mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-03 08:39:04 +00:00
Second World Setup (#518)
* Start Setting Up Second World Added World Number To Login Message Added World Number To Login Interface Made World 2 Listen On Different Port Made Client Connect To 43597 For World 2 * Small Cleanup For World 2 Support Calculate Port For World Based On World Number Use Existing World int For World In Server * Woops Wrong Ports * Set Server Port After Loading Config * Add xpRate Var & Include With XPRate Calculations * Add -w/-world arg to client * Add XP Rate Multiplier For Non-Bot Worlds * More Multi World Stuff Update Integrations(Discord Bot/Website Stuff) For Multiple Worlds Added More XP Rate Dialogue Stuff * Add Kick Command To Discord Bot & Fix Type In ConfigLoader * Create/Use commandPrefix Var For Discord Bot * Small Fixup For World 2 Renamed BOT_WORLD to VARIABLE_XP_RATE Fixed Dialogue/Message grammar Added a check for VARIABLE_XP_RATES to ::xprate command * More Discord Commands(GameKick, MoveHome & Update) *GameKick kicks A player if their client froze but acc stayed logged in *MoveHome removes the need for ::stuck which removes potential for abuse *Update schedules A server update * Minor fixup * 43597 → 43598 * Fix XP Rate Multiplier & add ::xprate to cooamnds list if enabled * Use Either VARIABLE_SKILL_RATE OR XP_RATE Not Both TODO(Convert Player.xpRate Into An Array For Easier Rate Changes) * Create/Use PLAYER_XP_RATES For Easier Rate Changes * Fixed Abusive Client Command Privileges & Added myxprate/checkxprate * Allow Loading VARIABLE_XP_RATES & PLAYER_XP_RATES From Config * Properly Update Client Title Logo If The Cache Has Already Been Downloaded You Will Need To Delete It & Let The Client ReDownload It * Fix Cache CRC Checks For The Client(Allows Cache To Actually Check For Updates) * Add -no-crc & -dev Arguments To Client * Fix Naming For Some Vars * Make CHECK_CRC Description More Descriptive * Fix More Var Descriptions * Cleanup Unused GameConstants Vars & Add More Vars To ConfigLoader Co-authored-by: Danial <admin@redsparr0w.com>
This commit is contained in:
@@ -3,6 +3,7 @@ package com.rs2;
|
||||
import com.rs2.integrations.PlayersOnlineWebsite;
|
||||
import com.rs2.integrations.RegisteredAccsWebsite;
|
||||
import com.rs2.integrations.discord.JavaCord;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.*;
|
||||
@@ -17,6 +18,8 @@ public class ConfigLoader {
|
||||
|
||||
if(obj.has("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"))
|
||||
GameConstants.WEBSITE_LINK = obj.getString("website_link");
|
||||
if(obj.has("debug"))
|
||||
@@ -49,10 +52,20 @@ public class ConfigLoader {
|
||||
GameConstants.TIMEOUT = obj.getInt("timeout");
|
||||
if(obj.has("item_requirements"))
|
||||
GameConstants.ITEM_REQUIREMENTS = obj.getBoolean("item_requirements");
|
||||
if(obj.has("variable_xp_rate"))
|
||||
GameConstants.VARIABLE_XP_RATE = obj.getBoolean("variable_xp_rate");
|
||||
if(obj.has("xp_rate"))
|
||||
GameConstants.XP_RATE = obj.getDouble("xp_rate");
|
||||
if(obj.has("max_players"))
|
||||
GameConstants.MAX_PLAYERS = obj.getInt("max_players");
|
||||
if (obj.has("variable_xp_rates")) {
|
||||
JSONArray rates = obj.optJSONArray("variable_xp_rates");
|
||||
for (int i = 0; i < rates.length(); ++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() {
|
||||
@@ -71,7 +84,7 @@ public class ConfigLoader {
|
||||
}
|
||||
|
||||
public static void loadSecrets() throws IOException {
|
||||
if (!new File("data/Secrets.json").exists()) {
|
||||
if (!new File("data/secrets.json").exists()) {
|
||||
initialize();
|
||||
System.out.println("Please open \"data/secrets.json\" file and enter your discord token bot there!");
|
||||
System.out.println("Please open \"data/secrets.json\" file and enter your Website Password there!");
|
||||
@@ -88,7 +101,7 @@ public class ConfigLoader {
|
||||
JavaCord.token = obj.getString("bot-token");
|
||||
if(obj.has("websitepass"))
|
||||
PlayersOnlineWebsite.password = obj.getString("websitepass");
|
||||
RegisteredAccsWebsite.password = obj.getString("websitepass");
|
||||
RegisteredAccsWebsite.password = obj.getString("websitepass");
|
||||
if(obj.has("erssecret"))
|
||||
GameEngine.ersSecret = obj.getString("erssecret");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user