Skip to content

Commit

Permalink
change order of event registration
Browse files Browse the repository at this point in the history
  • Loading branch information
Steanky committed Jul 30, 2023
1 parent 2a07d71 commit 9abfe6f
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 9abfe6f

Please sign in to comment.