Various Changes (#614)

* Clean Old Log Files

* Various Changes

* Moved minutes.log to log folder
* Made SERVER_LOG_DIR constant
* Moved FILE_SYSTEM_DIR to GameConstants & Deleted org.apollo.jagcached.Constants
* Removed unused minutes.log from data/data
* Removed Duplicate RSAKeyGen
* Moved RSAKeyGen from com.rs2.net.rsa to com.rs2.util.rsa

* Removed data/net.xml & Created Moved NetworkConstants.java

* Add HTTP & Jaggrab Port's to ConfigLoader

* IntelliJ Reformat ConfigLoader.java

* Fix Mistake

* Attempt #2

* Woops, wrong port
This commit is contained in:
Josh Shippam authored and GitHub committed 2023-02-09 01:05:06 +00:00
1 parent 88a9562e03
commit 55ca851d07
201 files changed
+1264 -12570

No files matched your search

@@ -6,7 +6,6 @@ import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.file.Paths;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
@@ -19,12 +18,9 @@ import com.rs2.gui.ControlPanel;
import org.apollo.cache.IndexedFileSystem;
import org.apollo.cache.decoder.ItemDefinitionDecoder;
import org.apollo.cache.decoder.ObjectDefinitionDecoder;
import org.apollo.cache.def.ObjectDefinition;
import org.apollo.jagcached.Constants;
import org.apollo.jagcached.FileServer;
import com.rs2.game.bots.BotHandler;
import com.google.common.base.Stopwatch;
import com.rs2.event.CycleEventHandler;
import com.rs2.game.content.minigames.FightCaves;
import com.rs2.game.content.minigames.FightPits;
@@ -54,6 +50,7 @@ import com.rs2.world.clip.RegionFactory;
import io.netty.util.ResourceLeakDetector;
import io.netty.util.ResourceLeakDetector.Level;
import org.apollo.net.NetworkConstants;
/**
* Server.java
@@ -72,7 +69,7 @@ public class GameEngine {
private static void startMinutesCounter() {
try {
minuteFile = new BufferedReader(new FileReader(
"./data/minutes.log"));
Constants.SERVER_LOG_DIR + "minutes.log"));
minutesCounter = Long.parseLong(minuteFile.readLine());
} catch (Exception e) {
e.printStackTrace();
@@ -83,7 +80,7 @@ public class GameEngine {
private static void setMinutesCounter(long minutesCounter) {
try {
BufferedWriter minuteCounter = new BufferedWriter(new FileWriter(
"./data/minutes.log"));
Constants.SERVER_LOG_DIR + "minutes.log"));
minuteCounter.write(Long.toString(minutesCounter));
minuteCounter.close();
} catch (IOException e) {
@@ -126,9 +123,14 @@ public class GameEngine {
public static void main(java.lang.String[] args)
throws NullPointerException, IOException {
if (NetworkConstants.RSA_EXPONENT != Constants.RSA_EXPONENT) {
NetworkConstants.RSA_EXPONENT = Constants.RSA_EXPONENT;
NetworkConstants.RSA_MODULUS = Constants.RSA_MODULUS;
}
for (int i = 0; i < args.length; i++) {
if (args[i].equals("-gui"))
GameConstants.GUI_ENABLED = true;
Constants.GUI_ENABLED = true;
if (args[i].startsWith("-") && (i + 1) < args.length && !args[i + 1].startsWith("-")) {
switch (args[i]) {
case "-c":
@@ -146,7 +148,7 @@ public class GameEngine {
}
System.out.println("Starting game engine..");
if (GameConstants.SERVER_DEBUG) {
if (Constants.SERVER_DEBUG) {
System.out.println("@@@@ DEBUG MODE IS ENABLED @@@@");
}
@@ -166,7 +168,7 @@ public class GameEngine {
/**
* Starting Up Server
*/
System.out.println("Launching " + GameConstants.SERVER_NAME + " World: " + GameConstants.WORLD + "...");
System.out.println("Launching " + Constants.SERVER_NAME + " World: " + Constants.WORLD + "...");
/**
* Start Integration Services
@@ -218,7 +220,7 @@ public class GameEngine {
/**
* Makes Visible Control Panel If Enabled
*/
if(GameConstants.GUI_ENABLED) {
if(Constants.GUI_ENABLED) {
ControlPanel panel = new ControlPanel();
panel.initComponents();
panel.setVisible(true);
@@ -255,7 +257,7 @@ public class GameEngine {
objectHandler.process();
MageTrainingArena.process();
CycleEventHandler.getSingleton().process();
if (GameConstants.WEBSITE_INTEGRATION) {
if (Constants.WEBSITE_INTEGRATION) {
PlayersOnlineWebsite.addUpdatePlayersOnlineTask();
RegisteredAccsWebsite.addUpdateRegisteredUsersTask();
}
@@ -292,7 +294,7 @@ public class GameEngine {
}
//TODO debug System.out.println("Cycle took " + stopwatch.elapsed(TimeUnit.MILLISECONDS) + " ms.");
}
}, 0, GameConstants.CYCLE_TIME, TimeUnit.MILLISECONDS);
}, 0, Constants.CYCLE_TIME, TimeUnit.MILLISECONDS);
/*
* I'd recommend disabling this until I can be bothered to implement it