spectatorbeacon.DelayReservationResponse

spectatorbeacon.DelayReservationResponse

#Overview

name: spectatorbeacon.DelayReservationResponse

This variable is created as a Console Variable (cvar).

It is referenced in 5 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of spectatorbeacon.DelayReservationResponse is to introduce a delay between receiving a reservation response and notifying the client in the spectator beacon system. This setting is primarily used for debugging and testing purposes in non-shipping builds of Unreal Engine.

This setting variable is relied upon by the Online Subsystem Utils plugin, specifically within the spectator beacon and party beacon systems. These systems are part of Unreal Engine’s networking and multiplayer infrastructure.

The value of this variable is set as a console variable, which means it can be adjusted at runtime through the console or configuration files. It’s defined using TAutoConsoleVariable, allowing for easy modification during development and testing.

There is an associated variable named CVarDelayReservationResponse, which serves the same purpose but for the party beacon system. Both variables share the same functionality but are used in different contexts.

Developers should be aware that:

  1. This variable is only active in non-shipping builds (#if !UE_BUILD_SHIPPING).
  2. The delay is measured in seconds and defaults to 0.0f (no delay).
  3. Using this variable can affect the responsiveness of the spectator and party systems, so it should be used cautiously.

Best practices when using this variable include:

  1. Only use it for debugging and testing purposes.
  2. Reset the value to 0.0f before building a shipping version.
  3. Be mindful of the impact on user experience when setting longer delays.
  4. Use in conjunction with logging to track the timing of reservation responses.

Regarding the associated variable CVarDelayReservationResponse: The purpose of this variable is similar to spectatorbeacon.DelayReservationResponse, but it’s used in the context of the party beacon system. It introduces a delay between receiving a reservation response and notifying the client in the party beacon system.

This variable is used in the Online Subsystem Utils plugin, specifically within the party beacon system. It follows the same patterns and best practices as the spectator beacon variable, including being only active in non-shipping builds and defaulting to 0.0f.

Developers should treat this variable with the same considerations as the spectator beacon variable, being aware of its impact on the party system’s responsiveness and using it primarily for debugging and testing purposes.

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

Scope (from outer to inner):

file
namespace    SpectatorBeaconConsoleVariables

Source code excerpt:

	/** Time to delay delegates firing a reservation request response */
	TAutoConsoleVariable<float> CVarDelayReservationResponse(
		TEXT("spectatorbeacon.DelayReservationResponse"),
		0.0f,
		TEXT("Delay time between received response and notification\n")
		TEXT("Time in secs"),
		ECVF_Default);

	/** Time to delay delegates firing a cancel reservation request response */

#Associated Variable and Callsites

This variable is associated with another variable named CVarDelayReservationResponse. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/PartyBeaconClient.cpp:9

Scope (from outer to inner):

file
namespace    BeaconConsoleVariables

Source code excerpt:


namespace BeaconConsoleVariables
{
#if !UE_BUILD_SHIPPING
	/** Time to delay delegates firing a reservation request response */
	TAutoConsoleVariable<float> CVarDelayReservationResponse(
		TEXT("beacon.DelayReservationResponse"),
		0.0f,
		TEXT("Delay time between received response and notification\n")
		TEXT("Time in secs"),
		ECVF_Default);

	/** Time to delay delegates firing a cancel reservation request response */
	TAutoConsoleVariable<float> CVarDelayCancellationResponse(
		TEXT("beacon.DelayCancellationResponse"),
		0.0f,
		TEXT("Delay time between received cancel response and notification\n")

#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/PartyBeaconClient.cpp:485

Scope (from outer to inner):

file
function     void APartyBeaconClient::ClientReservationResponse_Implementation

Source code excerpt:

void APartyBeaconClient::ClientReservationResponse_Implementation(EPartyReservationResult::Type ReservationResponse)
{
	if (!bCancelReservation)
	{
#if !UE_BUILD_SHIPPING
		const float Rate = BeaconConsoleVariables::CVarDelayReservationResponse.GetValueOnGameThread();
#else
		const float Rate = 0.0f;
#endif
		if (Rate > 0.0f)
		{
			UE_LOG(LogPartyBeacon, Verbose, TEXT("Party beacon response received %s, waiting %fs to notify"), EPartyReservationResult::ToString(ReservationResponse), Rate);

			FTimerDelegate TimerDelegate;
			TimerDelegate.BindLambda([this, ReservationResponse]()
			{
				ProcessReservationResponse(ReservationResponse);

#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/SpectatorBeaconClient.cpp:9

Scope (from outer to inner):

file
namespace    SpectatorBeaconConsoleVariables

Source code excerpt:


#if !UE_BUILD_SHIPPING
namespace SpectatorBeaconConsoleVariables
{
	/** Time to delay delegates firing a reservation request response */
	TAutoConsoleVariable<float> CVarDelayReservationResponse(
		TEXT("spectatorbeacon.DelayReservationResponse"),
		0.0f,
		TEXT("Delay time between received response and notification\n")
		TEXT("Time in secs"),
		ECVF_Default);

	/** Time to delay delegates firing a cancel reservation request response */
	TAutoConsoleVariable<float> CVarDelayCancellationResponse(
		TEXT("spectatorbeacon.DelayCancellationResponse"),
		0.0f,
		TEXT("Delay time between received cancel response and notification\n")

#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/SpectatorBeaconClient.cpp:294

Scope (from outer to inner):

file
function     void ASpectatorBeaconClient::ClientReservationResponse_Implementation

Source code excerpt:

void ASpectatorBeaconClient::ClientReservationResponse_Implementation(ESpectatorReservationResult::Type ReservationResponse)
{
	if (!bCancelReservation)
	{
#if !UE_BUILD_SHIPPING
		const float Rate = SpectatorBeaconConsoleVariables::CVarDelayReservationResponse.GetValueOnGameThread();
#else
		const float Rate = 0.0f;
#endif
		if (Rate > 0.0f)
		{
			UE_LOG(LogSpectatorBeacon, Verbose, TEXT("Spectator beacon response received %s, waiting %fs to notify"), ESpectatorReservationResult::ToString(ReservationResponse), Rate);

			FTimerDelegate TimerDelegate;
			TimerDelegate.BindLambda([this, ReservationResponse]()
			{
				ProcessReservationResponse(ReservationResponse);