diff --git a/Client/src/org/runite/jagex/GameShell.java b/Client/src/org/runite/jagex/GameShell.java index cf75caa1b..5e546f145 100644 --- a/Client/src/org/runite/jagex/GameShell.java +++ b/Client/src/org/runite/jagex/GameShell.java @@ -4,6 +4,7 @@ import org.runite.Configurations; import org.runite.GameLaunch; import org.runite.GameSetting; +import javax.swing.*; import java.applet.Applet; import java.applet.AppletContext; import java.awt.*; @@ -244,7 +245,7 @@ public abstract class GameShell extends Applet implements Runnable, FocusListene if(!this.aBoolean1) { this.aBoolean1 = true; System.out.println("error_game_" + var1); - + JOptionPane.showMessageDialog(frame, "Error: " + var1 + (var1.contains("js5connect") ? ". The game is likely down." : "") + "\nCheck Discord (Red Bracket#8151) or Github (https://github.com/dginovker/RS-2009/releases) for a potential solution."); try { if(var2 != -48) { aClass94_4 = (RSString)null; diff --git a/CompiledServer/production/RS-2009/org/crandor/game/system/SystemTermination.class b/CompiledServer/production/RS-2009/org/crandor/game/system/SystemTermination.class index 3bcb3a7c0..adf1658ca 100644 Binary files a/CompiledServer/production/RS-2009/org/crandor/game/system/SystemTermination.class and b/CompiledServer/production/RS-2009/org/crandor/game/system/SystemTermination.class differ diff --git a/CompiledServer/production/RS-2009/org/crandor/worker/MajorUpdateWorker.class b/CompiledServer/production/RS-2009/org/crandor/worker/MajorUpdateWorker.class index 525ed5436..191d48fde 100644 Binary files a/CompiledServer/production/RS-2009/org/crandor/worker/MajorUpdateWorker.class and b/CompiledServer/production/RS-2009/org/crandor/worker/MajorUpdateWorker.class differ diff --git a/CompiledServer/production/RS-2009/org/keldagrim/Management$1.class b/CompiledServer/production/RS-2009/org/keldagrim/Management$1.class index b553f691d..b9d912d79 100644 Binary files a/CompiledServer/production/RS-2009/org/keldagrim/Management$1.class and b/CompiledServer/production/RS-2009/org/keldagrim/Management$1.class differ diff --git a/CompiledServer/production/RS-2009/org/keldagrim/Management$2.class b/CompiledServer/production/RS-2009/org/keldagrim/Management$2.class index 3ec147661..ea333907a 100644 Binary files a/CompiledServer/production/RS-2009/org/keldagrim/Management$2.class and b/CompiledServer/production/RS-2009/org/keldagrim/Management$2.class differ diff --git a/CompiledServer/production/RS-2009/org/keldagrim/Management$3.class b/CompiledServer/production/RS-2009/org/keldagrim/Management$3.class index 3e6f16cc9..b19668254 100644 Binary files a/CompiledServer/production/RS-2009/org/keldagrim/Management$3.class and b/CompiledServer/production/RS-2009/org/keldagrim/Management$3.class differ diff --git a/CompiledServer/production/RS-2009/org/keldagrim/Management$4.class b/CompiledServer/production/RS-2009/org/keldagrim/Management$4.class index 524b600d8..7e7740266 100644 Binary files a/CompiledServer/production/RS-2009/org/keldagrim/Management$4.class and b/CompiledServer/production/RS-2009/org/keldagrim/Management$4.class differ diff --git a/CompiledServer/production/RS-2009/org/keldagrim/Management$5.class b/CompiledServer/production/RS-2009/org/keldagrim/Management$5.class index 6fd892e3f..2011fb2cc 100644 Binary files a/CompiledServer/production/RS-2009/org/keldagrim/Management$5.class and b/CompiledServer/production/RS-2009/org/keldagrim/Management$5.class differ diff --git a/CompiledServer/production/RS-2009/org/keldagrim/Management$6.class b/CompiledServer/production/RS-2009/org/keldagrim/Management$6.class index 4d8456c0f..3573686a3 100644 Binary files a/CompiledServer/production/RS-2009/org/keldagrim/Management$6.class and b/CompiledServer/production/RS-2009/org/keldagrim/Management$6.class differ diff --git a/CompiledServer/production/RS-2009/org/keldagrim/Management$7.class b/CompiledServer/production/RS-2009/org/keldagrim/Management$7.class index 4a037d6b1..537e5fcfe 100644 Binary files a/CompiledServer/production/RS-2009/org/keldagrim/Management$7.class and b/CompiledServer/production/RS-2009/org/keldagrim/Management$7.class differ diff --git a/CompiledServer/production/RS-2009/org/keldagrim/Management$8.class b/CompiledServer/production/RS-2009/org/keldagrim/Management$8.class index 07acb11d6..ea8679eea 100644 Binary files a/CompiledServer/production/RS-2009/org/keldagrim/Management$8.class and b/CompiledServer/production/RS-2009/org/keldagrim/Management$8.class differ diff --git a/CompiledServer/production/RS-2009/org/keldagrim/Management.class b/CompiledServer/production/RS-2009/org/keldagrim/Management.class index 06374944e..4923b9280 100644 Binary files a/CompiledServer/production/RS-2009/org/keldagrim/Management.class and b/CompiledServer/production/RS-2009/org/keldagrim/Management.class differ diff --git a/CompiledServer/production/RS-2009/org/keldagrim/classloader/ClassLoadServer.class b/CompiledServer/production/RS-2009/org/keldagrim/classloader/ClassLoadServer.class index b069c1f62..7eb16ef7f 100644 Binary files a/CompiledServer/production/RS-2009/org/keldagrim/classloader/ClassLoadServer.class and b/CompiledServer/production/RS-2009/org/keldagrim/classloader/ClassLoadServer.class differ diff --git a/CompiledServer/production/RS-2009/org/keldagrim/net/NioReactor.class b/CompiledServer/production/RS-2009/org/keldagrim/net/NioReactor.class index 83bbbee7c..b15cbae74 100644 Binary files a/CompiledServer/production/RS-2009/org/keldagrim/net/NioReactor.class and b/CompiledServer/production/RS-2009/org/keldagrim/net/NioReactor.class differ diff --git a/CompiledServer/production/RS-2009/org/keldagrim/system/ShutdownSequence.class b/CompiledServer/production/RS-2009/org/keldagrim/system/ShutdownSequence.class index 7af9d4151..59004d32a 100644 Binary files a/CompiledServer/production/RS-2009/org/keldagrim/system/ShutdownSequence.class and b/CompiledServer/production/RS-2009/org/keldagrim/system/ShutdownSequence.class differ diff --git a/CompiledServer/production/RS-2009/org/runite/jagex/GameShell.class b/CompiledServer/production/RS-2009/org/runite/jagex/GameShell.class index 44c3660ab..774327d2c 100644 Binary files a/CompiledServer/production/RS-2009/org/runite/jagex/GameShell.class and b/CompiledServer/production/RS-2009/org/runite/jagex/GameShell.class differ diff --git a/CompiledServer/production/RS-2009/plugin/tutorial/TutorialCompletionDialogue.class b/CompiledServer/production/RS-2009/plugin/tutorial/TutorialCompletionDialogue.class index b61e99d6c..17a216faf 100644 Binary files a/CompiledServer/production/RS-2009/plugin/tutorial/TutorialCompletionDialogue.class and b/CompiledServer/production/RS-2009/plugin/tutorial/TutorialCompletionDialogue.class differ diff --git a/Management-Server/src/org/keldagrim/Management.java b/Management-Server/src/org/keldagrim/Management.java index 477021c84..e82952d0e 100644 --- a/Management-Server/src/org/keldagrim/Management.java +++ b/Management-Server/src/org/keldagrim/Management.java @@ -22,6 +22,11 @@ import java.util.Scanner; */ public final class Management { + /** + * If the shutdown hook is active. + */ + public static boolean active = true; + /** * The commands. */ diff --git a/Management-Server/src/org/keldagrim/classloader/ClassLoadServer.java b/Management-Server/src/org/keldagrim/classloader/ClassLoadServer.java index fee35f9b3..755bff126 100644 --- a/Management-Server/src/org/keldagrim/classloader/ClassLoadServer.java +++ b/Management-Server/src/org/keldagrim/classloader/ClassLoadServer.java @@ -1,5 +1,6 @@ package org.keldagrim.classloader; +import org.keldagrim.Management; import org.keldagrim.ServerConstants; import java.io.File; @@ -52,7 +53,7 @@ public class ClassLoadServer extends Thread { public void run() { resetResourceCache(); // System.out.println("Listening on port " + PORT + "..."); - while (true) { + while (Management.active) { Socket clientSocket = null; try { clientSocket = serverSocket.accept(); diff --git a/Management-Server/src/org/keldagrim/net/NioReactor.java b/Management-Server/src/org/keldagrim/net/NioReactor.java index af91a49d1..83dd74cd7 100644 --- a/Management-Server/src/org/keldagrim/net/NioReactor.java +++ b/Management-Server/src/org/keldagrim/net/NioReactor.java @@ -1,5 +1,7 @@ package org.keldagrim.net; +import org.keldagrim.Management; + import java.io.IOException; import java.net.InetSocketAddress; import java.nio.channels.SelectionKey; @@ -86,7 +88,7 @@ public final class NioReactor implements Runnable { @Override public void run() { - while (running) { + while (running && Management.active) { try { selector.select(); } catch (IOException e) { diff --git a/Management-Server/src/org/keldagrim/system/ShutdownSequence.java b/Management-Server/src/org/keldagrim/system/ShutdownSequence.java index 53270a94f..10a7b3804 100644 --- a/Management-Server/src/org/keldagrim/system/ShutdownSequence.java +++ b/Management-Server/src/org/keldagrim/system/ShutdownSequence.java @@ -1,6 +1,8 @@ package org.keldagrim.system; +import org.keldagrim.Management; + /** * The shutdown sequence used for safely turning off the Management server. * @author Emperor @@ -8,14 +10,9 @@ package org.keldagrim.system; */ public final class ShutdownSequence extends Thread { - /** - * If the shutdown hook is active. - */ - private static boolean active = true; - @Override public void run() { - if (active) { + if (Management.active) { shutdown(); } } @@ -25,7 +22,6 @@ public final class ShutdownSequence extends Thread { */ public static void shutdown() { System.out.println("Management server successfully shut down!"); - active = false; - System.exit(0); + Management.active = false; } } \ No newline at end of file diff --git a/Server/src/org/crandor/game/system/SystemTermination.java b/Server/src/org/crandor/game/system/SystemTermination.java index d5b047f6e..90a5e4ba4 100644 --- a/Server/src/org/crandor/game/system/SystemTermination.java +++ b/Server/src/org/crandor/game/system/SystemTermination.java @@ -52,7 +52,6 @@ public final class SystemTermination { } } SystemLogger.log("[SystemTerminator] Server successfully terminated!"); - System.exit(0); } /** diff --git a/Server/src/org/crandor/worker/MajorUpdateWorker.java b/Server/src/org/crandor/worker/MajorUpdateWorker.java index 557022184..a2cfce7f3 100644 --- a/Server/src/org/crandor/worker/MajorUpdateWorker.java +++ b/Server/src/org/crandor/worker/MajorUpdateWorker.java @@ -79,8 +79,9 @@ public final class MajorUpdateWorker implements Runnable { */ private void sleep() throws InterruptedException { // How many ticks off we are + final int TICK_SPEED = (int) (600 / 1); //Allows you to make server ticks faster than normal StatisticsTab.reportPerformance((int) (System.currentTimeMillis() - start)); - long duration = 600 - ((System.currentTimeMillis() - start) % 600); + long duration = TICK_SPEED - ((System.currentTimeMillis() - start) % TICK_SPEED); if (duration > 0) { Thread.sleep(duration); } else { diff --git a/Server/src/plugin/tutorial/TutorialCompletionDialogue.java b/Server/src/plugin/tutorial/TutorialCompletionDialogue.java index 93571ebf0..4e08b19f0 100644 --- a/Server/src/plugin/tutorial/TutorialCompletionDialogue.java +++ b/Server/src/plugin/tutorial/TutorialCompletionDialogue.java @@ -207,7 +207,7 @@ public class TutorialCompletionDialogue extends DialoguePlugin { stage++; break; case 531: - npc("A standard Ironman does not receieve items or", "assistance from other players. They cannot trade, stake,", "receieve PK loot, scavenge dropped items, nor player", "certain minigames."); + npc("A standard Ironman does not receive items or", "assistance from other players. They cannot trade, stake,", "receieve PK loot, scavenge dropped items, nor player", "certain minigames."); stage++; break; case 532: @@ -216,9 +216,7 @@ public class TutorialCompletionDialogue extends DialoguePlugin { break; case 1200: npc("Keep in mind: our server has more content than any other", "server ever released. There's hundreds of hours of", "exciting and flawless gameplay awaiting you, "+player.getUsername()+".", "Enjoy your time playing "+GameWorld.getName()+"!"); - stage = 520; - break; - case 520: + stage = 7; //HOW DO WE CLOSE THIS DIALOGUE player.removeAttribute("tut-island"); player.getConfigManager().set(1021, 0); player.getProperties().setTeleportLocation(new Location(3233, 3230)); @@ -233,7 +231,6 @@ public class TutorialCompletionDialogue extends DialoguePlugin { player.getBank().add(new Item(121, 15), new Item(115, 15), new Item(133, 15), new Item(373, 50), new Item(2289, 25), new Item(7056, 25)); player.unlock(); TutorialSession.getExtension(player).setStage(TutorialSession.MAX_STAGE + 1); - stage = 7; if (player.getIronmanManager().isIronman() && player.getSettings().isAcceptAid()) { player.getSettings().toggleAcceptAid(); } @@ -248,6 +245,7 @@ public class TutorialCompletionDialogue extends DialoguePlugin { player.removeAttribute("tut-island:hi_slot"); HintIconManager.removeHintIcon(player, slot); HintIconManager.registerHintIcon(player, Repository.findNPC(Location.create(3168, 3481, 0))); + end(); break; case 7: end();