From 35eb6f85760895078fc2308e4ad4fbe6129a0462 Mon Sep 17 00:00:00 2001 From: Pancake Date: Sun, 6 Feb 2022 21:26:19 -0800 Subject: [PATCH] Add CVars for vote timers. (#6519) * Update VoteManager.DefaultVotes.cs Quick fix to lower map vote time to 90sec. * Change to CVars --- .../Managers/VoteManager.DefaultVotes.cs | 12 ++++----- Content.Shared/CCVar/CCVars.cs | 26 +++++++++++++++++++ 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/Content.Server/Voting/Managers/VoteManager.DefaultVotes.cs b/Content.Server/Voting/Managers/VoteManager.DefaultVotes.cs index 5fc5e65842..a70b86810d 100644 --- a/Content.Server/Voting/Managers/VoteManager.DefaultVotes.cs +++ b/Content.Server/Voting/Managers/VoteManager.DefaultVotes.cs @@ -58,8 +58,8 @@ namespace Content.Server.Voting.Managers (Loc.GetString("ui-vote-restart-no"), false) }, Duration = alone - ? TimeSpan.FromSeconds(10) - : TimeSpan.FromSeconds(30), + ? TimeSpan.FromSeconds(_cfg.GetCVar(CCVars.VoteTimerAlone)) + : TimeSpan.FromSeconds(_cfg.GetCVar(CCVars.VoteTimerRestart)), InitiatorTimeout = TimeSpan.FromMinutes(3) }; @@ -122,8 +122,8 @@ namespace Content.Server.Voting.Managers { Title = Loc.GetString("ui-vote-gamemode-title"), Duration = alone - ? TimeSpan.FromSeconds(10) - : TimeSpan.FromSeconds(30) + ? TimeSpan.FromSeconds(_cfg.GetCVar(CCVars.VoteTimerAlone)) + : TimeSpan.FromSeconds(_cfg.GetCVar(CCVars.VoteTimerPreset)) }; if (alone) @@ -167,8 +167,8 @@ namespace Content.Server.Voting.Managers { Title = Loc.GetString("ui-vote-map-title"), Duration = alone - ? TimeSpan.FromSeconds(10) - : TimeSpan.FromSeconds(180) + ? TimeSpan.FromSeconds(_cfg.GetCVar(CCVars.VoteTimerAlone)) + : TimeSpan.FromSeconds(_cfg.GetCVar(CCVars.VoteTimerMap)) }; if (alone) diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs index 6f08f93848..51352e71f3 100644 --- a/Content.Shared/CCVar/CCVars.cs +++ b/Content.Shared/CCVar/CCVars.cs @@ -543,6 +543,32 @@ namespace Content.Shared.CCVar public static readonly CVarDef VoteSameTypeTimeout = CVarDef.Create("vote.same_type_timeout", 240f, CVar.SERVERONLY); + + /// + /// Sets the duration of the map vote timer. + /// + public static readonly CVarDef + VoteTimerMap = CVarDef.Create("vote.timermap", 90, CVar.SERVERONLY); + + /// + /// Sets the duration of the restart vote timer. + /// + public static readonly CVarDef + VoteTimerRestart = CVarDef.Create("vote.timerrestart", 30, CVar.SERVERONLY); + + /// + /// Sets the duration of the gamemode/preset vote timer. + /// + public static readonly CVarDef + VoteTimerPreset = CVarDef.Create("vote.timerpreset", 30, CVar.SERVERONLY); + + /// + /// Sets the duration of the map vote timer when ALONE. + /// + public static readonly CVarDef + VoteTimerAlone = CVarDef.Create("vote.timeralone", 10, CVar.SERVERONLY); + + /* * BAN */