From 1e0108ad9d7bb97b40f8ac8907f551360a6b0d62 Mon Sep 17 00:00:00 2001 From: ceikry Date: Wed, 21 Jul 2021 20:18:29 -0500 Subject: [PATCH] added shutdown command and improved error logging for shutdown sequence --- Server/src/main/java/core/game/system/SystemTermination.java | 4 ++-- .../kotlin/rs09/game/system/command/sets/SystemCommandSet.kt | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Server/src/main/java/core/game/system/SystemTermination.java b/Server/src/main/java/core/game/system/SystemTermination.java index 012d2f99d..b973e136f 100644 --- a/Server/src/main/java/core/game/system/SystemTermination.java +++ b/Server/src/main/java/core/game/system/SystemTermination.java @@ -78,8 +78,8 @@ public final class SystemTermination { } }); } - } catch (Throwable t) { - t.printStackTrace(); + } catch (Exception e) { + e.printStackTrace(); } } // ServerStore.dump(directory + "store/"); diff --git a/Server/src/main/kotlin/rs09/game/system/command/sets/SystemCommandSet.kt b/Server/src/main/kotlin/rs09/game/system/command/sets/SystemCommandSet.kt index e6f82a794..dce8d145c 100644 --- a/Server/src/main/kotlin/rs09/game/system/command/sets/SystemCommandSet.kt +++ b/Server/src/main/kotlin/rs09/game/system/command/sets/SystemCommandSet.kt @@ -233,5 +233,9 @@ class SystemCommandSet : CommandSet(Command.Privilege.ADMIN) { player.inventory.add(Item(Items.ROTTEN_POTATO_5733)) } + define("shutdown",Command.Privilege.ADMIN) { player, _ -> + SystemManager.flag(SystemState.TERMINATED) + } + } } \ No newline at end of file