bKickPlayer

bKickPlayer

#Overview

name: bKickPlayer

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

It is referenced in 5 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bKickPlayer is to control whether a player should be kicked from the game when they trigger a certain severity level in the RPC (Remote Procedure Call) Denial of Service (DoS) detection system.

This setting variable is primarily used within the Unreal Engine’s networking subsystem, specifically in the RPC DoS detection module. It’s part of the Engine’s runtime security features to prevent abuse of the networking system.

The value of this variable is set in the FRPCDoSStateConfig structure, which is likely defined in a configuration file or set programmatically during the game’s initialization.

bKickPlayer interacts with other variables in the RPC DoS detection system, such as bLogEscalate, bSendEscalateAnalytics, and various quota-related variables. It’s also affected by the CVarAllowRPCDoSDetectionKicking console variable, which can override the kicking behavior.

Developers must be aware that:

  1. Setting this to true can result in players being automatically kicked from the game if they trigger the DoS detection.
  2. It’s part of a multi-level severity system, where different actions can be taken at different severity levels.
  3. There’s a global override (CVarAllowRPCDoSDetectionKicking) that can prevent kicking even if this variable is set to true.

Best practices when using this variable include:

  1. Carefully consider the implications of automatically kicking players, as it might affect legitimate players in some edge cases.
  2. Use it in conjunction with other DoS prevention measures and logging for a comprehensive security approach.
  3. Test thoroughly with various network conditions to ensure it’s not too sensitive.
  4. Consider implementing a warning system before kicking to give players a chance to rectify their behavior.
  5. Regularly review and adjust the DoS detection settings based on real-world data and player feedback.

#Setting Variables

#References In INI files

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

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

Scope (from outer to inner):

file
function     void FRPCDoSStateConfig::ApplyState

Source code excerpt:

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

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

Scope (from outer to inner):

file
function     void FRPCDoSDetection::UpdateSeverity_Private

Source code excerpt:

	const bool bPreventKick = CVarAllowRPCDoSDetectionKicking.GetValueOnAnyThread() == 0;

	if (DetectionSeverity[NewStateIdx].bKickPlayer && bPreventKick)
	{
		NewStateIdx = ActiveState;
	}

	if (NewStateIdx != ActiveState)
	{

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

Scope (from outer to inner):

file
function     void FRPCDoSDetection::UpdateSeverity_Private

Source code excerpt:

				NewStateIdx = FMath::Clamp(ActiveState + 1, 0, DetectionSeverity.Num()-1);

				if (DetectionSeverity[NewStateIdx].bKickPlayer && bPreventKick)
				{
					NewStateIdx = ActiveState;
					break;
				}

				if (NewStateIdx == ActiveState)

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

Scope (from outer to inner):

file
function     void FRPCDoSDetection::UpdateSeverity_Private

Source code excerpt:

			}

			if (bKickPlayer && KickPlayerFunc)
			{
				UE_LOG(LogNet, Warning, TEXT("RPC DoS detection kicking player IP '%s', UID '%s'."), *GetPlayerAddress(),
						*GetPlayerUID());

				KickPlayerFunc();
			}

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

Scope: file

Source code excerpt:

	/** Whether or not to kick the player when they escalate to this state */
	UPROPERTY(config)
	bool bKickPlayer				= false;

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