net.AllowRPCDoSDetectionBlocking

net.AllowRPCDoSDetectionBlocking

#Overview

name: net.AllowRPCDoSDetectionBlocking

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

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of net.AllowRPCDoSDetectionBlocking is to control whether RPC DoS (Denial of Service) Detection blocking is allowed in Unreal Engine’s networking system. This setting is part of the engine’s network security features, specifically designed to prevent potential abuse of Remote Procedure Calls (RPCs).

This setting variable is primarily used in the networking subsystem of Unreal Engine, particularly in the RPC DoS Detection module. Based on the callsites, it’s implemented in the Engine module, specifically in the Net subdirectory.

The value of this variable is set through a console variable (CVar) named “net.AllowRPCDoSDetectionBlocking”. It’s initialized to 1 (enabled) by default, as seen in the source code.

This variable interacts closely with another variable named GAllowRPCDoSDetectionBlocking. They share the same value, with GAllowRPCDoSDetectionBlocking being the actual global variable that stores the setting, while net.AllowRPCDoSDetectionBlocking is the console variable used to modify it.

Developers must be aware that this variable is a binary switch (0 for disabled, 1 for enabled) that determines whether the engine will block RPCs when it detects potential DoS attacks. When enabled, it works in conjunction with other DoS detection parameters like RPCRepeatLimitTimePeriod, RPCRepeatLimitPerPeriod, and RPCRepeatLimitSecsPerPeriod to determine if an RPC should be blocked.

Best practices when using this variable include:

  1. Keeping it enabled (1) in production environments to maintain security.
  2. Potentially disabling it (0) during development or testing if RPC blocking is interfering with legitimate testing scenarios.
  3. Using it in conjunction with other DoS detection settings for a comprehensive security approach.
  4. Monitoring its effects on performance and gameplay, adjusting other DoS detection parameters if necessary.

Regarding the associated variable GAllowRPCDoSDetectionBlocking:

The purpose of GAllowRPCDoSDetectionBlocking is to store the actual value of whether RPC DoS Detection blocking is allowed. It’s the internal representation of the console variable net.AllowRPCDoSDetectionBlocking.

This variable is used directly in the Engine’s networking code to determine whether to block RPCs when DoS is detected. It’s primarily used in the FRPCDoSDetection::CheckRPCTracking function.

The value of this variable is set indirectly through the console variable net.AllowRPCDoSDetectionBlocking.

It interacts closely with other DoS detection variables and is used in conjunction with RPCRepeatLimitTimePeriod, RPCRepeatLimitPerPeriod, and RPCRepeatLimitSecsPerPeriod to determine if an RPC should be blocked.

Developers should be aware that this is an internal variable and should generally be modified through the console variable rather than directly.

Best practices for this variable are similar to those for net.AllowRPCDoSDetectionBlocking, as they represent the same setting. The main difference is that developers should interact with the console variable (net.AllowRPCDoSDetectionBlocking) rather than this internal variable directly.

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

Scope: file

Source code excerpt:


FAutoConsoleVariableRef CVarAllowRPCDoSDetectionBlocking(
	TEXT("net.AllowRPCDoSDetectionBlocking"),
	GAllowRPCDoSDetectionBlocking,
	TEXT("Overrides whether or not RPC DoS Detection RPC blocking is allowed. 0 = disabled, 1 = enabled."));

TAutoConsoleVariable<int32> CVarAllowRPCDoSDetectionKicking(
	TEXT("net.AllowRPCDoSDetectionKicking"), 1,
	TEXT("Overrides whether or not RPC DoS Detection kicking is enabled. 0 = disabled, 1 = enabled."));

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

	TEXT("Example: net.RPCDoSDetectionOverride=GameNetDriver=1,BeaconNetDriver=0"));

int32 GAllowRPCDoSDetectionBlocking = 1;

FAutoConsoleVariableRef CVarAllowRPCDoSDetectionBlocking(
	TEXT("net.AllowRPCDoSDetectionBlocking"),
	GAllowRPCDoSDetectionBlocking,
	TEXT("Overrides whether or not RPC DoS Detection RPC blocking is allowed. 0 = disabled, 1 = enabled."));

TAutoConsoleVariable<int32> CVarAllowRPCDoSDetectionKicking(
	TEXT("net.AllowRPCDoSDetectionKicking"), 1,
	TEXT("Overrides whether or not RPC DoS Detection kicking is enabled. 0 = disabled, 1 = enabled."));

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

Scope (from outer to inner):

file
function     ERPCNotifyResult FRPCDoSDetection::CheckRPCTracking

Source code excerpt:

				};

			const bool bBlockRPC = GAllowRPCDoSDetectionBlocking == 1 && RPCRepeatLimitTimePeriod != -1 &&
									HasHitQuota(RPCRepeatLimitTimePeriod, RPCRepeatLimitPerPeriod, RPCRepeatLimitSecsPerPeriod);

			Tracking.BlockState = bBlockRPC ? ERPCBlockState::Blocked : ERPCBlockState::NotBlocked;
		}

		if (Tracking.BlockState == ERPCBlockState::Blocked)