Net.Iris.DebugRPCName
Net.Iris.DebugRPCName
#Overview
name: Net.Iris.DebugRPCName
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Set the name of an RPC to break on.
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:
- This is a debugging tool and should be used carefully in production environments.
- Setting this variable will cause the engine to break (trigger a breakpoint) when an RPC with a matching name is encountered.
- 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:
- Use it temporarily for debugging purposes and remove or disable it in production builds.
- Be as specific as possible with the RPC name to avoid unintended breaks.
- Clear the variable (set it to an empty string) when debugging is complete to prevent unexpected behavior.
Regarding the associated variable GIrisDebugRPCName:
- Its purpose is to store the actual RPC name that the system will break on.
- It’s used internally by the Iris networking system to perform the actual comparison and trigger the debug break.
- The value is set either through the console command or programmatically using the SetIrisDebugRPCName function.
- It interacts directly with the BreakOnRPCName function, which checks if an RPC should trigger a break.
- Developers should not modify this variable directly but instead use the provided console command or SetIrisDebugRPCName function.
- Best practice is to treat this as a read-only variable from a code perspective and manage it through the proper debugging interfaces provided by the engine.
#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;