Adds configurable round stats link (#17692)

This commit is contained in:
AffectedArc07
2022-05-03 04:30:19 +01:00
committed by GitHub
parent 7bc1bee63a
commit a048ec2e1f
3 changed files with 11 additions and 0 deletions
@@ -28,6 +28,8 @@
var/forum_playerinfo_url
/// URL for the CentCom Ban DB API
var/centcom_ban_db_url
/// URL for the stats page
var/round_stats_url
/datum/configuration_section/url_configuration/load_data(list/data)
// Use the load wrappers here. That way the default isnt made 'null' if you comment out the config line
@@ -45,3 +47,4 @@
CONFIG_LOAD_STR(forum_link_url, data["forum_link_url"])
CONFIG_LOAD_STR(forum_playerinfo_url, data["forum_playerinfo_url"])
CONFIG_LOAD_STR(centcom_ban_db_url, data["centcomm_ban_db_url"])
CONFIG_LOAD_STR(round_stats_url, data["round_stats_url"])
+6
View File
@@ -141,12 +141,18 @@ GLOBAL_LIST_EMPTY(world_topic_handlers)
return
#endif
// Send the stats URL if applicable
if(GLOB.configuration.url.round_stats_url && GLOB.round_id)
var/stats_link = "[GLOB.configuration.url.round_stats_url][GLOB.round_id]"
to_chat(world, "<span class='notice'>Stats for this round can be viewed at <a href=\"[stats_link]\">[stats_link]</a></span>")
// If the server has been gracefully shutdown in TGS, have a 60 seconds grace period for SQL updates and stuff
var/secs_before_auto_reconnect = 10
if(GLOB.slower_restart)
secs_before_auto_reconnect = 60
server_announce_global("Reboot will take a little longer due to pending backend changes.")
// Send the reboot banner to all players
for(var/client/C in GLOB.clients)
C << output(list2params(list(secs_before_auto_reconnect)), "browseroutput:reboot")