Gimps the restart vote. (#9327)

* Disables the restart vote when admins are online.

* Gimps the restart vote so it requires 85% agreement.

* address rebiew
This commit is contained in:
Moony
2022-07-01 02:52:20 -05:00
committed by GitHub
parent 57e5b06fe3
commit efdc3bc7e0
2 changed files with 11 additions and 1 deletions

View File

@@ -322,6 +322,10 @@ namespace Content.Server.Voting.Managers
if (voteType != null && _standardVoteTimeout.TryGetValue(voteType.Value, out timeSpan))
return false;
// No, seriously, stop spamming the restart vote!
if (voteType == StandardVoteType.Restart && _cfg.GetCVar(CCVars.VoteRestartNotAllowedWhenAdminOnline) && _adminMgr.ActiveAdmins.Count() != 0)
return false;
return !_voteTimeout.TryGetValue(initiator.UserId, out timeSpan);
}

View File

@@ -839,8 +839,14 @@ namespace Content.Shared.CCVar
/// The required ratio of the server that must agree for a restart round vote to go through.
/// </summary>
public static readonly CVarDef<float> VoteRestartRequiredRatio =
CVarDef.Create("vote.restart_required_ratio", 0.7f, CVar.SERVERONLY);
CVarDef.Create("vote.restart_required_ratio", 0.85f, CVar.SERVERONLY);
/// <summary>
/// Whether or not to restrict the restart vote when there's online admins.
/// </summary>
public static readonly CVarDef<bool> VoteRestartNotAllowedWhenAdminOnline =
CVarDef.Create("vote.restart_not_allowed_when_admin_online", true, CVar.SERVERONLY);
/// <summary>
/// The delay which two votes of the same type are allowed to be made by separate people, in seconds.
/// </summary>