beacon.DelayFinishHandshakeBeaconType
beacon.DelayFinishHandshakeBeaconType
#Overview
name: beacon.DelayFinishHandshakeBeaconType
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
The type of beacon to apply the handshake delay to.\nLeave blank for all.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of beacon.DelayFinishHandshakeBeaconType is to specify the type of beacon to which a handshake delay should be applied in the Unreal Engine’s online subsystem. This setting is part of the networking and multiplayer functionality, specifically related to the beacon system used for client-server communication.
This setting variable is primarily used in the OnlineSubsystemUtils plugin, which is part of Unreal Engine’s online functionality. It’s specifically utilized within the AOnlineBeaconHost class, which manages the host-side operations of online beacons.
The value of this variable is set through a console variable (CVarDelayFinishHandshakeType) using the TAutoConsoleVariable template. It’s initialized with an empty string as the default value.
This variable interacts closely with another console variable, CVarDelayFinishHandshake (not shown in the provided code), which likely sets the actual delay time. Together, these variables control the delayed handshake mechanism for beacons.
Developers must be aware that:
- This variable accepts a string value representing the beacon type.
- An empty string means the delay will be applied to all beacon types.
- The variable is used in conjunction with a delay value to control the timing of beacon handshakes.
Best practices when using this variable include:
- Use it judiciously, as delaying handshakes can affect network responsiveness.
- Ensure the beacon type specified matches the intended targets exactly.
- Consider leaving it blank (default) unless you have a specific need to delay handshakes for only certain beacon types.
Regarding the associated variable CVarDelayFinishHandshakeType:
The purpose of CVarDelayFinishHandshakeType is to provide a programmatic interface to the beacon.DelayFinishHandshakeBeaconType setting within the C++ code.
This variable is used directly in the AOnlineBeaconHost::HandleControlMessage function to determine whether a delay should be applied to a specific beacon type during the handshake process.
The value of CVarDelayFinishHandshakeType is set through the TAutoConsoleVariable template, which links it to the console variable system.
It interacts with the delay value (likely set by CVarDelayFinishHandshake) to control the timing of the FinishHandshake function call.
Developers should be aware that:
- The value of this variable is retrieved using the GetValueOnGameThread() method.
- An empty string value means the delay will be applied to all beacon types.
Best practices for using CVarDelayFinishHandshakeType include:
- Access its value only from the game thread to avoid potential race conditions.
- Use it in conjunction with the delay value to implement controlled handshake timing.
- Consider the performance implications of frequently checking this value in performance-critical code paths.
#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:25
Scope (from outer to inner):
file
namespace BeaconConsoleVariables
Source code excerpt:
TAutoConsoleVariable<FString> CVarDelayFinishHandshakeType(
TEXT("beacon.DelayFinishHandshakeBeaconType"),
TEXT(""),
TEXT("The type of beacon to apply the handshake delay to.\n")
TEXT("Leave blank for all."),
ECVF_Default);
}
#endif
#Associated Variable and Callsites
This variable is associated with another variable named CVarDelayFinishHandshakeType
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/OnlineBeaconHost.cpp:24
Scope (from outer to inner):
file
namespace BeaconConsoleVariables
Source code excerpt:
ECVF_Default);
TAutoConsoleVariable<FString> CVarDelayFinishHandshakeType(
TEXT("beacon.DelayFinishHandshakeBeaconType"),
TEXT(""),
TEXT("The type of beacon to apply the handshake delay to.\n")
TEXT("Leave blank for all."),
ECVF_Default);
}
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/OnlineBeaconHost.cpp:500
Scope (from outer to inner):
file
function bool AOnlineBeaconHost::HandleControlMessage
Source code excerpt:
#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));
}