UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FRPCDoSDetection Class Reference

#include <RPCDoSDetection.h>

+ Inheritance diagram for FRPCDoSDetection:

Public Member Functions

void Init (FName NetDriverName, TSharedPtr< FNetAnalyticsAggregator > &AnalyticsAggregator, FGetWorld &&InWorldFunc, FGetRPCDoSAddress &&InAddressFunc, FGetRPCDoSPlayerUID &&InPlayerUIDFunc, FRPCDoSKickPlayer &&InKickPlayerFunc)
 
void InitConfig (FName NetDriverName)
 
void UpdateSeverity (ERPCDoSSeverityUpdate Update, ERPCDoSEscalateReason Reason)
 
void PreTickDispatch (double TimeSeconds)
 
void PreReceivedPacket (double TimeSeconds)
 
ERPCNotifyResult NotifyReceivedRPC (FNetBitReader &Reader, TSet< FNetworkGUID > &UnmappedGuids, UObject *Object, UFunction *Function, FName FunctionName)
 
void LightweightReceivedRPC (UFunction *Function, FName FunctionName)
 
void PostReceivedRPC ()
 
void PostSequentialRPC (EPostSequentialRPCType SequenceType, double TimeSeconds, FRPCDoSCounters *RPCCounter, FRPCTrackingInfo *RPCTrackingInfo)
 
void PostReceivedPacket (double TimeSeconds)
 
void PostReceivedRPCPacket (double TimeSeconds)
 
void PostTickDispatch ()
 
void NotifyClose ()
 
bool ShouldMonitorReceivedRPC () const
 
bool IsRPCDoSDetectionEnabled () const
 
void SetAddressFunc (FGetRPCDoSAddress &&InAddressFunc)
 
void SetPlayerUIDFunc (FGetRPCDoSPlayerUID &&InPlayerUIDFunc)
 
void SetKickPlayerFunc (FRPCDoSKickPlayer &&InKickPlayerFunc)
 

Friends

struct FRPCDoSStateConfig
 

Additional Inherited Members

- Protected Member Functions inherited from FRPCDoSState
virtual ~FRPCDoSState ()
 
virtual ENGINE_API void ApplyImpliedValues ()
 
bool HasHitQuota_Count (const FRPCDoSCounters(&PerPeriodHistory)[16], FRPCDoSCounters &InFrameCounter) const
 
bool HasHitQuota_Time (const FRPCDoSCounters(&PerPeriodHistory)[16], FRPCDoSCounters &InFrameCounter) const
 
- Protected Attributes inherited from FRPCDoSState
bool bLogEscalate = false
 
bool bSendEscalateAnalytics = false
 
bool bKickPlayer = false
 
bool bTrackRecentRPCs = false
 
int16 EscalateQuotaRPCsPerFrame = -1
 
int16 EscalateTimeQuotaMSPerFrame = -1
 
int16 EscalateQuotaRPCsPerPeriod = -1
 
int16 EscalateTimeQuotaMSPerPeriod = -1
 
int8 EscalateQuotaTimePeriod = -1
 
int8 EscalationCountTolerance = 1
 
int16 EscalationTimeToleranceMS = -1
 
int16 RPCRepeatLimitPerPeriod = -1
 
int16 RPCRepeatLimitMSPerPeriod = -1
 
int8 RPCRepeatLimitTimePeriod = -1
 
int16 CooloffTime = -1
 
int16 AutoEscalateTime = -1
 
double EscalateTimeQuotaSecsPerFrame = 0.0
 
double EscalateTimeQuotaSecsPerPeriod = 0.0
 
double RPCRepeatLimitSecsPerPeriod = 0.0
 
double EscalationTimeToleranceSeconds = 0.0
 

Detailed Description

RPC DoS detection

Implements DoS detection for NetConnection RPC's, using an escalating series of detection states depending on the severity of the DoS, to prevent false positives and minimize any performance impact.

RPC's are profiled based on count and execution time, with careful implementation of tracking to balance lookup speed, memory usage, timing, and analytics tracking.

Member Function Documentation

◆ Init()

void FRPCDoSDetection::Init ( FName  NetDriverName,
TSharedPtr< FNetAnalyticsAggregator > &  AnalyticsAggregator,
FGetWorld &&  InWorldFunc,
FGetRPCDoSAddress &&  InAddressFunc,
FGetRPCDoSPlayerUID &&  InPlayerUIDFunc,
FRPCDoSKickPlayer &&  InKickPlayerFunc 
)

Initialize RPC DoS Detection, inputting callbacks for retrieving external information necessary for analytics.

Parameters
NetDriverNameThe name of the NetDriver which RPC DoS Detection belongs to (e.g. GameNetDriver)
AnalyticsAggregatorReference to the NetDriver analytics aggregator
InWorldFuncCallback for getting the current NetConnection World.
InAddressFuncCallback for getting the current NetConnection address.
InPlayerUIDFuncCallback for getting the current NetConnection player UID.
InKickPlayerFuncCallback for kicking the player after a bad enough RPC DoS.

RPC DoS Detection

◆ InitConfig()

void FRPCDoSDetection::InitConfig ( FName  NetDriverName)

Initializes configuration settings for RPC DoS Detection - with support for hot reloading

Parameters
NetDriverNameThe name of the NetDriver which RPC DoS Detection belongs to (e.g. GameNetDriver)

◆ IsRPCDoSDetectionEnabled()

bool FRPCDoSDetection::IsRPCDoSDetectionEnabled ( ) const
inline

Whether or not RPC DoS Detection is enabled

◆ LightweightReceivedRPC()

void FRPCDoSDetection::LightweightReceivedRPC ( UFunction Function,
FName  FunctionName 
)
inline

If RPC monitoring is disabled, does extremely lightweight tracking of RPC calls, for monitoring tracking triggers, and to allow a chance for deducing full RPC tracking information if monitoring is enabled while receiving (so that e.g. if an RPC DoS attack enables monitoring, information on the RPC responsible can be recovered).

Parameters
FunctionThe UFunction representing the RPC
FunctionNameThe cached name of the function

◆ NotifyClose()

void FRPCDoSDetection::NotifyClose ( )

Triggered upon NetConnection Close (for committing analytics)

◆ NotifyReceivedRPC()

ERPCNotifyResult FRPCDoSDetection::NotifyReceivedRPC ( FNetBitReader Reader,
TSet< FNetworkGUID > &  UnmappedGuids,
UObject Object,
UFunction Function,
FName  FunctionName 
)
inline

If RPC monitoring is enabled, provides a notification for every RPC that is received, with the ability to block it.

Parameters
ReaderThe net bit reader containing the packet data, in case parsing of RPC parameters is desired
UnmappedGuidsReference to the set of unmapped Guid's - in case it's necessary for parsing RPC parameters
ObjectThe UObject the RPC will be called on
FunctionThe UFunction representing the RPC
FunctionNameThe cached name of the function
Returns
Whether or not to block the RPC

◆ PostReceivedPacket()

void FRPCDoSDetection::PostReceivedPacket ( double  TimeSeconds)
inline

Called after the current NetConnection receives a packet.

Parameters
TimeSecondsCached/approximate timestamp, to save grabbing a new timestamp

◆ PostReceivedRPC()

void FRPCDoSDetection::PostReceivedRPC ( )
inline

Called after the current NetConnection receives an RPC.

◆ PostReceivedRPCPacket()

void FRPCDoSDetection::PostReceivedRPCPacket ( double  TimeSeconds)

Called after the current NetConnection receives a packet, when RPC DoS Detection is active and the packet contains an RPC. NOTE: Timing is approximate - may include multiple-RPC and non-RPC packet processing time - but low cost

Parameters
TimeSecondsCached/approximate timestamp, to save grabbing a new timestamp

◆ PostSequentialRPC()

void FRPCDoSDetection::PostSequentialRPC ( EPostSequentialRPCType  SequenceType,
double  TimeSeconds,
FRPCDoSCounters RPCCounter,
FRPCTrackingInfo RPCTrackingInfo 
)

Called after the same RPC was received once or multiple times sequentially, for optimal timing

Parameters
SequenceTypeThe type of sequential RPC call (a sequence stopping mid-packet, or at the end of the packet)
TimeSecondsThe current time, in seconds (may be approximate)
RPCCounterCached pointer to the currently active counter, for this RPC
RPCTrackingInfoCached pointer to the tracking info, for this RPC

◆ PostTickDispatch()

void FRPCDoSDetection::PostTickDispatch ( )

Called after the packet-loop TickDispatch

◆ PreReceivedPacket()

void FRPCDoSDetection::PreReceivedPacket ( double  TimeSeconds)
inline

Called prior to the current NetConnection receiving a packet.

Parameters
TimeSecondsCached/approximate timestamp, to save grabbing a new timestamp

◆ PreTickDispatch()

void FRPCDoSDetection::PreTickDispatch ( double  TimeSeconds)

Called prior to the packet-loop TickDispatch

Parameters
TimeSecondsCached/approximate timestamp, to save grabbing a new timestamp

◆ SetAddressFunc()

void FRPCDoSDetection::SetAddressFunc ( FGetRPCDoSAddress &&  InAddressFunc)

Overrides the current AddressFunc

Parameters
InAddressFuncThe new AddressFunc

◆ SetKickPlayerFunc()

void FRPCDoSDetection::SetKickPlayerFunc ( FRPCDoSKickPlayer &&  InKickPlayerFunc)

Overrides the current KickPlayerFunc

Parameters
InKickPlayerFuncThe new KickPlayerFunc

◆ SetPlayerUIDFunc()

void FRPCDoSDetection::SetPlayerUIDFunc ( FGetRPCDoSPlayerUID &&  InPlayerUIDFunc)

Overrides the current PlayerUIDFunc

Parameters
InPlayerUIDFuncThe new PlayerUIDFunc

◆ ShouldMonitorReceivedRPC()

bool FRPCDoSDetection::ShouldMonitorReceivedRPC ( ) const
inline

Whether or not monitoring of received RPC's (i.e. calling of NotifyReceivedRPC) should be performed

Returns
Whether or not to monitor received RPC's.

◆ UpdateSeverity()

void FRPCDoSDetection::UpdateSeverity ( ERPCDoSSeverityUpdate  Update,
ERPCDoSEscalateReason  Reason 
)
inline

Updates the current RPC DoS detection severity state

Parameters
UpdateWhether or not we are escalating or de-escalating the severity state
ReasonThe reason for the escalation change

Friends And Related Symbol Documentation

◆ FRPCDoSStateConfig


The documentation for this class was generated from the following files: