diff --git a/Content.Server/GameTicking/GameTicker.CVars.cs b/Content.Server/GameTicking/GameTicker.CVars.cs index 191188cb5a..dc2453d156 100644 --- a/Content.Server/GameTicking/GameTicker.CVars.cs +++ b/Content.Server/GameTicking/GameTicker.CVars.cs @@ -1,6 +1,7 @@ using Content.Server.Discord; using Content.Shared.CCVar; using Content.Shared.GameTicking; +using Content.Shared._WL.CCVars; //WL-Change: Send Manifest in Discord namespace Content.Server.GameTicking { @@ -81,14 +82,14 @@ namespace Content.Server.GameTicking }, true); Subs.CVar(_cfg, CCVars.RoundEndSoundCollection, value => RoundEndSoundCollection = value, true); //WL-Change: Send Manifest in Discord Start - Subs.CVar(_cfg, CCVars.DiscordRoundManifestWebhook, value => + Subs.CVar(_cfg, WLCVars.DiscordRoundManifestWebhook, value => { if (!string.IsNullOrWhiteSpace(value)) { _discord.GetWebhook(value, data => _webhookIdentifierManifest = data.ToIdentifier()); } }, true); - Subs.CVar(_cfg, CCVars.DiscordRoundManifestWebhookEmbedColor, value => + Subs.CVar(_cfg, WLCVars.DiscordRoundManifestWebhookEmbedColor, value => { _webhookEmbedColor = Color.DeepSkyBlue; if (Color.TryParse(value, out var color)) diff --git a/Content.Server/GameTicking/GameTicker.RoundFlow.cs b/Content.Server/GameTicking/GameTicker.RoundFlow.cs index c8e474fb8f..401766c708 100644 --- a/Content.Server/GameTicking/GameTicker.RoundFlow.cs +++ b/Content.Server/GameTicking/GameTicker.RoundFlow.cs @@ -711,7 +711,7 @@ namespace Content.Server.GameTicking var payload = new WebhookPayload { Embeds = [embed] }; await _discord.CreateMessage(_webhookIdentifierManifest.Value, payload); - if (!string.IsNullOrEmpty(roundEndMessage.RoundEndText)) + if (!string.IsNullOrEmpty(roundEndMessage.RoundEndText) && roundEndMessage.RoundEndText != "\n") { if (roundEndMessage.RoundEndText.Length <= 4096) { diff --git a/Content.Shared/CCVar/CCVars.Discord.cs b/Content.Shared/CCVar/CCVars.Discord.cs index 4d5541fd65..486fa6934d 100644 --- a/Content.Shared/CCVar/CCVars.Discord.cs +++ b/Content.Shared/CCVar/CCVars.Discord.cs @@ -59,20 +59,6 @@ public sealed partial class CCVars public static readonly CVarDef DiscordRoundEndRoleWebhook = CVarDef.Create("discord.round_end_role", string.Empty, CVar.SERVERONLY); - //WL-Change: Send Manifest in Discord Start - /// - /// URL of the Discord webhook which will relay manifest messages. - /// - public static readonly CVarDef DiscordRoundManifestWebhook = - CVarDef.Create("discord.round_manifest_webhook", string.Empty, CVar.SERVERONLY | CVar.CONFIDENTIAL); - - /// - /// HEX color of manifest discord webhook's embed. - /// - public static readonly CVarDef DiscordRoundManifestWebhookEmbedColor = - CVarDef.Create("discord.round_manifest_webhook_embed_color", Color.DeepSkyBlue.ToHex(), CVar.SERVERONLY); - //WL-Change: Send Manifest in Discord End - /// /// The token used to authenticate with Discord. For the Bot to function set: discord.token, discord.guild_id, and discord.prefix. /// If this is empty, the bot will not connect. diff --git a/Content.Shared/_WL/CCVars/WLCCVars.Discord.cs b/Content.Shared/_WL/CCVars/WLCCVars.Discord.cs new file mode 100644 index 0000000000..c551d915d0 --- /dev/null +++ b/Content.Shared/_WL/CCVars/WLCCVars.Discord.cs @@ -0,0 +1,27 @@ +using Robust.Shared.Configuration; + +namespace Content.Shared._WL.CCVars; + +/// +/// WL modules console variables +/// +public sealed partial class WLCVars +{ + /// + /// Через какое время все токены на подключение аккаунта игры к дискорду будут недействительны. + /// + public static readonly CVarDef DiscordAuthTokensExpirationTime = + CVarDef.Create("discord.auth_tokens_expiration_time", 300, CVar.REPLICATED); + + /// + /// URL of the Discord webhook which will relay manifest messages. + /// + public static readonly CVarDef DiscordRoundManifestWebhook = + CVarDef.Create("discord.round_manifest_webhook", string.Empty, CVar.SERVERONLY | CVar.CONFIDENTIAL); + + /// + /// HEX color of manifest discord webhook's embed. + /// + public static readonly CVarDef DiscordRoundManifestWebhookEmbedColor = + CVarDef.Create("discord.round_manifest_webhook_embed_color", Color.DeepSkyBlue.ToHex(), CVar.SERVERONLY); +} diff --git a/Content.Shared/_WL/CCVars/WLCCVars.Game.cs b/Content.Shared/_WL/CCVars/WLCCVars.Game.cs new file mode 100644 index 0000000000..faac30b862 --- /dev/null +++ b/Content.Shared/_WL/CCVars/WLCCVars.Game.cs @@ -0,0 +1,21 @@ +using Robust.Shared.Configuration; + +namespace Content.Shared._WL.CCVars; + +/// +/// WL modules console variables +/// +public sealed partial class WLCVars +{ + /// + /// Через сколько времени(в секундах) появится кнопка возвращения в лобби. + /// + public static readonly CVarDef GhostReturnToLobbyButtonCooldown = + CVarDef.Create("ghost.return_to_lobby_button_cooldown", 600, CVar.SERVERONLY); //WL-changes (10 minutes) + + /// + /// Нужно ли проверять игрока на возраст при выборе роли. + /// + public static readonly CVarDef IsAgeCheckNeeded = + CVarDef.Create("game.is_age_check_needed", true, CVar.REPLICATED); +} diff --git a/Content.Shared/_WL/CCVars/WLCCVars.HTTPAPI.cs b/Content.Shared/_WL/CCVars/WLCCVars.HTTPAPI.cs new file mode 100644 index 0000000000..413bf8fd6b --- /dev/null +++ b/Content.Shared/_WL/CCVars/WLCCVars.HTTPAPI.cs @@ -0,0 +1,18 @@ +using Robust.Shared.Configuration; + +namespace Content.Shared._WL.CCVars; + +/// +/// WL modules console variables +/// +public sealed partial class WLCVars +{ + /// + /// Токен для авторизации htpp-запросов на api сервера. + /// + public static readonly CVarDef WLApiToken = + CVarDef.Create( + "admin.wl_api_token", string.Empty, + CVar.SERVERONLY | CVar.CONFIDENTIAL, + "Строковой токен, использующийся для авторизации HTTP-запросов, отправленных на http API сервера."); +} diff --git a/Content.Shared/_WL/CCVars/WLCCVars.Ic.cs b/Content.Shared/_WL/CCVars/WLCCVars.Ic.cs new file mode 100644 index 0000000000..c82633117e --- /dev/null +++ b/Content.Shared/_WL/CCVars/WLCCVars.Ic.cs @@ -0,0 +1,15 @@ +using Robust.Shared.Configuration; + +namespace Content.Shared._WL.CCVars; + +/// +/// WL modules console variables +/// +public sealed partial class WLCVars +{ + /// + /// Количество символов в динамическом описании + /// + public static readonly CVarDef MaxDynamicTextLength = + CVarDef.Create("ic.dynamic_text_length", 1024, CVar.SERVER | CVar.REPLICATED); +} diff --git a/Content.Shared/_WL/CCVars/WLCCVars.Poly.cs b/Content.Shared/_WL/CCVars/WLCCVars.Poly.cs new file mode 100644 index 0000000000..4b179bbb62 --- /dev/null +++ b/Content.Shared/_WL/CCVars/WLCCVars.Poly.cs @@ -0,0 +1,23 @@ +using Robust.Shared.Configuration; + +namespace Content.Shared._WL.CCVars; + +/// +/// WL modules console variables +/// +public sealed partial class WLCVars +{ + /// + /// Интервал, через который Поли™ будет готова выбрать новое сообщение! + /// + public static readonly CVarDef PolyMessageChooseCooldown = + CVarDef.Create("poly.choose_cooldown_time", 3600, CVar.SERVERONLY, + "Интервал, через который Поли™ будет готова выбрать новое сообщение!"); + + /// + /// Нужна ли очистка выбранных Поли™ сообщений после РАУНДА. + /// + public static readonly CVarDef PolyNeededRoundEndCleanup = + CVarDef.Create("poly.round_end_cleanup", false, CVar.SERVERONLY, + "Нужна ли очистка выбранных Поли™ сообщений после РАУНДА."); +} diff --git a/Content.Shared/_WL/CCVars/WLCCVars.Skills.cs b/Content.Shared/_WL/CCVars/WLCCVars.Skills.cs new file mode 100644 index 0000000000..0ab62922d7 --- /dev/null +++ b/Content.Shared/_WL/CCVars/WLCCVars.Skills.cs @@ -0,0 +1,15 @@ +using Robust.Shared.Configuration; + +namespace Content.Shared._WL.CCVars; + +/// +/// WL modules console variables +/// +public sealed partial class WLCVars +{ + /// + /// ГАНС! ЕСЛИ ОНИ ВДРУГ НЕ НУЖНЫ ТО ПЕРЕКЛЮЧИ ПЕРЕКЛЮЧАТЕЛЬ!!! + /// + public static readonly CVarDef SkillsEnabled = + CVarDef.Create("skills.enabled", true, CVar.SERVER | CVar.REPLICATED | CVar.ARCHIVE); +} diff --git a/Content.Shared/_WL/CCVars/WLCCVars.Vote.cs b/Content.Shared/_WL/CCVars/WLCCVars.Vote.cs new file mode 100644 index 0000000000..7b4d13eac1 --- /dev/null +++ b/Content.Shared/_WL/CCVars/WLCCVars.Vote.cs @@ -0,0 +1,28 @@ +using Robust.Shared.Configuration; + +namespace Content.Shared._WL.CCVars; + +/// +/// WL modules console variables +/// +public sealed partial class WLCVars +{ + /// + /// Доступна ли игрокам возможность вызвать шаттл голосованием? + /// + public static readonly CVarDef VoteShuttleEnabled = + CVarDef.Create("vote.evacuation_shuttle_vote_enabled", true, CVar.SERVERONLY); + + /// + /// Сколько требуется согласных игроков для вызова. + /// В процентах. + /// + public static readonly CVarDef VoteShuttlePlayersRatio = + CVarDef.Create("vote.evacuation_shuttle_vote_ratio", 0.6f, CVar.SERVERONLY); + + /// + /// Время голосования. + /// + public static readonly CVarDef VoteShuttleTimer = + CVarDef.Create("vote.evacuation_shuttle_vote_time", 40, CVar.SERVERONLY); +} diff --git a/Content.Shared/_WL/CCVars/WLCCVars.cs b/Content.Shared/_WL/CCVars/WLCCVars.cs index 5861abdea9..9851765fa4 100644 --- a/Content.Shared/_WL/CCVars/WLCCVars.cs +++ b/Content.Shared/_WL/CCVars/WLCCVars.cs @@ -6,96 +6,7 @@ namespace Content.Shared._WL.CCVars; /// WL modules console variables /// [CVarDefs] -public sealed class WLCVars +public sealed partial class WLCVars { - /* - * Game - */ - /// - /// Через сколько времени(в секундах) появится кнопка возвращения в лобби. - /// - public static readonly CVarDef GhostReturnToLobbyButtonCooldown = - CVarDef.Create("ghost.return_to_lobby_button_cooldown", 600, CVar.SERVERONLY); //WL-changes (10 minutes) - - /// - /// Нужно ли проверять игрока на возраст при выборе роли. - /// - public static readonly CVarDef IsAgeCheckNeeded = - CVarDef.Create("game.is_age_check_needed", true, CVar.REPLICATED); - - /* - * HTTP API - */ - /// - /// Токен для авторизации htpp-запросов на api сервера. - /// - public static readonly CVarDef WLApiToken = - CVarDef.Create( - "admin.wl_api_token", string.Empty, - CVar.SERVERONLY | CVar.CONFIDENTIAL, - "Строковой токен, использующийся для авторизации HTTP-запросов, отправленных на http API сервера."); - - /* - * Discord - */ - /// - /// Через какое время все токены на подключение аккаунта игры к дискорду будут недействительны. - /// - public static readonly CVarDef DiscordAuthTokensExpirationTime = - CVarDef.Create("discord.auth_tokens_expiration_time", 300, CVar.REPLICATED); - - /* - * Poly - */ - /// - /// Интервал, через который Поли™ будет готова выбрать новое сообщение! - /// - public static readonly CVarDef PolyMessageChooseCooldown = - CVarDef.Create("poly.choose_cooldown_time", 3600, CVar.SERVERONLY, - "Интервал, через который Поли™ будет готова выбрать новое сообщение!"); - - /// - /// Нужна ли очистка выбранных Поли™ сообщений после РАУНДА. - /// - public static readonly CVarDef PolyNeededRoundEndCleanup = - CVarDef.Create("poly.round_end_cleanup", false, CVar.SERVERONLY, - "Нужна ли очистка выбранных Поли™ сообщений после РАУНДА."); - - /* - * Vote - */ - /// - /// Доступна ли игрокам возможность вызвать шаттл голосованием? - /// - public static readonly CVarDef VoteShuttleEnabled = - CVarDef.Create("vote.evacuation_shuttle_vote_enabled", true, CVar.SERVERONLY); - - /// - /// Сколько требуется согласных игроков для вызова. - /// В процентах. - /// - public static readonly CVarDef VoteShuttlePlayersRatio = - CVarDef.Create("vote.evacuation_shuttle_vote_ratio", 0.6f, CVar.SERVERONLY); - - /// - /// Время голосования. - /// - public static readonly CVarDef VoteShuttleTimer = - CVarDef.Create("vote.evacuation_shuttle_vote_time", 40, CVar.SERVERONLY); - - /* - * Ic - */ - - public static readonly CVarDef MaxDynamicTextLength = - CVarDef.Create("ic.dynamic_text_length", 1024, CVar.SERVER | CVar.REPLICATED); - - /* - * Skills - */ - /// - /// ГАНС! ЕСЛИ ОНИ ВДРУГ НЕ НУЖНЫ ТО ПЕРЕКЛЮЧИ ПЕРЕКЛЮЧАТЕЛЬ!!! - /// - public static readonly CVarDef SkillsEnabled = - CVarDef.Create("skills.enabled", true, CVar.SERVER | CVar.REPLICATED | CVar.ARCHIVE); + // Реклама, которая работает! }