Concert.Replication.LogReceivedObjects
Concert.Replication.LogReceivedObjects
#Overview
name: Concert.Replication.LogReceivedObjects
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enable Concert logging for received replicated objects.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of Concert.Replication.LogReceivedObjects is to enable logging for received replicated objects in the Concert system, which is part of Unreal Engine’s collaborative framework.
This setting variable is primarily used in the ConcertSyncCore module, which is part of the Concert plugin for Unreal Engine. The Concert system is designed for real-time collaboration in Unreal Engine projects.
Based on the callsites, this variable is used in the object replication system of Concert, specifically in the FObjectReplicationReceiver class. It’s used to control debug logging for received replicated objects.
The value of this variable is set as a console variable, which means it can be changed at runtime through the console or configuration files. It’s initialized to false by default, indicating that logging is disabled by default.
This variable interacts directly with its associated variable CVarLogReceivedObjects. They share the same value and purpose.
Developers must be aware that enabling this logging might impact performance, especially in scenarios with a large number of replicated objects. It should primarily be used for debugging and development purposes.
Best practices for using this variable include:
- Only enable it when debugging replication issues in the Concert system.
- Disable it in production builds to avoid unnecessary performance overhead.
- Use it in conjunction with other Concert debugging tools for comprehensive troubleshooting.
Regarding the associated variable CVarLogReceivedObjects:
The purpose of CVarLogReceivedObjects is the same as Concert.Replication.LogReceivedObjects. It’s the internal representation of the console variable in the C++ code.
This variable is used directly in the ConcertSyncCore module, specifically in the FObjectReplicationReceiver class.
The value of CVarLogReceivedObjects is set when the console variable Concert.Replication.LogReceivedObjects is set. They are essentially two representations of the same setting.
CVarLogReceivedObjects interacts directly with the logging system. When its value is true, it triggers logging of received object replication data.
Developers should be aware that this variable is checked on the game thread (GetValueOnGameThread()), which means it’s safe to change its value at runtime without causing thread safety issues.
Best practices for using CVarLogReceivedObjects include:
- Use it for temporary debugging in development builds.
- Consider wrapping calls to it with #if WITH_EDITOR or similar conditionals to ensure it’s not compiled into shipping builds.
- Be mindful of the performance impact when enabling this logging in scenarios with frequent object replication.
#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/ObjectReplicationReceiver.cpp:11
Scope (from outer to inner):
file
namespace UE::ConcertSyncCore
Source code excerpt:
namespace UE::ConcertSyncCore
{
static TAutoConsoleVariable<bool> CVarLogReceivedObjects(TEXT("Concert.Replication.LogReceivedObjects"), false, TEXT("Enable Concert logging for received replicated objects."));
FObjectReplicationReceiver::FObjectReplicationReceiver(TSharedRef<IConcertSession> Session, TSharedRef<FObjectReplicationCache> ReplicationCache)
: Session(MoveTemp(Session))
, ReplicationCache(MoveTemp(ReplicationCache))
{
Session->RegisterCustomEventHandler<FConcertReplication_BatchReplicationEvent>(this, &FObjectReplicationReceiver::HandleBatchReplicationEvent);
#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncTest/Source/ConcertSyncTest/Private/Replication/ReplicationAuthorityTests.cpp:64
Scope (from outer to inner):
file
namespace UE::ConcertSyncTests::Replication::Authority
function bool FRejectUnauthorativeClientTest::RunTest
Source code excerpt:
// 3. Test that server processed the data and rejected it.
IConsoleVariable* ConsoleVariable = IConsoleManager::Get().FindConsoleVariable(TEXT("Concert.Replication.LogReceivedObjects"));
if (ConsoleVariable)
{
// Hacky way of making sure that the server REALLY rejected the change...
// In the future we should add a callback that can be registered via the server instance.
AddExpectedError(TEXT("Rejected 1 object change"));
bool bValue;
#Associated Variable and Callsites
This variable is associated with another variable named CVarLogReceivedObjects
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncCore/Source/ConcertSyncCore/Private/Replication/Processing/ObjectReplicationReceiver.cpp:11
Scope (from outer to inner):
file
namespace UE::ConcertSyncCore
Source code excerpt:
namespace UE::ConcertSyncCore
{
static TAutoConsoleVariable<bool> CVarLogReceivedObjects(TEXT("Concert.Replication.LogReceivedObjects"), false, TEXT("Enable Concert logging for received replicated objects."));
FObjectReplicationReceiver::FObjectReplicationReceiver(TSharedRef<IConcertSession> Session, TSharedRef<FObjectReplicationCache> ReplicationCache)
: Session(MoveTemp(Session))
, ReplicationCache(MoveTemp(ReplicationCache))
{
Session->RegisterCustomEventHandler<FConcertReplication_BatchReplicationEvent>(this, &FObjectReplicationReceiver::HandleBatchReplicationEvent);
#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncCore/Source/ConcertSyncCore/Private/Replication/Processing/ObjectReplicationReceiver.cpp:53
Scope (from outer to inner):
file
namespace UE::ConcertSyncCore
function void FObjectReplicationReceiver::HandleBatchReplicationEvent
Source code excerpt:
}
if (CVarLogReceivedObjects.GetValueOnGameThread())
{
UE_LOG(LogConcert, Log, TEXT("Received %d streams with %d object changes from endpoint %s. Cached %d object changes with a total of %d cache usages."),
Event.Streams.Num(),
NumObjects,
*SessionContext.SourceEndpointId.ToString(),
NumOfAcceptedObjectChanges,