diff --git a/server/src/main/java/org/phantazm/server/command/server/OrderlyShutdownCommand.java b/server/src/main/java/org/phantazm/server/command/server/OrderlyShutdownCommand.java index e82c911ec..3d188d160 100644 --- a/server/src/main/java/org/phantazm/server/command/server/OrderlyShutdownCommand.java +++ b/server/src/main/java/org/phantazm/server/command/server/OrderlyShutdownCommand.java @@ -41,6 +41,14 @@ public OrderlyShutdownCommand(@NotNull RouterStore routerStore, @NotNull Shutdow return; } + globalNode.addListener(SceneShutdownEvent.class, this::onSceneShutdown); + globalNode.addListener(AsyncPlayerPreLoginEvent.class, event -> { + event.getPlayer().kick(Component.text("Server is not joinable", NamedTextColor.RED)); + }); + globalNode.addListener(PlayerJoinLobbyEvent.class, event -> { + event.getPlayer().kick(Component.text("Routing to fresh instance...", NamedTextColor.RED)); + }); + initialized = true; shutdownStart = System.currentTimeMillis(); @@ -79,14 +87,6 @@ public OrderlyShutdownCommand(@NotNull RouterStore routerStore, @NotNull Shutdow } }, TaskSchedule.immediate(), TaskSchedule.tick(20)); - globalNode.addListener(SceneShutdownEvent.class, this::onSceneShutdown); - globalNode.addListener(AsyncPlayerPreLoginEvent.class, event -> { - event.getPlayer().kick(Component.text("Server is not joinable", NamedTextColor.RED)); - }); - globalNode.addListener(PlayerJoinLobbyEvent.class, event -> { - event.getPlayer().kick(Component.text("Routing to fresh instance...", NamedTextColor.RED)); - }); - if (noGamesActive()) { System.exit(0); }