From bd0631c45bac27de8aff0b0a8700ac4291267066 Mon Sep 17 00:00:00 2001 From: DrSmugleaf <10968691+DrSmugleaf@users.noreply.github.com> Date: Tue, 18 Jun 2024 05:00:29 -0700 Subject: [PATCH] Add cvar to disable round end pvs overrides (#29151) --- Content.Server/GameTicking/GameTicker.RoundFlow.cs | 3 ++- Content.Shared/CCVar/CCVars.cs | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Content.Server/GameTicking/GameTicker.RoundFlow.cs b/Content.Server/GameTicking/GameTicker.RoundFlow.cs index 98fcc64410..eed120dc4e 100644 --- a/Content.Server/GameTicking/GameTicker.RoundFlow.cs +++ b/Content.Server/GameTicking/GameTicker.RoundFlow.cs @@ -358,6 +358,7 @@ namespace Content.Server.GameTicking var listOfPlayerInfo = new List(); // Grab the great big book of all the Minds, we'll need them for this. var allMinds = EntityQueryEnumerator(); + var pvsOverride = _configurationManager.GetCVar(CCVars.RoundEndPVSOverrides); while (allMinds.MoveNext(out var mindId, out var mind)) { // TODO don't list redundant observer roles? @@ -388,7 +389,7 @@ namespace Content.Server.GameTicking else if (mind.CurrentEntity != null && TryName(mind.CurrentEntity.Value, out var icName)) playerIcName = icName; - if (TryGetEntity(mind.OriginalOwnedEntity, out var entity)) + if (TryGetEntity(mind.OriginalOwnedEntity, out var entity) && pvsOverride) { _pvsOverride.AddGlobalOverride(GetNetEntity(entity.Value), recursive: true); } diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs index 7cc1b341a9..26410db846 100644 --- a/Content.Shared/CCVar/CCVars.cs +++ b/Content.Shared/CCVar/CCVars.cs @@ -432,6 +432,14 @@ namespace Content.Shared.CCVar public static readonly CVarDef RoundEndSoundCollection = CVarDef.Create("game.round_end_sound_collection", "RoundEnd", CVar.SERVERONLY); + /// + /// Whether or not to add every player as a global override to PVS at round end. + /// This will allow all players to see their clothing in the round screen player list screen, + /// but may cause lag during round end with very high player counts. + /// + public static readonly CVarDef RoundEndPVSOverrides = + CVarDef.Create("game.round_end_pvs_overrides", true, CVar.SERVERONLY); + /* * Discord */ -- 2.51.2