Restart votes check player count and ghost levels (#23453)

* Restarts have max player count

* Now counts ingame ghosts to determine if restart can be called

* consistant cvar name

* Added a player count with state conditional
This commit is contained in:
Repo
2024-01-19 20:10:05 +13:00
committed by GitHub
parent c35b9964c7
commit 7bf62f1d19
3 changed files with 119 additions and 60 deletions

View File

@@ -1256,6 +1256,18 @@ namespace Content.Shared.CCVar
public static readonly CVarDef<bool> VoteRestartEnabled =
CVarDef.Create("vote.restart_enabled", true, CVar.SERVERONLY);
/// <summary>
/// Config for when the restart vote should be allowed to be called regardless with less than this amount of players.
/// </summary>
public static readonly CVarDef<int> VoteRestartMaxPlayers =
CVarDef.Create("vote.restart_max_players", 20, CVar.SERVERONLY);
/// <summary>
/// Config for when the restart vote should be allowed to be called based on percentage of ghosts.
///
public static readonly CVarDef<int> VoteRestartGhostPercentage =
CVarDef.Create("vote.restart_ghost_percentage", 75, CVar.SERVERONLY);
/// <summary>
/// See vote.enabled, but specific to preset votes
/// </summary>