bTrackRecentRPCs

bTrackRecentRPCs

#Overview

name: bTrackRecentRPCs

The value of this variable can be defined or overridden in .ini config files. 3 .ini config files referencing this setting variable.

It is referenced in 5 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bTrackRecentRPCs is to control whether the Unreal Engine keeps a temporary record of recent Remote Procedure Calls (RPCs) for potential logging and analytics purposes. This setting is primarily used in the network communication system, specifically for RPC Denial of Service (DoS) detection.

This setting variable is primarily used in the Unreal Engine’s networking subsystem, particularly within the RPC DoS detection module. It’s part of the Engine module, as evidenced by its location in the Engine/Source/Runtime/Engine directory.

The value of this variable is set in the configuration files, as indicated by the UPROPERTY(config) macro in the header file. It can also be modified programmatically, as seen in the ApplyState function where it’s assigned from one state to another.

bTrackRecentRPCs interacts with several other variables related to RPC DoS detection, such as RPCRepeatLimitPerPeriod and RPCRepeatLimitTimePeriod. It’s used in conjunction with these variables to determine whether RPC tracking should be enabled.

Developers must be aware that enabling this variable (setting it to true) will cause the engine to keep track of recent RPCs, which could have performance implications, especially in high-traffic network scenarios. It should be used judiciously and primarily for debugging or when DoS detection is necessary.

Best practices when using this variable include:

  1. Only enable it when necessary for debugging or when DoS protection is required.
  2. Be aware of the performance impact when enabled, especially in multiplayer games with high RPC traffic.
  3. Use it in conjunction with other RPC DoS detection settings for comprehensive protection.
  4. Consider disabling it in shipping builds unless absolutely necessary for security reasons.
  5. When enabled, make sure to properly analyze the logged data to identify potential DoS attempts or other network issues.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEngine.ini:1753, section: [RPCDoSDetection.PersistentBurst]

Location: <Workspace>/Engine/Config/BaseEngine.ini:1766, section: [RPCDoSDetection.DoS]

Location: <Workspace>/Engine/Config/BaseEngine.ini:1782, section: [RPCDoSDetection.ExpensiveDoS]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Net/RPCDoSDetection.cpp:127

Scope (from outer to inner):

file
function     void FRPCDoSState::ApplyImpliedValues

Source code excerpt:

	RPCRepeatLimitTimePeriod = (RPCRepeatLimitPerPeriod != -1 || RPCRepeatLimitMSPerPeriod != -1) ? RPCRepeatLimitTimePeriod : -1;

	bTrackRecentRPCs = bTrackRecentRPCs || (RPCRepeatLimitPerPeriod != -1 && RPCRepeatLimitTimePeriod != -1);
	EscalateTimeQuotaSecsPerFrame = (EscalateTimeQuotaMSPerFrame != -1 ? (EscalateTimeQuotaMSPerFrame / 1000.0) : 0.0);
	EscalateTimeQuotaSecsPerPeriod = (EscalateTimeQuotaMSPerPeriod != -1 ? (EscalateTimeQuotaMSPerPeriod / 1000.0) : 0.0);
	RPCRepeatLimitSecsPerPeriod = (RPCRepeatLimitMSPerPeriod != -1 ? (RPCRepeatLimitMSPerPeriod / 1000.0) : 0.0);
	EscalationTimeToleranceSeconds = (EscalationTimeToleranceMS != -1 ? (EscalationTimeToleranceMS / 1000.0) : 0.0);
}

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Net/RPCDoSDetection.cpp:312

Scope (from outer to inner):

file
function     void FRPCDoSStateConfig::ApplyState

Source code excerpt:

	Target.bSendEscalateAnalytics			= bSendEscalateAnalytics;
	Target.bKickPlayer						= bKickPlayer;
	Target.bTrackRecentRPCs					= bTrackRecentRPCs;
	Target.EscalateQuotaRPCsPerFrame		= EscalateQuotaRPCsPerFrame;
	Target.EscalateTimeQuotaMSPerFrame		= EscalateTimeQuotaMSPerFrame;
	Target.EscalateQuotaRPCsPerPeriod		= EscalateQuotaRPCsPerPeriod;
	Target.EscalateTimeQuotaMSPerPeriod		= EscalateTimeQuotaMSPerPeriod;
	Target.EscalateQuotaTimePeriod			= EscalateQuotaTimePeriod;
	Target.RPCRepeatLimitPerPeriod			= RPCRepeatLimitPerPeriod;

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Net/RPCDoSDetection.cpp:803

Scope (from outer to inner):

file
function     void FRPCDoSDetection::PreTickDispatch

Source code excerpt:

		{
			// Only disable tracking if the active state does not normally enable it
			if (!bTrackRecentRPCs)
			{
				DisableRPCTracking(TimeSeconds);
			}

			ForcedRPCTrackingEndTime = 0.0;
		}

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Net/RPCDoSDetection.cpp:1054

Scope (from outer to inner):

file
function     void FRPCDoSDetection::InitState

Source code excerpt:

void FRPCDoSDetection::InitState(double TimeSeconds)
{
	if (bRPCTrackingEnabled != bTrackRecentRPCs)
	{
		if (bTrackRecentRPCs)
		{
			EnableRPCTracking(TimeSeconds);
		}
		else
		{
			DisableRPCTracking(TimeSeconds);

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/Net/RPCDoSDetection.h:185

Scope: file

Source code excerpt:

	/** Whether or not to keep a temporary record of recent RPC's, for potential logging/analytics */
	UPROPERTY(config)
	bool bTrackRecentRPCs			= false;


	/** Escalation limits - for escalating to a more strict FRPCDoSState */

	/** The number of RPC's per frame before the next stage of DoS detection is triggered */
	UPROPERTY(config)