spectatorbeacon.DelayUpdateResponse
spectatorbeacon.DelayUpdateResponse
#Overview
name: spectatorbeacon.DelayUpdateResponse
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Delay time between received update response and notification\nTime in secs
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of spectatorbeacon.DelayUpdateResponse is to introduce a delay between receiving a reservation update response and notifying the client in the Spectator Beacon system. This setting is primarily used for debugging and testing purposes in the online subsystem of Unreal Engine 5.
This setting variable is relied upon by the Online Subsystem Utils plugin, specifically within the Spectator Beacon and Party Beacon modules. These beacons are used for managing spectator and party member connections in multiplayer games.
The value of this variable is set through the Unreal Engine console variable system. It can be modified at runtime using console commands or through configuration files.
The associated variable CVarDelayUpdateResponse interacts with spectatorbeacon.DelayUpdateResponse. They share the same value and purpose but are used in different contexts - one for spectator beacons and the other for party beacons.
Developers must be aware that this variable is only effective in non-shipping builds (#if !UE_BUILD_SHIPPING). In shipping builds, the delay is always set to 0.0f. This is important for ensuring that there are no unnecessary delays in production environments.
Best practices when using this variable include:
- Only use it for debugging and testing purposes.
- Be cautious when setting high delay values, as it may impact the responsiveness of the game.
- Remember to reset it to 0.0f before shipping the game.
- Use it in conjunction with logging (UE_LOG) to track and diagnose issues related to reservation updates.
Regarding the associated variable CVarDelayUpdateResponse:
The purpose of CVarDelayUpdateResponse is similar to spectatorbeacon.DelayUpdateResponse, but it’s used in the context of party beacons instead of spectator beacons. It introduces a delay between receiving a reservation update response and notifying the client in the Party Beacon system.
This variable is used by the Party Beacon module within the Online Subsystem Utils plugin. It’s particularly relevant in the APartyBeaconClient class.
The value is set through the Unreal Engine console variable system, just like spectatorbeacon.DelayUpdateResponse.
The same considerations apply: it’s only effective in non-shipping builds, should be used cautiously, and reset to 0.0f before shipping. It’s primarily a tool for debugging and testing party-related networking issues in multiplayer games.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/SpectatorBeaconClient.cpp:29
Scope (from outer to inner):
file
namespace SpectatorBeaconConsoleVariables
Source code excerpt:
/** Time to delay delegates firing a reservation update response */
TAutoConsoleVariable<float> CVarDelayUpdateResponse(
TEXT("spectatorbeacon.DelayUpdateResponse"),
0.0f,
TEXT("Delay time between received update response and notification\n")
TEXT("Time in secs"),
ECVF_Default);
/** Time to delay delegates firing a reservation full response */
#Associated Variable and Callsites
This variable is associated with another variable named CVarDelayUpdateResponse
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/PartyBeaconClient.cpp:25
Scope (from outer to inner):
file
namespace BeaconConsoleVariables
Source code excerpt:
TEXT("Delay time between received cancel response and notification\n")
TEXT("Time in secs"),
ECVF_Default);
/** Time to delay delegates firing a reservation update response */
TAutoConsoleVariable<float> CVarDelayUpdateResponse(
TEXT("beacon.DelayUpdateResponse"),
0.0f,
TEXT("Delay time between received update response and notification\n")
TEXT("Time in secs"),
ECVF_Default);
/** Time to delay delegates firing a reservation full response */
TAutoConsoleVariable<float> CVarDelayFullResponse(
TEXT("beacon.DelayFullResponse"),
0.0f,
TEXT("Delay time between received full response and notification\n")
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/PartyBeaconClient.cpp:578
Scope (from outer to inner):
file
function void APartyBeaconClient::ClientSendReservationUpdates_Implementation
Source code excerpt:
void APartyBeaconClient::ClientSendReservationUpdates_Implementation(int32 NumRemainingReservations)
{
if (!bCancelReservation)
{
#if !UE_BUILD_SHIPPING
const float Rate = BeaconConsoleVariables::CVarDelayUpdateResponse.GetValueOnGameThread();
#else
const float Rate = 0.0f;
#endif
if (Rate > 0.0f)
{
UE_LOG(LogPartyBeacon, Verbose, TEXT("Party beacon reservations remaining %d, waiting %fs to notify"), NumRemainingReservations, Rate);
FTimerDelegate TimerDelegate;
TimerDelegate.BindLambda([this, NumRemainingReservations]()
{
ProcessReservationUpdate(NumRemainingReservations);
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/SpectatorBeaconClient.cpp:25
Scope (from outer to inner):
file
namespace SpectatorBeaconConsoleVariables
Source code excerpt:
TEXT("Delay time between received cancel response and notification\n")
TEXT("Time in secs"),
ECVF_Default);
/** Time to delay delegates firing a reservation update response */
TAutoConsoleVariable<float> CVarDelayUpdateResponse(
TEXT("spectatorbeacon.DelayUpdateResponse"),
0.0f,
TEXT("Delay time between received update response and notification\n")
TEXT("Time in secs"),
ECVF_Default);
/** Time to delay delegates firing a reservation full response */
TAutoConsoleVariable<float> CVarDelayFullResponse(
TEXT("spectatorbeacon.DelayFullResponse"),
0.0f,
TEXT("Delay time between received full response and notification\n")
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/SpectatorBeaconClient.cpp:387
Scope (from outer to inner):
file
function void ASpectatorBeaconClient::ClientSendReservationUpdates_Implementation
Source code excerpt:
void ASpectatorBeaconClient::ClientSendReservationUpdates_Implementation(int32 NumRemainingReservations)
{
if (!bCancelReservation)
{
#if !UE_BUILD_SHIPPING
const float Rate = SpectatorBeaconConsoleVariables::CVarDelayUpdateResponse.GetValueOnGameThread();
#else
const float Rate = 0.0f;
#endif
if (Rate > 0.0f)
{
UE_LOG(LogSpectatorBeacon, Verbose, TEXT("Spectator beacon reservations remaining %d, waiting %fs to notify"), NumRemainingReservations, Rate);
FTimerDelegate TimerDelegate;
TimerDelegate.BindLambda([this, NumRemainingReservations]()
{
ProcessReservationUpdate(NumRemainingReservations);