Concert.Replication.SimulateAuthorityRejection
Concert.Replication.SimulateAuthorityRejection
#Overview
name: Concert.Replication.SimulateAuthorityRejection
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether the client should pretend that authority change requests were rejected.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of Concert.Replication.SimulateAuthorityRejection is to simulate a scenario where authority change requests in the Concert replication system are rejected. This setting is primarily used for testing and debugging purposes within the Unreal Engine’s Concert plugin, which is part of the collaboration and multi-user editing features.
This setting variable is utilized by the ConcertSyncClient module, which is part of the Concert plugin system in Unreal Engine. Specifically, it’s used in the replication management component of the Concert system.
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 CVarSimulateAuthorityRejection directly interacts with this setting. It’s the C++ representation of the console variable and is used to access the current value of the setting within the code.
Developers must be aware that enabling this variable will cause all authority change requests to be rejected, which can significantly impact the behavior of multi-user editing sessions. It should only be used for testing and debugging purposes, not in production environments.
Best practices when using this variable include:
- Only enable it temporarily for specific testing scenarios.
- Ensure it’s disabled in production builds.
- Use it in conjunction with other debugging tools to diagnose issues related to authority changes in Concert sessions.
- Document its usage clearly when it’s enabled for testing to prevent confusion among team members.
Regarding the associated variable CVarSimulateAuthorityRejection:
The purpose of CVarSimulateAuthorityRejection is to provide programmatic access to the Concert.Replication.SimulateAuthorityRejection setting within the C++ code.
It’s used within the ConcertSyncClient module, specifically in the ReplicationManagerState_Connected class, which is part of the replication management system.
The value of this variable is set when the console variable is initialized, and it reflects any changes made to the console variable at runtime.
This variable directly interacts with the logic that handles authority change requests in the Concert replication system. When its value is true, it causes the RequestAuthorityChange function to reject all authority change requests.
Developers should be aware that this variable directly affects the behavior of the replication system and should be used cautiously. It’s primarily intended for testing and debugging scenarios.
Best practices for using this variable include:
- Use GetValueOnGameThread() to access its current value, as shown in the provided code.
- Consider adding additional logging or debugging information when this variable is set to true to help diagnose issues.
- Ensure that any code paths that depend on this variable have appropriate fallback behaviors for when authority changes are being simulated as rejected.
#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:38
Scope (from outer to inner):
file
namespace UE::ConcertSyncClient::Replication
Source code excerpt:
TAutoConsoleVariable<bool> CVarSimulateAuthorityRejection(
TEXT("Concert.Replication.SimulateAuthorityRejection"),
false,
TEXT("Whether the client should pretend that authority change requests were rejected.")
);
TAutoConsoleVariable<bool> CVarLogStreamRequestsAndResponsesOnClient(
TEXT("Concert.Replication.LogStreamRequestsAndResponsesOnClient"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarSimulateAuthorityRejection
. 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:37
Scope (from outer to inner):
file
namespace UE::ConcertSyncClient::Replication
Source code excerpt:
);
TAutoConsoleVariable<bool> CVarSimulateAuthorityRejection(
TEXT("Concert.Replication.SimulateAuthorityRejection"),
false,
TEXT("Whether the client should pretend that authority change requests were rejected.")
);
TAutoConsoleVariable<bool> CVarLogStreamRequestsAndResponsesOnClient(
#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncClient/Source/ConcertSyncClient/Private/Replication/Manager/ReplicationManagerState_Connected.cpp:137
Scope (from outer to inner):
file
namespace UE::ConcertSyncClient::Replication
function TFuture<FConcertReplication_ChangeAuthority_Response> FReplicationManagerState_Connected::RequestAuthorityChange
Source code excerpt:
return MakeFulfilledPromise<FConcertReplication_ChangeAuthority_Response>(FConcertReplication_ChangeAuthority_Response{ EReplicationResponseErrorCode::Timeout }).GetFuture();
}
if (CVarSimulateAuthorityRejection.GetValueOnGameThread())
{
return RejectAll(MoveTemp(Args));
}
// Stop replicating removed objects right now: the server will remove authority after processing this request.
// At that point, it will log errors for receiving replication data from a client without authority.