Disable PVS budged for the full update

It helps preventing weird intermediate states when a client observes
themselves in a void with all the alert notifications going wild.
However it introduces a spike on CPU and networking.
This commit is contained in:
Kot
2024-01-13 02:28:18 +04:00
parent 460c93230a
commit 6976ca04b8

View File

@@ -294,15 +294,19 @@ internal sealed partial class PvsSystem : EntitySystem
// After processing the entity's viewers, we set actual, budget limits.
// ReSharper disable once ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract
if (session.Channel != null)
if (!session.RequestedFull)
{
session.Budget.NewLimit= _netConfigManager.GetClientCVar(session.Channel, CVars.NetPVSEntityBudget);
session.Budget.EnterLimit = _netConfigManager.GetClientCVar(session.Channel, CVars.NetPVSEntityEnterBudget);
}
else
{
session.Budget.NewLimit= CVars.NetPVSEntityBudget.DefaultValue;
session.Budget.EnterLimit = CVars.NetPVSEntityEnterBudget.DefaultValue;
if (session.Channel != null)
{
session.Budget.NewLimit = _netConfigManager.GetClientCVar(session.Channel, CVars.NetPVSEntityBudget);
session.Budget.EnterLimit =
_netConfigManager.GetClientCVar(session.Channel, CVars.NetPVSEntityEnterBudget);
}
else
{
session.Budget.NewLimit = CVars.NetPVSEntityBudget.DefaultValue;
session.Budget.EnterLimit = CVars.NetPVSEntityEnterBudget.DefaultValue;
}
}
// Process all PVS overrides.