From 60f759e67489bd92b4ee3f1c2a0305cac10a3fba Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Tue, 6 Jun 2017 13:26:07 -0500 Subject: [PATCH] Graceful shutdown now asks the server to kill it --- code/modules/server_tools/server_tools.dm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/code/modules/server_tools/server_tools.dm b/code/modules/server_tools/server_tools.dm index 0594ee810f..b9af612cc7 100644 --- a/code/modules/server_tools/server_tools.dm +++ b/code/modules/server_tools/server_tools.dm @@ -10,18 +10,20 @@ GLOBAL_PROTECT(reboot_mode) /world/proc/IRCBroadcast(msg) ExportService("[SERVICE_REQUEST_IRC_BROADCAST] [msg]") +/world/proc/ServiceEndProcess() + log_world("Sending shutdown request!"); + sleep(1) //flush the buffers + ExportService(SERVICE_REQUEST_KILL_PROCESS) + //called at the exact moment the world is supposed to reboot /world/proc/ServiceReboot() switch(GLOB.reboot_mode) if(REBOOT_MODE_HARD) to_chat(src, "Hard reboot triggered, you will automatically reconnect...") - log_world("Sending shutdown request!"); - sleep(1) //flush the buffers - ExportService(SERVICE_REQUEST_KILL_PROCESS) + ServiceEndProcess() if(REBOOT_MODE_SHUTDOWN) to_chat(src, "The server is shutting down...") - log_world("Deleting world") - qdel(src) + ServiceEndProcess() /world/proc/ServiceCommand(list/params) var/sCK = RunningService()