From 6fbcc6d0fb797651fba29ded7ad126b8aeb7176f Mon Sep 17 00:00:00 2001 From: Matt Idzik Date: Wed, 15 Oct 2025 05:41:09 -0500 Subject: [PATCH] Fixed votekicks putting you on a one hour vote cooldown (#40622) * Fixed votekick.timeout cvar not configuring behavior as intended. * Refactor TimeoutStandardVote to include timeoutOverride --- .../Voting/Managers/VoteManager.DefaultVotes.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Content.Server/Voting/Managers/VoteManager.DefaultVotes.cs b/Content.Server/Voting/Managers/VoteManager.DefaultVotes.cs index 468bfdc0f8..0dd1540933 100644 --- a/Content.Server/Voting/Managers/VoteManager.DefaultVotes.cs +++ b/Content.Server/Voting/Managers/VoteManager.DefaultVotes.cs @@ -456,7 +456,7 @@ namespace Content.Server.Voting.Managers (Loc.GetString("ui-vote-votekick-abstain"), "abstain") }, Duration = TimeSpan.FromSeconds(_cfg.GetCVar(CCVars.VotekickTimer)), - InitiatorTimeout = TimeSpan.FromMinutes(_cfg.GetCVar(CCVars.VotekickTimeout)), + InitiatorTimeout = TimeSpan.FromSeconds(_cfg.GetCVar(CCVars.VotekickTimeout)), VoterEligibility = voterEligibility, DisplayVotes = false, TargetEntity = targetNetEntity @@ -471,7 +471,7 @@ namespace Content.Server.Voting.Managers var webhookState = _voteWebhooks.CreateWebhookIfConfigured(options, _cfg.GetCVar(CCVars.DiscordVotekickWebhook), Loc.GetString("votekick-webhook-name"), options.Title + "\n" + Loc.GetString("votekick-webhook-description", ("initiator", initiatorName), ("target", targetSession))); // Time out the vote now that we know it will happen - TimeoutStandardVote(StandardVoteType.Votekick); + TimeoutStandardVote(StandardVoteType.Votekick, TimeSpan.FromSeconds(_cfg.GetCVar(CCVars.VotekickTimeout))); vote.OnFinished += (_, eventArgs) => { @@ -578,9 +578,9 @@ namespace Content.Server.Voting.Managers } } - private void TimeoutStandardVote(StandardVoteType type) + private void TimeoutStandardVote(StandardVoteType type, TimeSpan? timeoutOverride = null) { - var timeout = TimeSpan.FromSeconds(_cfg.GetCVar(CCVars.VoteSameTypeTimeout)); + var timeout = timeoutOverride ?? TimeSpan.FromSeconds(_cfg.GetCVar(CCVars.VoteSameTypeTimeout)); _standardVoteTimeout[type] = _timing.RealTime + timeout; DirtyCanCallVoteAll(); }