beacon.DelayFinishHandshake
beacon.DelayFinishHandshake
#Overview
name: beacon.DelayFinishHandshake
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Delay time before finishing handshake by calling client RPC\nTime in seconds. A value of 0 means no delay, and a negative value means never call it.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of beacon.DelayFinishHandshake is to introduce a delay before finishing the handshake process in the online beacon system of Unreal Engine. This setting is primarily used for network-related functionality, specifically in the Online Subsystem.
This setting variable is utilized by the Online Subsystem Utils plugin, which is part of Unreal Engine’s networking infrastructure. It’s specifically used within the OnlineBeaconHost module, which handles beacon-based networking.
The value of this variable is set as a console variable, which means it can be modified at runtime through the console or configuration files. It’s defined with a default value of 0.0f, indicating no delay by default.
The beacon.DelayFinishHandshake variable interacts with another console variable named CVarDelayFinishHandshakeType. While beacon.DelayFinishHandshake determines the delay duration, CVarDelayFinishHandshakeType specifies which beacon types this delay should apply to.
Developers should be aware that this variable affects the timing of the handshake completion in the beacon system. A value of 0 means no delay, while a negative value means the handshake will never be completed automatically.
Best practices when using this variable include:
- Use it for debugging or testing network behavior, not in production builds unless absolutely necessary.
- Be cautious when setting non-zero values, as it could impact the responsiveness of your network connections.
- Always use in conjunction with CVarDelayFinishHandshakeType to target specific beacon types if needed.
Regarding the associated variable CVarDelayFinishHandshake:
The purpose of CVarDelayFinishHandshake is to provide a programmatic interface to the beacon.DelayFinishHandshake console variable within the C++ code.
It’s used in the OnlineBeaconHost module of the Online Subsystem Utils plugin.
The value of this variable is set when the console variable beacon.DelayFinishHandshake is modified.
CVarDelayFinishHandshake interacts directly with the beacon.DelayFinishHandshake console variable and is used in conjunction with CVarDelayFinishHandshakeType.
Developers should be aware that this is the actual variable they would interact with in C++ code when they need to read or modify the delay value.
Best practices for using CVarDelayFinishHandshake include:
- Use GetValueOnGameThread() to safely read its value from game code.
- Don’t modify its value directly; instead, change the beacon.DelayFinishHandshake console variable.
- Always consider the implications of introducing delays in the handshake process when using this variable.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/OnlineBeaconHost.cpp:18
Scope (from outer to inner):
file
namespace BeaconConsoleVariables
Source code excerpt:
{
TAutoConsoleVariable<float> CVarDelayFinishHandshake(
TEXT("beacon.DelayFinishHandshake"),
0.0f,
TEXT("Delay time before finishing handshake by calling client RPC\n")
TEXT("Time in seconds. A value of 0 means no delay, and a negative value means never call it."),
ECVF_Default);
TAutoConsoleVariable<FString> CVarDelayFinishHandshakeType(
#Associated Variable and Callsites
This variable is associated with another variable named CVarDelayFinishHandshake
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/OnlineBeaconHost.cpp:17
Scope (from outer to inner):
file
namespace BeaconConsoleVariables
Source code excerpt:
namespace BeaconConsoleVariables
{
TAutoConsoleVariable<float> CVarDelayFinishHandshake(
TEXT("beacon.DelayFinishHandshake"),
0.0f,
TEXT("Delay time before finishing handshake by calling client RPC\n")
TEXT("Time in seconds. A value of 0 means no delay, and a negative value means never call it."),
ECVF_Default);
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/OnlineBeaconHost.cpp:499
Scope (from outer to inner):
file
function bool AOnlineBeaconHost::HandleControlMessage
Source code excerpt:
const bool bDelayAllowedForBeaconType = false;
#else
const float Delay = BeaconConsoleVariables::CVarDelayFinishHandshake.GetValueOnGameThread();
const FString DelayBeaconType = BeaconConsoleVariables::CVarDelayFinishHandshakeType.GetValueOnGameThread();
const bool bDelayAllowedForBeaconType = DelayBeaconType.IsEmpty() || DelayBeaconType == BeaconType;
#endif
if (Delay == 0.0f || !bDelayAllowedForBeaconType)
{
FinishHandshake(Connection, MoveTemp(BeaconType));