Net.Iris.DebugName

Net.Iris.DebugName

#Overview

name: Net.Iris.DebugName

This variable is created as a Console Variable (cvar).

It is referenced in 5 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of Net.Iris.DebugName is to set a class name or object name for debugging purposes in the Iris networking system of Unreal Engine 5. It is primarily used for debugging and development tasks within the Iris networking subsystem.

This setting variable is relied upon by the Iris networking subsystem, which is part of Unreal Engine’s experimental networking features. It is used in the Iris Core module, specifically within the IrisDebugging functionality.

The value of this variable is set through the console variable system of Unreal Engine. It can be modified at runtime using console commands or through configuration files.

The associated variable GIrisDebugName interacts closely with Net.Iris.DebugName. They share the same value, with GIrisDebugName being the internal representation used in the C++ code.

Developers must be aware that this variable is intended for debugging purposes only and should not be used in production code. It allows for targeted debugging of specific objects or classes within the Iris networking system.

Best practices when using this variable include:

  1. Only use it during development and debugging phases.
  2. Clear the value when not actively debugging to avoid unnecessary performance overhead.
  3. Use specific and unique names to ensure accurate targeting of objects or classes.

Regarding the associated variable GIrisDebugName:

The purpose of GIrisDebugName is to store the internally used string value set by Net.Iris.DebugName. It is used within the Iris networking system for various debugging functions.

GIrisDebugName is used in several key functions within the IrisDebugging system:

  1. BreakOnObjectName: Triggers a debug break when an object’s name contains the specified debug name.
  2. FilterDebuggedObject: Filters objects based on whether their name contains the debug name.
  3. SetIrisDebugObjectName: Sets the debug name from an external source.

The value of GIrisDebugName is set indirectly through the Net.Iris.DebugName console variable.

Developers should be aware that GIrisDebugName is an internal variable and should not be modified directly. Instead, they should use the Net.Iris.DebugName console variable to change its value.

Best practices for GIrisDebugName include:

  1. Treat it as a read-only variable in most contexts.
  2. Rely on the console variable system to modify its value.
  3. Be cautious of performance implications when frequently checking against this variable in debug code.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Iris/Core/Private/Iris/Core/IrisDebugging.cpp:27

Scope (from outer to inner):

file
namespace    UE::Net::IrisDebugHelper
namespace    IrisDebugHelperInternal

Source code excerpt:

	static FString GIrisDebugName;
	FAutoConsoleVariableRef NetIrisDebugName(
		TEXT("Net.Iris.DebugName"),
		GIrisDebugName,
		TEXT("Set a class name or object name to break on."),
		ECVF_Default);

	static FString GIrisDebugRPCName;
	FAutoConsoleVariableRef NetRPCSetDebugRPCName(

#Associated Variable and Callsites

This variable is associated with another variable named GIrisDebugName. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Iris/Core/Private/Iris/Core/IrisDebugging.cpp:25

Scope (from outer to inner):

file
namespace    UE::Net::IrisDebugHelper
namespace    IrisDebugHelperInternal

Source code excerpt:

namespace IrisDebugHelperInternal
{
	static FString GIrisDebugName;
	FAutoConsoleVariableRef NetIrisDebugName(
		TEXT("Net.Iris.DebugName"),
		GIrisDebugName,
		TEXT("Set a class name or object name to break on."),
		ECVF_Default);

	static FString GIrisDebugRPCName;
	FAutoConsoleVariableRef NetRPCSetDebugRPCName(
		TEXT("Net.Iris.DebugRPCName"),

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Iris/Core/Private/Iris/Core/IrisDebugging.cpp:78

Scope (from outer to inner):

file
namespace    UE::Net::IrisDebugHelper
function     bool BreakOnObjectName

Source code excerpt:

bool BreakOnObjectName(UObject* Object)
{
	if (IrisDebugHelperInternal::GIrisDebugName.IsEmpty() == false && GetNameSafe(Object).Contains(IrisDebugHelperInternal::GIrisDebugName))
	{
		UE_DEBUG_BREAK();
		return true;
	}

	return false;

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Iris/Core/Private/Iris/Core/IrisDebugging.cpp:89

Scope (from outer to inner):

file
namespace    UE::Net::IrisDebugHelper
function     bool FilterDebuggedObject

Source code excerpt:

bool FilterDebuggedObject(UObject* Object)
{
	if (IrisDebugHelperInternal::GIrisDebugName.IsEmpty() || GetNameSafe(Object).Contains(IrisDebugHelperInternal::GIrisDebugName))
	{
		return true;
	}

	return false;
}

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Iris/Core/Private/Iris/Core/IrisDebugging.cpp:145

Scope (from outer to inner):

file
namespace    UE::Net::IrisDebugHelper
function     void SetIrisDebugObjectName

Source code excerpt:

	if (NameBuffer)
	{
		IrisDebugHelperInternal::GIrisDebugName = ANSI_TO_TCHAR(NameBuffer);
	}
	else
	{
		IrisDebugHelperInternal::GIrisDebugName = FString();
	}
}

void SetIrisDebugNetRefHandle(uint64 NetRefHandleId)
{
	IrisDebugHelperInternal::GIrisDebugNetRefHandle = Private::FNetRefHandleManager::MakeNetRefHandleFromId(NetRefHandleId);