net.IgnoreNetworkChecksumMismatch
net.IgnoreNetworkChecksumMismatch
#Overview
name: net.IgnoreNetworkChecksumMismatch
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
If true, the integrity checksum on packagemap objects will be ignored, which can cause issues with out of sync data
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of net.IgnoreNetworkChecksumMismatch is to control whether the integrity checksum on packagemap objects should be ignored during network operations. This setting is primarily used in the networking system of Unreal Engine 5.
The Unreal Engine subsystem that relies on this setting variable is the networking system, specifically the package map client and object reference cache components. This can be seen from the file locations where the variable is referenced: PackageMapClient.cpp and ObjectReferenceCache.cpp.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 0 (false), meaning that by default, the network checksum mismatches are not ignored.
This variable interacts closely with its associated variable CVarIgnoreNetworkChecksumMismatch. They share the same value and are used interchangeably in the code.
Developers must be aware that enabling this variable (setting it to true) can cause issues with out-of-sync data in networked gameplay. It’s intended to be used cautiously, likely for debugging or testing purposes.
Best practices when using this variable include:
- Keep it disabled (set to 0) in production builds to ensure data integrity.
- Use it temporarily for debugging network issues.
- Be cautious when enabling it, as it can lead to unexpected behavior in networked games.
Regarding the associated variable CVarIgnoreNetworkChecksumMismatch:
The purpose of CVarIgnoreNetworkChecksumMismatch is the same as net.IgnoreNetworkChecksumMismatch. It’s the C++ representation of the console variable.
This variable is used in the UPackageMapClient and FNetGUIDCache classes to determine whether to perform network checksum comparisons. When set to true (non-zero), it bypasses these checks.
The value of this variable is typically accessed using the GetValueOnAnyThread() method, which suggests it can be safely read from multiple threads.
Developers should be aware that this variable directly impacts the network security and synchronization of the game. Ignoring checksum mismatches can lead to corrupted or inconsistent game states across networked instances.
Best practices for CVarIgnoreNetworkChecksumMismatch include:
- Use it in conjunction with proper error logging to identify the cause of checksum mismatches.
- Reset it to false after debugging sessions to ensure normal operation.
- Consider adding additional safeguards or logging when this variable is enabled to track potential issues that arise from ignoring checksums.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PackageMapClient.cpp:132
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarIgnoreNetworkChecksumMismatch(
TEXT("net.IgnoreNetworkChecksumMismatch"),
0,
TEXT("If true, the integrity checksum on packagemap objects will be ignored, which can cause issues with out of sync data")
);
static TAutoConsoleVariable<int32> CVarReservedNetGuidSize(
TEXT("net.ReservedNetGuidSize"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarIgnoreNetworkChecksumMismatch
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PackageMapClient.cpp:131
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarIgnoreNetworkChecksumMismatch(
TEXT("net.IgnoreNetworkChecksumMismatch"),
0,
TEXT("If true, the integrity checksum on packagemap objects will be ignored, which can cause issues with out of sync data")
);
static TAutoConsoleVariable<int32> CVarReservedNetGuidSize(
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PackageMapClient.cpp:1184
Scope (from outer to inner):
file
function FNetworkGUID UPackageMapClient::InternalLoadObject
Source code excerpt:
}
if ( NetworkChecksum != 0 && GuidCache->NetworkChecksumMode == FNetGUIDCache::ENetworkChecksumMode::SaveAndUse && !CVarIgnoreNetworkChecksumMismatch.GetValueOnAnyThread() )
{
const uint32 CompareNetworkChecksum = GuidCache->GetNetworkChecksum( Object );
if (CompareNetworkChecksum != NetworkChecksum )
{
FString ErrorStr = FString::Printf(TEXT("UPackageMapClient::InternalLoadObject: Default object package network checksum mismatch! ObjectName: %s, ObjOuter: %s, GUID1: %u, GUID2: %u "), *ObjectName, ObjOuter != NULL ? *ObjOuter->GetPathName() : TEXT("NULL"), CompareNetworkChecksum, NetworkChecksum);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PackageMapClient.cpp:3630
Scope (from outer to inner):
file
function UObject* FNetGUIDCache::GetObjectFromNetGUID
Source code excerpt:
}
if ( CacheObjectPtr->NetworkChecksum != 0 && !CVarIgnoreNetworkChecksumMismatch.GetValueOnAnyThread() )
{
const uint32 NetworkChecksum = GetNetworkChecksum( Object );
if (CacheObjectPtr->NetworkChecksum != NetworkChecksum )
{
if ( NetworkChecksumMode == ENetworkChecksumMode::SaveAndUse )
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Iris/Core/Private/Iris/ReplicationSystem/ObjectReferenceCache.cpp:910
Scope (from outer to inner):
file
namespace UE::Net::Private
function UObject* FObjectReferenceCache::ResolveObjectReferenceHandleInternal
Source code excerpt:
}
//if (CacheObjectPtr->NetworkChecksum != 0 && !CVarIgnoreNetworkChecksumMismatch.GetValueOnAnyThread())
//{
// const uint32 NetworkChecksum = GetNetworkChecksum( Object );
// if (CacheObjectPtr->NetworkChecksum != NetworkChecksum )
// {
// if ( NetworkChecksumMode == ENetworkChecksumMode::SaveAndUse )