diff --git a/code/_globalvars/misc.dm b/code/_globalvars/misc.dm index 3a65da81382..9c6fa81c1a2 100644 --- a/code/_globalvars/misc.dm +++ b/code/_globalvars/misc.dm @@ -92,6 +92,7 @@ GLOBAL_VAR(map_name) // Self explanatory GLOBAL_DATUM_INIT(data_core, /datum/datacore, new) // Station datacore, manifest, etc GLOBAL_VAR_INIT(panic_bunker_enabled, FALSE) // Is the panic bunker enabled +GLOBAL_VAR_INIT(pending_server_update, FALSE) //Database connections //A connection is established on world creation. Ideally, the connection dies when the server restarts (After feedback logging.). diff --git a/code/game/world.dm b/code/game/world.dm index fbdcf12f9fc..d2828f9c04b 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -222,8 +222,12 @@ GLOBAL_VAR_INIT(world_topic_spam_protect_time, world.timeofday) if(input["key"] != config.comms_password) return "Bad Key" else + var/prtext = input["announce"] + var/pr_substring = copytext(prtext, 1, 23) + if(pr_substring == "Pull Request merged by") + GLOB.pending_server_update = TRUE for(var/client/C in GLOB.clients) - to_chat(C, "PR: [input["announce"]]") + to_chat(C, "PR: [prtext]") else if("kick" in input) /* @@ -270,7 +274,7 @@ GLOBAL_VAR_INIT(world_topic_spam_protect_time, world.timeofday) else if("hostannounce" in input) if(!key_valid) return keySpamProtect(addr) - + GLOB.pending_server_update = TRUE to_chat(world, "
Server Announcement: [input["message"]]
") /proc/keySpamProtect(var/addr) @@ -339,8 +343,12 @@ GLOBAL_VAR_INIT(world_topic_spam_protect_time, world.timeofday) return #endif + var/secs_before_auto_reconnect = 10 + if(GLOB.pending_server_update) + secs_before_auto_reconnect = 60 + to_chat(world, "Reboot will take a little longer, due to pending updates.") for(var/client/C in GLOB.clients) - var/secs_before_auto_reconnect = 10 // TODO: make it higher if server is due for an update @AffectedArc07 + C << output(list2params(list(secs_before_auto_reconnect)), "browseroutput:reboot") if(config.server) //if you set a server location in config.txt, it sends you there instead of trying to reconnect to the same world address. -- NeoFite C << link("byond://[config.server]")