From 226a37b2ca3a8d01ae2243150a1da36d00d0e6b0 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Mon, 5 Jun 2017 11:52:20 -0400 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 725c9f82c09..ed9c43fb50a 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()