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:
@@ -322,6 +322,10 @@ namespace Content.Server.Voting.Managers
|
|||||||
if (voteType != null && _standardVoteTimeout.TryGetValue(voteType.Value, out timeSpan))
|
if (voteType != null && _standardVoteTimeout.TryGetValue(voteType.Value, out timeSpan))
|
||||||
return false;
|
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);
|
return !_voteTimeout.TryGetValue(initiator.UserId, out timeSpan);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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.
|
/// The required ratio of the server that must agree for a restart round vote to go through.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly CVarDef<float> VoteRestartRequiredRatio =
|
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>
|
/// <summary>
|
||||||
/// The delay which two votes of the same type are allowed to be made by separate people, in seconds.
|
/// The delay which two votes of the same type are allowed to be made by separate people, in seconds.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user