net.Iris.EnableRPCs
net.Iris.EnableRPCs
#Overview
name: net.Iris.EnableRPCs
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
If > 0 let Iris replicate and execute RPCs.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of net.Iris.EnableRPCs is to control whether the Iris system in Unreal Engine 5 is allowed to replicate and execute Remote Procedure Calls (RPCs).
This setting variable is primarily used in the networking system, specifically within the Iris experimental module. The Iris module appears to be a part of Unreal Engine’s networking subsystem, focusing on replication and RPC handling.
Based on the callsites, the Unreal Engine subsystem that relies on this setting variable is the Iris Core module, which is part of the experimental networking features. It’s used within the NetBlobManager class, which is likely responsible for managing network-related data blobs.
The value of this variable is set using a console variable (CVar) system. It’s initialized with a default value of 1, meaning Iris RPCs are enabled by default. Developers can change this value at runtime using console commands or through code.
The associated variable CVarEnableIrisRPCs directly interacts with net.Iris.EnableRPCs. It’s a static TAutoConsoleVariable that holds the actual value of the setting.
Developers must be aware that:
- Setting this variable to 0 or a negative value will disable Iris RPC replication and execution.
- This is an experimental feature, so its behavior might change in future engine versions.
- Changing this value at runtime could have immediate effects on networking behavior.
Best practices when using this variable include:
- Only disable it if you’re experiencing issues with Iris RPCs or if you’re using an alternative RPC system.
- Test your game thoroughly with both enabled and disabled states to ensure compatibility.
- Consider exposing this setting in your game’s options menu if you want to give advanced users control over it.
Regarding the associated variable CVarEnableIrisRPCs:
- It’s a console variable of type int32, allowing for easy modification via console commands.
- It’s used in the SendRPC functions of the NetBlobManager to determine whether to proceed with RPC handling.
- The value is retrieved using GetValueOnGameThread(), suggesting it’s designed to be safely accessed from the game thread.
- Developers should use this variable when they need to programmatically check or modify the Iris RPC enabled state within C++ 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/ReplicationSystem/NetBlob/NetBlobManager.cpp:16
Scope (from outer to inner):
file
namespace UE::Net::Private
Source code excerpt:
{
static TAutoConsoleVariable<int32> CVarEnableIrisRPCs(TEXT("net.Iris.EnableRPCs"), 1, TEXT( "If > 0 let Iris replicate and execute RPCs."));
FNetBlobManager::FNetBlobManager()
{
}
void FNetBlobManager::Init(FNetBlobManagerInitParams& InitParams)
#Associated Variable and Callsites
This variable is associated with another variable named CVarEnableIrisRPCs
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Iris/Core/Private/Iris/ReplicationSystem/NetBlob/NetBlobManager.cpp:16
Scope (from outer to inner):
file
namespace UE::Net::Private
Source code excerpt:
{
static TAutoConsoleVariable<int32> CVarEnableIrisRPCs(TEXT("net.Iris.EnableRPCs"), 1, TEXT( "If > 0 let Iris replicate and execute RPCs."));
FNetBlobManager::FNetBlobManager()
{
}
void FNetBlobManager::Init(FNetBlobManagerInitParams& InitParams)
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Iris/Core/Private/Iris/ReplicationSystem/NetBlob/NetBlobManager.cpp:96
Scope (from outer to inner):
file
namespace UE::Net::Private
function bool FNetBlobManager::SendRPC
Source code excerpt:
bool FNetBlobManager::SendRPC(const UObject* Object, const UObject* SubObject, const UFunction* Function, const void* Parameters, UE::Net::ENetObjectAttachmentSendPolicyFlags SendFlags)
{
if (CVarEnableIrisRPCs.GetValueOnGameThread() <= 0)
{
return false;
}
UNetRPCHandler* Handler = RPCHandler.Get();
if (Handler == nullptr)
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Iris/Core/Private/Iris/ReplicationSystem/NetBlob/NetBlobManager.cpp:140
Scope (from outer to inner):
file
namespace UE::Net::Private
function bool FNetBlobManager::SendRPC
Source code excerpt:
bool FNetBlobManager::SendRPC(uint32 ConnectionId, const UObject* Object, const UObject* SubObject, const UFunction* Function, const void* Parameters, UE::Net::ENetObjectAttachmentSendPolicyFlags SendFlags)
{
if (CVarEnableIrisRPCs.GetValueOnGameThread() <= 0)
{
return false;
}
UNetRPCHandler* Handler = RPCHandler.Get();
if (Handler == nullptr)