Concert.Replication.LogSentObjects

Concert.Replication.LogSentObjects

#Overview

name: Concert.Replication.LogSentObjects

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.LogSentObjects is to enable logging for sent replicated objects in the Concert system, which is part of Unreal Engine’s collaboration and multi-user editing features.

This setting variable is primarily used by the ConcertSyncCore module, which is part of the Concert plugin in Unreal Engine. The Concert system is designed to facilitate real-time collaboration and synchronization between multiple users working on the same project.

The value of this variable is set as a console variable using the TAutoConsoleVariable class. It is initialized with a default value of false, meaning logging is disabled by default.

The associated variable CVarLogSentObjects directly interacts with Concert.Replication.LogSentObjects. They share the same value and purpose.

Developers must be aware that enabling this variable will increase logging output, which may impact performance, especially in scenarios with a large number of replicated objects. It should primarily be used for debugging and troubleshooting purposes.

Best practices when using this variable include:

  1. Enable it only when necessary for debugging replication issues.
  2. Disable it in production or performance-critical scenarios.
  3. Be prepared to handle increased log output when enabled.
  4. Use it in conjunction with other Concert debugging tools for comprehensive troubleshooting.

Regarding the associated variable CVarLogSentObjects:

The purpose of CVarLogSentObjects is to provide a programmatic way to access and control the Concert.Replication.LogSentObjects setting within the C++ code.

This variable is used within the UE::ConcertSyncCore namespace, specifically in the ObjectReplicationSender.cpp file. It’s part of the object replication system in the Concert plugin.

The value of CVarLogSentObjects is set through the Console Variable system, which allows it to be changed at runtime.

CVarLogSentObjects interacts directly with the Console Variable system and is used to control logging behavior in the FObjectReplicationSender::ProcessObjects function.

Developers should be aware that this variable is used to conditionally log information about sent streams and objects. When enabled, it will output log messages detailing the number of streams and objects being sent to a specific endpoint.

Best practices for using CVarLogSentObjects include:

  1. Use GetValueOnGameThread() to safely access its value from game thread code.
  2. Consider the performance implications of frequent logging in performance-critical code paths.
  3. Use this variable in conjunction with other debugging tools when investigating replication issues in the Concert system.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncCore/Source/ConcertSyncCore/Private/Replication/Processing/ObjectReplicationSender.cpp:11

Scope (from outer to inner):

file
namespace    UE::ConcertSyncCore

Source code excerpt:

namespace UE::ConcertSyncCore
{
	static TAutoConsoleVariable<bool> CVarLogSentObjects(TEXT("Concert.Replication.LogSentObjects"), false, TEXT("Enable Concert logging for sent replicated objects."));
	
	FObjectReplicationSender::FObjectReplicationSender(
		const FGuid& TargetEndpointId,
		TSharedRef<IConcertSession> Session,
		TSharedRef<IReplicationDataSource> DataSource
		)

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncCore/Source/ConcertSyncCore/Private/Replication/Processing/ObjectReplicationSender.cpp:11

Scope (from outer to inner):

file
namespace    UE::ConcertSyncCore

Source code excerpt:

namespace UE::ConcertSyncCore
{
	static TAutoConsoleVariable<bool> CVarLogSentObjects(TEXT("Concert.Replication.LogSentObjects"), false, TEXT("Enable Concert logging for sent replicated objects."));
	
	FObjectReplicationSender::FObjectReplicationSender(
		const FGuid& TargetEndpointId,
		TSharedRef<IConcertSession> Session,
		TSharedRef<IReplicationDataSource> DataSource
		)

#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncCore/Source/ConcertSyncCore/Private/Replication/Processing/ObjectReplicationSender.cpp:30

Scope (from outer to inner):

file
namespace    UE::ConcertSyncCore
function     void FObjectReplicationSender::ProcessObjects

Source code excerpt:

		{
			const int32 NumObjects = Algo::TransformAccumulate(EventToSend.Streams, [](const FConcertReplication_StreamReplicationEvent& Event){ return Event.ReplicatedObjects.Num(); }, 0);
			UE_CLOG(CVarLogSentObjects.GetValueOnGameThread(), LogConcert, Log, TEXT("Sending %d streams with %d objects to %s"),
				EventToSend.Streams.Num(),
				NumObjects,
				*TargetEndpointId.ToString()
				);
			
			Session->SendCustomEvent(EventToSend, TargetEndpointId,