Concert.Replication.SimulateStreamChangeTimeouts
Concert.Replication.SimulateStreamChangeTimeouts
#Overview
name: Concert.Replication.SimulateStreamChangeTimeouts
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether the client should pretend that stream change requests timed out instead of sending to the server.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of Concert.Replication.SimulateStreamChangeTimeouts is to simulate timeouts for stream change requests in the Concert replication system. This setting variable is primarily used for testing and debugging purposes within the Concert multi-user collaboration framework for Unreal Engine.
This setting variable is primarily used in the ConcertSyncClient module, which is part of the Concert plugin for Unreal Engine. Specifically, it is utilized in the replication management system of the Concert framework.
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 CVarSimulateStreamChangeTimeouts directly interacts with Concert.Replication.SimulateStreamChangeTimeouts. They share the same value and purpose.
Developers must be aware that enabling this variable will cause the client to simulate timeouts for stream change requests instead of actually sending them to the server. This behavior is intended for testing how the system handles timeout scenarios without actually experiencing network issues.
Best practices when using this variable include:
- Only enable it in development or testing environments, never in production.
- Use it in conjunction with other testing tools to comprehensively test the robustness of the replication system.
- Always disable it after testing to ensure normal operation of the replication system.
- Document its usage clearly in test plans or debugging procedures.
Regarding the associated variable CVarSimulateStreamChangeTimeouts:
The purpose of CVarSimulateStreamChangeTimeouts is identical to Concert.Replication.SimulateStreamChangeTimeouts. It’s an implementation detail that allows the console variable to be accessed programmatically within the C++ code.
This variable is used directly in the ConcertSyncClient module, specifically in the FReplicationManagerState_Connected class.
The value of CVarSimulateStreamChangeTimeouts is set when the console variable Concert.Replication.SimulateStreamChangeTimeouts is set.
It interacts directly with the ChangeStream function in the FReplicationManagerState_Connected class. When enabled, it causes this function to return a simulated timeout response instead of processing the actual stream change request.
Developers should be aware that this variable directly affects the behavior of the ChangeStream function, which is a critical part of the replication system.
Best practices for CVarSimulateStreamChangeTimeouts are the same as for Concert.Replication.SimulateStreamChangeTimeouts, as they are essentially two representations of the same setting.
#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:32
Scope (from outer to inner):
file
namespace UE::ConcertSyncClient::Replication
Source code excerpt:
);
TAutoConsoleVariable<bool> CVarSimulateStreamChangeTimeouts(
TEXT("Concert.Replication.SimulateStreamChangeTimeouts"),
false,
TEXT("Whether the client should pretend that stream change requests timed out instead of sending to the server.")
);
TAutoConsoleVariable<bool> CVarSimulateAuthorityRejection(
TEXT("Concert.Replication.SimulateAuthorityRejection"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarSimulateStreamChangeTimeouts
. 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:31
Scope (from outer to inner):
file
namespace UE::ConcertSyncClient::Replication
Source code excerpt:
TEXT("Whether the client should pretend that query requests timed out instead of sending to the server.")
);
TAutoConsoleVariable<bool> CVarSimulateStreamChangeTimeouts(
TEXT("Concert.Replication.SimulateStreamChangeTimeouts"),
false,
TEXT("Whether the client should pretend that stream change requests timed out instead of sending to the server.")
);
TAutoConsoleVariable<bool> CVarSimulateAuthorityRejection(
#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncClient/Source/ConcertSyncClient/Private/Replication/Manager/ReplicationManagerState_Connected.cpp:189
Scope (from outer to inner):
file
namespace UE::ConcertSyncClient::Replication
function TFuture<FConcertReplication_ChangeStream_Response> FReplicationManagerState_Connected::ChangeStream
Source code excerpt:
TFuture<FConcertReplication_ChangeStream_Response> FReplicationManagerState_Connected::ChangeStream(FConcertReplication_ChangeStream_Request Args)
{
if (CVarSimulateStreamChangeTimeouts.GetValueOnGameThread())
{
return MakeFulfilledPromise<FConcertReplication_ChangeStream_Response>(FConcertReplication_ChangeStream_Response{ EReplicationResponseErrorCode::Timeout }).GetFuture();
}
// 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.