From 105b74cb5261382c8739890f26f2d4df612ff759 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Fri, 31 Oct 2025 17:47:55 -0400 Subject: [PATCH] Trigger TGS config syncs on manual reboot (#93471) Ops found that manually rebooting the server skips config syncs. Rectify --------- Co-authored-by: Jordan Dominion Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com> --- code/__HELPERS/roundend.dm | 5 ++++- code/modules/admin/verbs/server.dm | 18 +++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/code/__HELPERS/roundend.dm b/code/__HELPERS/roundend.dm index 9f7c95d42ea..dc940f4c0a8 100644 --- a/code/__HELPERS/roundend.dm +++ b/code/__HELPERS/roundend.dm @@ -289,12 +289,15 @@ GLOBAL_LIST_INIT(achievements_unlocked, list()) //stop collecting feedback during grifftime SSblackbox.Seal() - world.TgsTriggerEvent("tg-Roundend", wait_for_completion = TRUE) + TriggerRoundEndTgsEvent() sleep(5 SECONDS) ready_for_reboot = TRUE standard_reboot() +/datum/controller/subsystem/ticker/proc/TriggerRoundEndTgsEvent() + world.TgsTriggerEvent("tg-Roundend", wait_for_completion = TRUE) + /datum/controller/subsystem/ticker/proc/standard_reboot() if(ready_for_reboot) if(GLOB.station_was_nuked) diff --git a/code/modules/admin/verbs/server.dm b/code/modules/admin/verbs/server.dm index 8b724cfe144..0033c6c1269 100644 --- a/code/modules/admin/verbs/server.dm +++ b/code/modules/admin/verbs/server.dm @@ -18,6 +18,7 @@ ADMIN_VERB(toggle_hub, R_SERVER, "Toggle Hub", "Toggles the server's visilibilit #define REGULAR_RESTART "Regular Restart" #define REGULAR_RESTART_DELAYED "Regular Restart (with delay)" +#define NO_EVENT_RESTART "Restart, Skip TGS Event" #define HARD_RESTART "Hard Restart (No Delay/Feedback Reason)" #define HARDEST_RESTART "Hardest Restart (No actions, just reboot)" #define TGS_RESTART "Server Restart (Kill and restart DD)" @@ -29,6 +30,7 @@ ADMIN_VERB(restart, R_SERVER, "Reboot World", "Restarts the world immediately.", options += HARDEST_RESTART if(world.TgsAvailable()) + options.Insert(3, NO_EVENT_RESTART) options += TGS_RESTART; if(SSticker.admin_delay_notice) @@ -42,18 +44,19 @@ ADMIN_VERB(restart, R_SERVER, "Reboot World", "Restarts the world immediately.", BLACKBOX_LOG_ADMIN_VERB("Reboot World") var/init_by = "Initiated by [user.holder.fakekey ? "Admin" : user.key]." switch(result) - if(REGULAR_RESTART) - if(!user.is_localhost()) - if(alert(user, "Are you sure you want to restart the server?","This server is live", "Restart", "Cancel") != "Restart") - return FALSE - SSticker.Reboot(init_by, "admin reboot - by [user.key] [user.holder.fakekey ? "(stealth)" : ""]", 10) - if(REGULAR_RESTART_DELAYED) - var/delay = input("What delay should the restart have (in seconds)?", "Restart Delay", 5) as num|null + if(REGULAR_RESTART, REGULAR_RESTART_DELAYED, NO_EVENT_RESTART) + var/delay = 1 + if(result == REGULAR_RESTART_DELAYED) + delay = input("What delay should the restart have (in seconds)?", "Restart Delay", 5) as num|null if(!delay) return FALSE if(!user.is_localhost()) if(alert(user,"Are you sure you want to restart the server?","This server is live", "Restart", "Cancel") != "Restart") return FALSE + + if (result != NO_EVENT_RESTART) + SSticker.TriggerRoundEndTgsEvent() + SSticker.Reboot(init_by, "admin reboot - by [user.key] [user.holder.fakekey ? "(stealth)" : ""]", delay * 10) if(HARD_RESTART) to_chat(world, "World reboot - [init_by]") @@ -67,6 +70,7 @@ ADMIN_VERB(restart, R_SERVER, "Reboot World", "Restarts the world immediately.", #undef REGULAR_RESTART #undef REGULAR_RESTART_DELAYED +#undef NO_EVENT_RESTART #undef HARD_RESTART #undef HARDEST_RESTART #undef TGS_RESTART