diff --git a/Content.Server/Connection/ConnectionManager.cs b/Content.Server/Connection/ConnectionManager.cs index b13a968aa1..781bfda697 100644 --- a/Content.Server/Connection/ConnectionManager.cs +++ b/Content.Server/Connection/ConnectionManager.cs @@ -5,6 +5,7 @@ using Content.Server.Database; using Content.Server.GameTicking; using Content.Server.Preferences.Managers; using Content.Shared.CCVar; +using Content.Shared.Corvax.CCCVars; using Content.Shared.GameTicking; using Content.Shared.Players.PlayTimeTracking; using Robust.Server.Player; @@ -140,7 +141,7 @@ namespace Content.Server.Connection // Corvax-Queue-Start var isPrivileged = await HavePrivilegedJoin(e.UserId); - var isQueueEnabled = _cfg.GetCVar(CCVars.QueueEnabled); + var isQueueEnabled = _cfg.GetCVar(CCCVars.QueueEnabled); if (_plyMgr.PlayerCount >= _cfg.GetCVar(CCVars.SoftMaxPlayers) && !isPrivileged && !isQueueEnabled) // Corvax-Queue-End { diff --git a/Content.Server/Corvax/JoinQueue/JoinQueueManager.cs b/Content.Server/Corvax/JoinQueue/JoinQueueManager.cs index 3661885e10..44ce8fb8ec 100644 --- a/Content.Server/Corvax/JoinQueue/JoinQueueManager.cs +++ b/Content.Server/Corvax/JoinQueue/JoinQueueManager.cs @@ -1,6 +1,7 @@ using System.Linq; using Content.Server.Connection; using Content.Shared.CCVar; +using Content.Shared.Corvax.CCCVars; using Content.Shared.Corvax.JoinQueue; using Prometheus; using Robust.Server.Player; @@ -52,7 +53,7 @@ public sealed class JoinQueueManager { _netManager.RegisterNetMessage(); - _cfg.OnValueChanged(CCVars.QueueEnabled, OnQueueCVarChanged, true); + _cfg.OnValueChanged(CCCVars.QueueEnabled, OnQueueCVarChanged, true); _playerManager.PlayerStatusChanged += OnPlayerStatusChanged; } diff --git a/Content.Server/Corvax/RoundNotifications/RoundNotificationsSystem.cs b/Content.Server/Corvax/RoundNotifications/RoundNotificationsSystem.cs index e0a123f33a..1ff9226f98 100644 --- a/Content.Server/Corvax/RoundNotifications/RoundNotificationsSystem.cs +++ b/Content.Server/Corvax/RoundNotifications/RoundNotificationsSystem.cs @@ -4,6 +4,7 @@ using System.Text.Json; using System.Text.Json.Serialization; using Content.Server.Maps; using Content.Shared.CCVar; +using Content.Shared.Corvax.CCCVars; using Content.Shared.GameTicking; using Robust.Shared.Configuration; @@ -30,8 +31,8 @@ public sealed class RoundNotificationsSystem : EntitySystem SubscribeLocalEvent(OnRoundStarted); SubscribeLocalEvent(OnRoundEnd); - _config.OnValueChanged(CCVars.DiscordRoundWebhook, value => _discordWebhook = value, true); - _config.OnValueChanged(CCVars.DiscordRoundRoleId, value => _discordRoleId = value, true); + _config.OnValueChanged(CCCVars.DiscordRoundWebhook, value => _discordWebhook = value, true); + _config.OnValueChanged(CCCVars.DiscordRoundRoleId, value => _discordRoleId = value, true); _sawmill = IoCManager.Resolve().GetSawmill("notifications"); } @@ -120,4 +121,4 @@ public sealed class RoundNotificationsSystem : EntitySystem { } } -} \ No newline at end of file +} diff --git a/Content.Server/Corvax/Sponsors/SponsorsManager.cs b/Content.Server/Corvax/Sponsors/SponsorsManager.cs index b25099d775..1cbdfab362 100644 --- a/Content.Server/Corvax/Sponsors/SponsorsManager.cs +++ b/Content.Server/Corvax/Sponsors/SponsorsManager.cs @@ -3,7 +3,7 @@ using System.Net; using System.Net.Http; using System.Net.Http.Json; using System.Threading.Tasks; -using Content.Shared.CCVar; +using Content.Shared.Corvax.CCCVars; using Content.Shared.Corvax.Sponsors; using Robust.Shared.Configuration; using Robust.Shared.Network; @@ -26,7 +26,7 @@ public sealed class SponsorsManager public void Initialize() { _sawmill = Logger.GetSawmill("sponsors"); - _cfg.OnValueChanged(CCVars.SponsorsApiUrl, s => _apiUrl = s, true); + _cfg.OnValueChanged(CCCVars.SponsorsApiUrl, s => _apiUrl = s, true); _netMgr.RegisterNetMessage(); diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs index 4cb6c2484e..5090232e78 100644 --- a/Content.Shared/CCVar/CCVars.cs +++ b/Content.Shared/CCVar/CCVars.cs @@ -1389,7 +1389,6 @@ namespace Content.Shared.CCVar /// public static readonly CVarDef InfoLinksBugReport = CVarDef.Create("infolinks.bug_report", "", CVar.SERVER | CVar.REPLICATED); - /* * CONFIG */ @@ -1422,41 +1421,5 @@ namespace Content.Shared.CCVar /// public static readonly CVarDef ConfigPresetDebug = CVarDef.Create("config.preset_debug", true, CVar.SERVERONLY); - - /** - * Corvax | RoundNotifications - */ - - /// - /// URL of the Discord webhook which will send round status notifications. - /// - public static readonly CVarDef DiscordRoundWebhook = - CVarDef.Create("discord.round_webhook", string.Empty, CVar.SERVERONLY); - - /// - /// Discord ID of role which will be pinged on new round start message. - /// - public static readonly CVarDef DiscordRoundRoleId = - CVarDef.Create("discord.round_roleid", string.Empty, CVar.SERVERONLY); - - /** - * Corvax | Sponsors - */ - - /// - /// URL of the sponsors server API. - /// - public static readonly CVarDef SponsorsApiUrl = - CVarDef.Create("sponsor.api_url", "", CVar.SERVERONLY); - - /* - * Corvax | Queue - */ - - /// - /// Controls if the connections queue is enabled. If enabled stop kicking new players after `SoftMaxPlayers` cap and instead add them to queue. - /// - public static readonly CVarDef - QueueEnabled = CVarDef.Create("queue.enabled", false, CVar.SERVERONLY); } } diff --git a/Content.Shared/Corvax/CCCVars/CCCVars.cs b/Content.Shared/Corvax/CCCVars/CCCVars.cs new file mode 100644 index 0000000000..395853ada7 --- /dev/null +++ b/Content.Shared/Corvax/CCCVars/CCCVars.cs @@ -0,0 +1,47 @@ +using Robust.Shared.Configuration; + +namespace Content.Shared.Corvax.CCCVars; + +/// +/// Corvax modules console variables +/// +[CVarDefs] +// ReSharper disable once InconsistentNaming +public sealed class CCCVars +{ + /** + * RoundNotifications + */ + + /// + /// URL of the Discord webhook which will send round status notifications. + /// + public static readonly CVarDef DiscordRoundWebhook = + CVarDef.Create("discord.round_webhook", string.Empty, CVar.SERVERONLY); + + /// + /// Discord ID of role which will be pinged on new round start message. + /// + public static readonly CVarDef DiscordRoundRoleId = + CVarDef.Create("discord.round_roleid", string.Empty, CVar.SERVERONLY); + + /** + * Sponsors + */ + + /// + /// URL of the sponsors server API. + /// + public static readonly CVarDef SponsorsApiUrl = + CVarDef.Create("sponsor.api_url", "", CVar.SERVERONLY); + + /* + * Queue + */ + + /// + /// Controls if the connections queue is enabled. If enabled stop kicking new players after `SoftMaxPlayers` cap and instead add them to queue. + /// + public static readonly CVarDef + QueueEnabled = CVarDef.Create("queue.enabled", false, CVar.SERVERONLY); +}