net.Iris.EnableRPCs

net.Iris.EnableRPCs

#Overview

name: net.Iris.EnableRPCs

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.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:

  1. Setting this variable to 0 or a negative value will disable Iris RPC replication and execution.
  2. This is an experimental feature, so its behavior might change in future engine versions.
  3. Changing this value at runtime could have immediate effects on networking behavior.

Best practices when using this variable include:

  1. Only disable it if you’re experiencing issues with Iris RPCs or if you’re using an alternative RPC system.
  2. Test your game thoroughly with both enabled and disabled states to ensure compatibility.
  3. 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:

#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)