Net.Iris.DebugRPCName

Net.Iris.DebugRPCName

#Overview

name: Net.Iris.DebugRPCName

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

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of Net.Iris.DebugRPCName is to aid in debugging Remote Procedure Calls (RPCs) within the Iris networking system of Unreal Engine 5. It allows developers to set a specific RPC name to break on during execution, which can be useful for isolating and investigating networking-related issues.

This setting variable is primarily used by the Iris networking subsystem, which is part of Unreal Engine’s experimental networking features. It’s located in the Iris Core module, as evident from the file path “Runtime/Experimental/Iris/Core”.

The value of this variable is set through the console command system, as indicated by the FAutoConsoleVariableRef declaration. Developers can set it at runtime using the console command “Net.Iris.DebugRPCName”.

The associated variable GIrisDebugRPCName directly interacts with Net.Iris.DebugRPCName. They share the same value, with GIrisDebugRPCName being the actual storage for the RPC name to break on.

Developers should be aware that:

  1. This is a debugging tool and should be used carefully in production environments.
  2. Setting this variable will cause the engine to break (trigger a breakpoint) when an RPC with a matching name is encountered.
  3. The comparison is case-insensitive and uses a “contains” check, so partial matches will also trigger the break.

Best practices for using this variable include:

  1. Use it temporarily for debugging purposes and remove or disable it in production builds.
  2. Be as specific as possible with the RPC name to avoid unintended breaks.
  3. Clear the variable (set it to an empty string) when debugging is complete to prevent unexpected behavior.

Regarding the associated variable GIrisDebugRPCName:

#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:34

Scope (from outer to inner):

file
namespace    UE::Net::IrisDebugHelper
namespace    IrisDebugHelperInternal

Source code excerpt:

	static FString GIrisDebugRPCName;
	FAutoConsoleVariableRef NetRPCSetDebugRPCName(
		TEXT("Net.Iris.DebugRPCName"),
		GIrisDebugRPCName,
		TEXT("Set the name of an RPC to break on."),
		ECVF_Default);

	static FNetRefHandle GIrisDebugNetRefHandle;
	static FAutoConsoleCommand NetIrisDebugNetRefHandle(

#Associated Variable and Callsites

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

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

Scope (from outer to inner):

file
namespace    UE::Net::IrisDebugHelper
namespace    IrisDebugHelperInternal

Source code excerpt:

		ECVF_Default);

	static FString GIrisDebugRPCName;
	FAutoConsoleVariableRef NetRPCSetDebugRPCName(
		TEXT("Net.Iris.DebugRPCName"),
		GIrisDebugRPCName,
		TEXT("Set the name of an RPC to break on."),
		ECVF_Default);

	static FNetRefHandle GIrisDebugNetRefHandle;
	static FAutoConsoleCommand NetIrisDebugNetRefHandle(
		TEXT("Net.Iris.DebugNetRefHandle"), 

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

Scope (from outer to inner):

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

Source code excerpt:

bool BreakOnRPCName(FName RPCName)
{
	if (IrisDebugHelperInternal::GIrisDebugRPCName.IsEmpty() == false && RPCName.GetPlainNameString().Contains(IrisDebugHelperInternal::GIrisDebugRPCName))
	{
		UE_DEBUG_BREAK();
		return true;
	}

	return false;

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

Scope (from outer to inner):

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

Source code excerpt:

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

void SetIrisDebugInternalNetRefIndex(UE::Net::Private::FInternalNetRefIndex InternalIndex)
{
	IrisDebugHelperInternal::GIrisDebugInternalIndex = InternalIndex;