spectatorbeacon.DelayFullResponse

spectatorbeacon.DelayFullResponse

#Overview

name: spectatorbeacon.DelayFullResponse

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.DelayFullResponse is to introduce a delay between receiving a “reservation full” response and notifying the client in the spectator beacon system. This setting is primarily used in the online subsystem for managing spectator connections in multiplayer games.

This setting variable is relied upon by the OnlineSubsystemUtils module, specifically within the SpectatorBeaconClient and PartyBeaconClient classes. These classes 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. It’s defined using TAutoConsoleVariable, allowing for easy modification during development or debugging.

The associated variable CVarDelayFullResponse interacts with spectatorbeacon.DelayFullResponse. They share the same functionality but are used in different contexts - one for spectator beacons and the other for party beacons.

Developers must be aware that this variable only takes effect in non-shipping builds (#if !UE_BUILD_SHIPPING). In shipping builds, the delay is always set to 0.0f.

Best practices when using this variable include:

  1. Using it primarily for debugging and testing purposes.
  2. Being cautious about setting large delay values in production, as it could negatively impact user experience.
  3. Considering the implications on both spectator and party systems when modifying the value.

Regarding the associated variable CVarDelayFullResponse:

The purpose of CVarDelayFullResponse is similar to spectatorbeacon.DelayFullResponse, but it’s used in the context of party beacons instead of spectator beacons. It introduces a delay between receiving a “reservation full” response and notifying the client in the party beacon system.

This variable is used in the PartyBeaconClient class within the OnlineSubsystemUtils module. It affects how quickly clients are notified when a party reservation is full.

Like spectatorbeacon.DelayFullResponse, CVarDelayFullResponse is set as a console variable and can be adjusted at runtime. It’s also only effective in non-shipping builds.

The same considerations and best practices apply to CVarDelayFullResponse as to spectatorbeacon.DelayFullResponse. Developers should use it judiciously, primarily for debugging and testing, and be aware of its potential impact on user experience in multiplayer scenarios.

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

Scope (from outer to inner):

file
namespace    SpectatorBeaconConsoleVariables

Source code excerpt:

	/** 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")
		TEXT("Time in secs"),
		ECVF_Default);
}
#endif

#Associated Variable and Callsites

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

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

Scope (from outer to inner):

file
namespace    BeaconConsoleVariables

Source code excerpt:

		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")
		TEXT("Time in secs"),
		ECVF_Default);
#endif

	/** Whether to restrict party reservation RPCs to require that the initiator is the party leader. */
	TAutoConsoleVariable<bool> CVarRequireInitiatorIsPartyLeader(
		TEXT("beacon.RequireInitiatorIsPartyLeader"),
		true,

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

Scope (from outer to inner):

file
function     void APartyBeaconClient::ClientSendReservationFull_Implementation

Source code excerpt:

void APartyBeaconClient::ClientSendReservationFull_Implementation()
{
	if (!bCancelReservation)
	{
#if !UE_BUILD_SHIPPING
		const float Rate = BeaconConsoleVariables::CVarDelayFullResponse.GetValueOnGameThread();
#else
		const float Rate = 0.0f;
#endif
		if (Rate > 0.0f)
		{
			UE_LOG(LogPartyBeacon, Verbose, TEXT("Party beacon reservations full, waiting %fs to notify"), Rate);

			FTimerDelegate TimerDelegate;
			TimerDelegate.BindLambda([this]()
			{
				ProcessReservationFull();

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

Scope (from outer to inner):

file
namespace    SpectatorBeaconConsoleVariables

Source code excerpt:

		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")
		TEXT("Time in secs"),
		ECVF_Default);
}
#endif

/** Max time to wait for a response from the server for CancelReservation */
#define CANCEL_FAILSAFE 5.0f

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

Scope (from outer to inner):

file
function     void ASpectatorBeaconClient::ClientSendReservationFull_Implementation

Source code excerpt:

void ASpectatorBeaconClient::ClientSendReservationFull_Implementation()
{
	if (!bCancelReservation)
	{
#if !UE_BUILD_SHIPPING
		const float Rate = SpectatorBeaconConsoleVariables::CVarDelayFullResponse.GetValueOnGameThread();
#else
		const float Rate = 0.0f;
#endif
		if (Rate > 0.0f)
		{
			UE_LOG(LogSpectatorBeacon, Verbose, TEXT("Spectator beacon reservations full, waiting %fs to notify"), Rate);

			FTimerDelegate TimerDelegate;
			TimerDelegate.BindLambda([this]()
			{
				ProcessReservationFull();