From 3d1a7ecff0ce40d09054ef34058c88073c9dc020 Mon Sep 17 00:00:00 2001 From: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com> Date: Mon, 27 Mar 2023 00:36:07 -0400 Subject: [PATCH] [MISSED MIRROR] Adds a config-optional endgame chat message (#72860) [MDB IGNORE] (#20108) Adds a config-optional endgame chat message (#72860) This basically does what we do for roundstart announcements, but for round end. With a delay between a round ending, the server rebooting, and a new round starting, sometimes it feels like players would be more likely to catch a roundstart when they know the previous game has just ended, and not a few moments before the next one starts. This idea was suggested to me several times by many people who don't have good connections to servers and keep missing roundstart because they just aren't given enough time to get on SS13. I also included Round ID in this, so people who know what time they've played a round can also now easily see which round it was, if they wanted to go back to look at the logs for any reason they have. :cl: config: There's now a config-optional announcer for a round ending. /:cl: --------- Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com> --- code/__HELPERS/roundend.dm | 4 ++-- code/controllers/configuration/entries/general.dm | 2 +- code/controllers/subsystem/ticker.dm | 6 ++++-- code/modules/discord/tgs_commands.dm | 2 +- config/config.txt | 9 ++++++--- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/code/__HELPERS/roundend.dm b/code/__HELPERS/roundend.dm index 19ca071cf49..2fdf57b05dc 100644 --- a/code/__HELPERS/roundend.dm +++ b/code/__HELPERS/roundend.dm @@ -248,8 +248,8 @@ if(length(CONFIG_GET(keyed_list/cross_server))) send_news_report() */ - send2chat("The current round has ended. Please standby for your shift interlude Nanotrasen News Network's report!", CONFIG_GET(string/chat_announce_new_game)) - send2chat(send_news_report(), CONFIG_GET(string/chat_announce_new_game)) + send2chat("The current round has ended. Please standby for your shift interlude Nanotrasen News Network's report!", CONFIG_GET(string/channel_announce_end_game)) + send2chat(send_news_report(), CONFIG_GET(string/channel_announce_end_game)) //SKYRAT EDIT - END CHECK_TICK diff --git a/code/controllers/configuration/entries/general.dm b/code/controllers/configuration/entries/general.dm index edc990756b6..b875753e03b 100644 --- a/code/controllers/configuration/entries/general.dm +++ b/code/controllers/configuration/entries/general.dm @@ -522,7 +522,7 @@ integer = FALSE /datum/config_entry/flag/irc_announce_new_game - deprecated_by = /datum/config_entry/string/chat_announce_new_game + deprecated_by = /datum/config_entry/string/channel_announce_new_game /datum/config_entry/flag/irc_announce_new_game/DeprecationUpdate(value) return "" //default broadcast diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index dc94b509552..64f89d10b48 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -159,10 +159,12 @@ SUBSYSTEM_DEF(ticker) for(var/client/C in GLOB.clients) window_flash(C, ignorepref = TRUE) //let them know lobby has opened up. to_chat(world, span_notice("Welcome to [station_name()]!")) - // SKYRAT EDIT START - DISCORD SPAM PREVENTION + /* ORIGINAL: + send2chat("New round starting on [SSmapping.config.map_name]!", CONFIG_GET(string/channel_announce_new_game)) + */ // SKYRAT EDIT START - DISCORD SPAM PREVENTION if(!discord_alerted) discord_alerted = TRUE - send2chat("<@&[CONFIG_GET(string/game_alert_role_id)]> Round **[GLOB.round_id]** starting on [SSmapping.config.map_name], [CONFIG_GET(string/servername)]! \nIf you wish to be pinged for game related stuff, go to <#[CONFIG_GET(string/role_assign_channel_id)]> and assign yourself the roles.", CONFIG_GET(string/chat_announce_new_game)) // SKYRAT EDIT - Role ping and round ID in game-alert + send2chat("<@&[CONFIG_GET(string/game_alert_role_id)]> Round **[GLOB.round_id]** starting on [SSmapping.config.map_name], [CONFIG_GET(string/servername)]! \nIf you wish to be pinged for game related stuff, go to <#[CONFIG_GET(string/role_assign_channel_id)]> and assign yourself the roles.", CONFIG_GET(string/channel_announce_new_game)) // SKYRAT EDIT - Role ping and round ID in game-alert // SKYRAT EDIT END current_state = GAME_STATE_PREGAME SStitle.change_title_screen() //SKYRAT EDIT ADDITION - Title screen diff --git a/code/modules/discord/tgs_commands.dm b/code/modules/discord/tgs_commands.dm index 51fffacb86d..b1b57a8f430 100644 --- a/code/modules/discord/tgs_commands.dm +++ b/code/modules/discord/tgs_commands.dm @@ -38,7 +38,7 @@ help_text = "Pings the invoker when the round ends" /datum/tgs_chat_command/notify/Run(datum/tgs_chat_user/sender, params) - if(!CONFIG_GET(string/chat_announce_new_game)) + if(!CONFIG_GET(string/channel_announce_new_game)) return "Notifcations are currently disabled" for(var/member in SSdiscord.notify_members) // If they are in the list, take them out diff --git a/config/config.txt b/config/config.txt index 5c000541708..7e77a3809ce 100644 --- a/config/config.txt +++ b/config/config.txt @@ -500,10 +500,13 @@ MINUTE_CLICK_LIMIT 400 ## Various messages to be sent to connected chat channels. ## Uncommenting these will enable them, by default they will be broadcast to Game chat channels on TGS3 or non-admin channels on TGS4. ## If using TGS4, the string option can be set as one of more chat channel tags (separated by ','s) to limit the message to channels with that tag name (case-sensitive). This will have no effect on TGS3. -## i.e. CHAT_ANNOUNCE_NEW_GAME chat_channel_tag +## i.e. CHANNEL_ANNOUNCE_NEW_GAME chat_channel_tag -## Send a message with the station name starting a new game. -#CHAT_ANNOUNCE_NEW_GAME +## Which channel will have a message about a new game starting, message includes the station name. +#CHANNEL_ANNOUNCE_NEW_GAME + +## Which channel will have a message about a new game starting, message includes the round ID of the game that has just ended. +#CHANNEL_ANNOUNCE_END_GAME ## Ping users who use the `notify` command when a new game starts. #CHAT_NEW_GAME_NOTIFICATIONS