net.RPCDoSForcedRPCTracking
net.RPCDoSForcedRPCTracking
#Overview
name: net.RPCDoSForcedRPCTracking
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Sets a single RPC that, when encountered, forcibly enables RPC tracking (limited to one RPC for performance). Can also specify a random chance, between 0.0 and 1.0, for when encountering the RPC enables tracking, and a length of time for leaving tracking enabled (disables the next tick, otherwise).Example (50% chance for 10 seconds): net.RPCDoSForcedRPCTracking=ServerAdmin,0.5,10
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of net.RPCDoSForcedRPCTracking is to provide a way to forcibly enable RPC (Remote Procedure Call) tracking for a specific RPC in Unreal Engine’s networking system. This setting is primarily used for debugging and performance monitoring purposes, particularly in the context of DoS (Denial of Service) detection.
This setting variable is part of Unreal Engine’s networking subsystem, specifically the RPC DoS detection module. It is primarily used in the Engine module, within the Net subfolder.
The value of this variable is set through the console or configuration files. It accepts a string value that can include up to three parameters: the name of the RPC to track, an optional random chance (between 0.0 and 1.0) for enabling tracking, and an optional duration for tracking.
This variable interacts with the RPC DoS detection system. It’s closely associated with CVarRPCDoSForcedRPCTracking, which is the actual console variable that stores and provides access to the setting’s value.
Developers should be aware of several things when using this variable:
- It’s primarily for debugging and should not be left enabled in production builds.
- Tracking only one RPC at a time is recommended for performance reasons.
- The random chance and duration parameters are optional but can be useful for more granular control.
- This setting can have performance implications, especially if used frequently or with a high chance of activation.
Best practices when using this variable include:
- Use it sparingly and only when investigating specific RPC-related issues.
- Be cautious about enabling it in production environments due to potential performance impact.
- When using the random chance parameter, consider the trade-off between capturing enough data and maintaining performance.
- Always disable the tracking when it’s no longer needed.
Regarding the associated variable CVarRPCDoSForcedRPCTracking: This is the actual console variable that stores and provides access to the net.RPCDoSForcedRPCTracking setting. It’s defined using TAutoConsoleVariable, which means it can be changed at runtime through console commands. The variable is used in the FRPCDoSDetection::InitConfig function to initialize the RPC tracking configuration. Developers should interact with this setting primarily through the console variable system rather than accessing CVarRPCDoSForcedRPCTracking directly in code.
#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:67
Scope: file
Source code excerpt:
TAutoConsoleVariable<FString> CVarRPCDoSForcedRPCTracking(
TEXT("net.RPCDoSForcedRPCTracking"), TEXT(""),
TEXT("Sets a single RPC that, when encountered, forcibly enables RPC tracking (limited to one RPC for performance). ")
TEXT("Can also specify a random chance, between 0.0 and 1.0, for when encountering the RPC enables tracking, ")
TEXT("and a length of time for leaving tracking enabled (disables the next tick, otherwise).")
TEXT("Example (50% chance for 10 seconds): net.RPCDoSForcedRPCTracking=ServerAdmin,0.5,10"));
#if RPC_DOS_SCOPE_DEBUG
#Associated Variable and Callsites
This variable is associated with another variable named CVarRPCDoSForcedRPCTracking
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Net/RPCDoSDetection.cpp:66
Scope: file
Source code excerpt:
TEXT("Overrides whether or not RPC DoS Detection kicking is enabled. 0 = disabled, 1 = enabled."));
TAutoConsoleVariable<FString> CVarRPCDoSForcedRPCTracking(
TEXT("net.RPCDoSForcedRPCTracking"), TEXT(""),
TEXT("Sets a single RPC that, when encountered, forcibly enables RPC tracking (limited to one RPC for performance). ")
TEXT("Can also specify a random chance, between 0.0 and 1.0, for when encountering the RPC enables tracking, ")
TEXT("and a length of time for leaving tracking enabled (disables the next tick, otherwise).")
TEXT("Example (50% chance for 10 seconds): net.RPCDoSForcedRPCTracking=ServerAdmin,0.5,10"));
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Net/RPCDoSDetection.cpp:488
Scope (from outer to inner):
file
function void FRPCDoSDetection::InitConfig
Source code excerpt:
}
FString RPCTrackingStr = CVarRPCDoSForcedRPCTracking.GetValueOnAnyThread();
if (!RPCTrackingStr.IsEmpty())
{
TArray<FString> RPCTrackingParms;
RPCTrackingStr.ParseIntoArray(RPCTrackingParms, TEXT(","));