Concert.Replication.LogAuthorityRequestsAndResponsesOnClient

Concert.Replication.LogAuthorityRequestsAndResponsesOnClient

#Overview

name: Concert.Replication.LogAuthorityRequestsAndResponsesOnClient

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

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of Concert.Replication.LogAuthorityRequestsAndResponsesOnClient is to control logging of authority changes in the Concert replication system. This setting variable is part of the Concert plugin, which is a collaboration tool for Unreal Engine.

This setting variable is used in the ConcertSyncClient module, specifically within the Replication subsystem. It is primarily used in the ReplicationManagerState_Connected class, which handles replication management when a client is connected to a Concert session.

The value of this variable is set as a console variable (CVar) with a default value of false. It can be changed at runtime through the console or configuration files.

The associated variable CVarLogAuthorityRequestsAndResponsesOnClient directly interacts with it. This variable is used to actually control the logging behavior in the code.

Developers must be aware that enabling this variable will increase logging output, which may impact performance, especially in production environments. It should primarily be used for debugging and troubleshooting authority-related issues in the Concert replication system.

Best practices for using this variable include:

  1. Enabling it only when investigating authority-related issues in the Concert replication system.
  2. Disabling it in production builds to avoid unnecessary performance overhead.
  3. Using it in conjunction with other Concert replication logging variables for a comprehensive view of the replication process.

Regarding the associated variable CVarLogAuthorityRequestsAndResponsesOnClient:

The purpose of CVarLogAuthorityRequestsAndResponsesOnClient is to provide a runtime-configurable way to enable or disable logging of authority requests and responses in the Concert replication system.

This variable is used directly in the code to conditionally log network messages related to authority changes. It’s referenced in the RequestAuthorityChange function of the FReplicationManagerState_Connected class.

The value of this variable is set through the TAutoConsoleVariable declaration, with an initial value of false.

This variable directly controls the behavior defined by the Concert.Replication.LogAuthorityRequestsAndResponsesOnClient setting.

Developers should be aware that this variable affects runtime behavior and can be changed during execution, allowing for dynamic control of logging.

Best practices for using this variable include:

  1. Using it in development and testing environments to debug authority-related issues.
  2. Ensuring it’s disabled by default in shipping builds to prevent unnecessary logging.
  3. Combining it with other logging mechanisms to get a complete picture of the replication process when troubleshooting.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncClient/Source/ConcertSyncClient/Private/Replication/Manager/ReplicationManagerState_Connected.cpp:49

Scope (from outer to inner):

file
namespace    UE::ConcertSyncClient::Replication

Source code excerpt:

		);
	TAutoConsoleVariable<bool> CVarLogAuthorityRequestsAndResponsesOnClient(
		TEXT("Concert.Replication.LogAuthorityRequestsAndResponsesOnClient"),
		false,
		TEXT("Whether to log changes to authority.")
		);

	namespace Private
	{

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncClient/Source/ConcertSyncClient/Private/Replication/Manager/ReplicationManagerState_Connected.cpp:48

Scope (from outer to inner):

file
namespace    UE::ConcertSyncClient::Replication

Source code excerpt:

		TEXT("Whether to log changes to streams.")
		);
	TAutoConsoleVariable<bool> CVarLogAuthorityRequestsAndResponsesOnClient(
		TEXT("Concert.Replication.LogAuthorityRequestsAndResponsesOnClient"),
		false,
		TEXT("Whether to log changes to authority.")
		);

	namespace Private

#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncClient/Source/ConcertSyncClient/Private/Replication/Manager/ReplicationManagerState_Connected.cpp:146

Scope (from outer to inner):

file
namespace    UE::ConcertSyncClient::Replication
function     TFuture<FConcertReplication_ChangeAuthority_Response> FReplicationManagerState_Connected::RequestAuthorityChange

Source code excerpt:

		HandleReleasingReplicatedObjects(Args);

		Private::LogNetworkMessage(CVarLogAuthorityRequestsAndResponsesOnClient, Args);
		return LiveSession->SendCustomRequest<FConcertReplication_ChangeAuthority_Request, FConcertReplication_ChangeAuthority_Response>(Args, LiveSession->GetSessionServerEndpointId())
			.Next([WeakThis = TWeakPtr<FReplicationManagerState_Connected>(SharedThis(this)), Args](FConcertReplication_ChangeAuthority_Response&& Response) mutable
			{
				Private::LogNetworkMessage(CVarLogAuthorityRequestsAndResponsesOnClient, Response);
				
				if (const TSharedPtr<FReplicationManagerState_Connected> ThisPin = WeakThis.Pin()
					; ThisPin && Response.ErrorCode == EReplicationResponseErrorCode::Handled)
				{
					ThisPin->UpdateReplicatedObjectsAfterAuthorityChange(MoveTemp(Args), Response);
				}