From a048ec2e1f049d597b4f58dd482c7d65084ebfa1 Mon Sep 17 00:00:00 2001 From: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> Date: Tue, 3 May 2022 04:30:19 +0100 Subject: [PATCH] Adds configurable round stats link (#17692) --- .../controllers/configuration/sections/url_configuration.dm | 3 +++ code/game/world.dm | 6 ++++++ config/example/config.toml | 2 ++ 3 files changed, 11 insertions(+) diff --git a/code/controllers/configuration/sections/url_configuration.dm b/code/controllers/configuration/sections/url_configuration.dm index cfdf06a7b51..1ec1c55b659 100644 --- a/code/controllers/configuration/sections/url_configuration.dm +++ b/code/controllers/configuration/sections/url_configuration.dm @@ -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"]) diff --git a/code/game/world.dm b/code/game/world.dm index 689a9a4174a..92eb19cb007 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -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, "Stats for this round can be viewed at [stats_link]") + // 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") diff --git a/config/example/config.toml b/config/example/config.toml index 40f66069758..ebb5ebe12cf 100644 --- a/config/example/config.toml +++ b/config/example/config.toml @@ -781,6 +781,8 @@ donations_url = "https://www.patreon.com/ParadiseStation" ban_appeals_url = "https://www.paradisestation.org/forum/55-unban-requests/" # URL for the CentComm ban DB. Doesnt change much. Ckey is slapped on the end centcomm_ban_db_url = "https://centcom.melonmesa.com/ban/search/" +# URL for the game stats page, if applicable. Round ID is appended right on the end. Include a trailing slash if necessary. +#round_stats_url = "https://affectedarc07.github.io/ParaStats/#/round/" ################################################################