Add variables to prevent voting of various kinds (#5361)

* Add a way to disable voting for maximum authoritarianism

* Allow disabling specific vote types via cvars

* Migrate standard-vote-to-cvar dictionary to being static
This commit is contained in:
20kdc
2021-11-23 17:03:04 +00:00
committed by GitHub
parent 781a083fcf
commit a2b7982c37
7 changed files with 84 additions and 7 deletions

View File

@@ -431,6 +431,30 @@ namespace Content.Shared.CCVar
* VOTE
*/
/// <summary>
/// Allows enabling/disabling player-started votes for ultimate authority
/// </summary>
public static readonly CVarDef<bool> VoteEnabled =
CVarDef.Create("vote.enabled", true, CVar.SERVERONLY);
/// <summary>
/// See vote.enabled, but specific to restart votes
/// </summary>
public static readonly CVarDef<bool> VoteRestartEnabled =
CVarDef.Create("vote.restart_enabled", true, CVar.SERVERONLY);
/// <summary>
/// See vote.enabled, but specific to preset votes
/// </summary>
public static readonly CVarDef<bool> VotePresetEnabled =
CVarDef.Create("vote.preset_enabled", true, CVar.SERVERONLY);
/// <summary>
/// See vote.enabled, but specific to map votes
/// </summary>
public static readonly CVarDef<bool> VoteMapEnabled =
CVarDef.Create("vote.map_enabled", true, CVar.SERVERONLY);
/// <summary>
/// The required ratio of the server that must agree for a restart round vote to go through.
/// </summary>