diff --git a/proxima/code/modules/TGSIntegration/TGSIntegrationStaff/TGSChatHooks.dm b/proxima/code/modules/TGSIntegration/TGSIntegrationStaff/TGSChatHooks.dm index f50d38c32e0bd..5456caaad8ddf 100644 --- a/proxima/code/modules/TGSIntegration/TGSIntegrationStaff/TGSChatHooks.dm +++ b/proxima/code/modules/TGSIntegration/TGSIntegrationStaff/TGSChatHooks.dm @@ -152,3 +152,27 @@ return TRUE send2chat(new /datum/tgs_message_content("**[admin_rank == null ? null : admin_rank][ckey]:** *[replacetext_char(replacetext_char(message, "'", "'"), " "", "\"")]*"), "ooc-chat") return TRUE + + + +// Max online notifier +var/max_client = 0 +var/timer = null + +/client/New() + . = ..() + max_client = max(max_client, GLOB.clients.len) + +/hook/roundstart/proc/round_status_notifier() + send2chat(new /datum/tgs_message_content("**Раунд начался!**\nКоличество экипажа: [GLOB.clients.len].[max_client != GLOB.clients.len ? " А ведь их было [max_client]!":""]"), "launch-alert") + timer = addtimer(CALLBACK(GLOBAL_PROC, .proc/gen_report), 25 MINUTES, TIMER_UNIQUE | TIMER_STOPPABLE | TIMER_LOOP) + return TRUE + +/proc/gen_report() + max_client = max(max_client, GLOB.clients.len) + send2chat(new /datum/tgs_message_content("**Отчет по раунду.**\n__Продолжительность:__ *[roundduration2text()]*\n__Онлайн:__ *[GLOB.clients.len]*\n__Пиковый онлайн:__ *[max_client]*"), "launch-alert") + +/hook/roundend/proc/round_status_notifier() + deltimer(timer) + timer = null + return TRUE diff --git a/proxima/code/modules/TGSIntegration/_TGSExternalConfiguration.dm b/proxima/code/modules/TGSIntegration/_TGSExternalConfiguration.dm index 7558d59d4b487..3a5d53b6cb038 100644 --- a/proxima/code/modules/TGSIntegration/_TGSExternalConfiguration.dm +++ b/proxima/code/modules/TGSIntegration/_TGSExternalConfiguration.dm @@ -21,7 +21,7 @@ #define TGS_WRITE_GLOBAL(Name, Value) global._tgs_##Name = ##Value /// Disallow ANYONE from reflecting a given `path`, security measure to prevent in-game use of DD -> TGS capabilities. -#define TGS_PROTECT_DATUM(Path) +#define TGS_PROTECT_DATUM(Path) // Nope. But close GLOBAL_PROTECT(Path) /// Display an announcement `message` from the server to all players. #define TGS_WORLD_ANNOUNCE(message) to_world(html_encode(message))