Net.CheckPushBPRepIndexAgainstName
Net.CheckPushBPRepIndexAgainstName
#Overview
name: Net.CheckPushBPRepIndexAgainstName
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
When enabled, validates that BP generated values passed to MarkPropertyDirtyFromRepIndex match the actual property data
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of Net.CheckPushBPRepIndexAgainstName is to enable validation of Blueprint-generated values passed to the MarkPropertyDirtyFromRepIndex function, ensuring they match the actual property data. This setting variable is part of Unreal Engine’s networking system, specifically related to the Push Model for property replication.
This setting variable is used in the Engine module, particularly in the networking subsystem. It’s referenced in the NetPushModelHelpers.cpp file, which is part of the engine’s networking code.
The value of this variable is set through a console variable (CVar) system. It’s initialized as false and can be changed at runtime using console commands or configuration files.
The associated variable bCheckPushBPRepIndexAgainstName directly interacts with Net.CheckPushBPRepIndexAgainstName. They share the same value, with bCheckPushBPRepIndexAgainstName being the actual boolean used in the code logic.
Developers must be aware that this variable is only functional when WITH_PUSH_VALIDATION_SUPPORT is defined. In release builds or when this macro is not defined, the check is disabled, and the variable is set to a constant false value.
Best practices when using this variable include:
- Enable it during development and testing phases to catch potential mismatches between property names and replication indices.
- Disable it in release builds to avoid performance overhead.
- Use it in conjunction with other networking debugging tools to ensure proper property replication in Blueprints.
Regarding the associated variable bCheckPushBPRepIndexAgainstName:
The purpose of bCheckPushBPRepIndexAgainstName is to act as the internal boolean flag that controls the validation behavior defined by Net.CheckPushBPRepIndexAgainstName.
This variable is used within the UEPushModelPrivate namespace in the Engine module, specifically in the networking subsystem’s Push Model implementation.
Its value is set by the console variable Net.CheckPushBPRepIndexAgainstName, allowing for runtime configuration.
It interacts directly with the Net.CheckPushBPRepIndexAgainstName console variable, serving as the actual flag checked in the code logic.
Developers should be aware that this variable is only effective when WITH_PUSH_VALIDATION_SUPPORT is defined. In other configurations, it’s set to a constant false value.
Best practices for using bCheckPushBPRepIndexAgainstName include:
- Avoid directly modifying this variable; instead, use the Net.CheckPushBPRepIndexAgainstName console variable to control its value.
- Be aware of its impact on performance when enabled, as it adds additional validation checks.
- Use it in conjunction with other debugging tools when investigating Blueprint replication issues.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Net/NetPushModelHelpers.cpp:44
Scope (from outer to inner):
file
namespace UEPushModelPrivate
Source code excerpt:
static bool bCheckPushBPRepIndexAgainstName = false;
FAutoConsoleVariableRef CVarCheckPushBPRepIndexAgainstName(
TEXT("Net.CheckPushBPRepIndexAgainstName"),
bCheckPushBPRepIndexAgainstName,
TEXT("When enabled, validates that BP generated values passed to MarkPropertyDirtyFromRepIndex match the actual property data")
);
#else
static constexpr bool bCheckPushBPRepIndexAgainstName = false;
#endif
#Associated Variable and Callsites
This variable is associated with another variable named bCheckPushBPRepIndexAgainstName
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Net/NetPushModelHelpers.cpp:42
Scope (from outer to inner):
file
namespace UEPushModelPrivate
Source code excerpt:
{
#if WITH_PUSH_VALIDATION_SUPPORT
static bool bCheckPushBPRepIndexAgainstName = false;
FAutoConsoleVariableRef CVarCheckPushBPRepIndexAgainstName(
TEXT("Net.CheckPushBPRepIndexAgainstName"),
bCheckPushBPRepIndexAgainstName,
TEXT("When enabled, validates that BP generated values passed to MarkPropertyDirtyFromRepIndex match the actual property data")
);
#else
static constexpr bool bCheckPushBPRepIndexAgainstName = false;
#endif
}
#endif
void UNetPushModelHelpers::MarkPropertyDirtyFromRepIndex(UObject* Object, int32 RepIndex, FName PropertyName)
{
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Net/NetPushModelHelpers.cpp:69
Scope (from outer to inner):
file
function void UNetPushModelHelpers::MarkPropertyDirtyFromRepIndex
Source code excerpt:
{
#if WITH_PUSH_VALIDATION_SUPPORT
checkf(!UEPushModelPrivate::bCheckPushBPRepIndexAgainstName || Class->ClassReps[RepIndex].Property->GetFName() == PropertyName,
TEXT("Property and RepIndex don't match! Object=%s, RepIndex=%d, InPropertyName=%s, FoundPropertyName=%s"),
*Object->GetPathName(), RepIndex, *PropertyName.ToString(), *(Class->ClassReps[RepIndex].Property->GetName()));
#endif
MARK_PROPERTY_DIRTY_UNSAFE(Object, RepIndex);
}