Server awareness of pending updates

This commit is contained in:
Kyep
2020-09-15 14:26:06 -07:00
parent de66f1d72e
commit f1326c753a
2 changed files with 11 additions and 3 deletions
+1
View File
@@ -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.).
+10 -3
View File
@@ -222,8 +222,11 @@ GLOBAL_VAR_INIT(world_topic_spam_protect_time, world.timeofday)
if(input["key"] != config.comms_password)
return "Bad Key"
else
var/prtext = input["announce"]
if(findtext(prtext, "Pull request merged by") != 0)
GLOB.pending_server_update = TRUE
for(var/client/C in GLOB.clients)
to_chat(C, "<span class='announce'>PR: [input["announce"]]</span>")
to_chat(C, "<span class='announce'>PR: [prtext]</span>")
else if("kick" in input)
/*
@@ -270,7 +273,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, "<hr><span style='color: #12A5F4'><b>Server Announcement:</b> [input["message"]]</span><hr>")
/proc/keySpamProtect(var/addr)
@@ -339,8 +342,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, "<span class='boldannounce'>Reboot will take a little longer, due to pending updates.</span>")
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]")