Concert.DelayTransactionsWhileEditingTimeout
Concert.DelayTransactionsWhileEditingTimeout
#Overview
name: Concert.DelayTransactionsWhileEditingTimeout
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
When Concert.DelayTransactionsWhileEditing is enabled we make sure the user has not been idle too long to prevent transactions from stacking up. The timeout value is specified in seconds.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of Concert.DelayTransactionsWhileEditingTimeout is to set a timeout value for delaying the application of transactions in Unreal Engine’s Concert system when the user is actively editing.
This setting variable is primarily used in the Concert system, which is part of Unreal Engine’s collaborative editing features. It is specifically utilized in the ConcertSyncClient module, which is responsible for synchronizing changes between multiple users in a collaborative editing session.
The value of this variable is set through the console variable system in Unreal Engine. It’s defined as a TAutoConsoleVariable with an initial value of 5 seconds.
The associated variable CVarDelayApplyingTransactionsWaitTimeout directly interacts with Concert.DelayTransactionsWhileEditingTimeout. They share the same value and are used interchangeably in the code.
Developers must be aware that this variable affects the behavior of transaction application in collaborative editing scenarios. When Concert.DelayTransactionsWhileEditing is enabled, this timeout prevents transactions from stacking up indefinitely if the user becomes idle.
Best practices when using this variable include:
- Adjusting the value based on the specific needs of the project and the typical editing patterns of the users.
- Monitoring the performance impact of different timeout values in large collaborative sessions.
- Considering the balance between responsiveness and preventing transaction stack-ups.
Regarding the associated variable CVarDelayApplyingTransactionsWaitTimeout:
The purpose of CVarDelayApplyingTransactionsWaitTimeout is to provide programmatic access to the Concert.DelayTransactionsWhileEditingTimeout value within the C++ code.
This variable is used in the ConcertSyncClient module, specifically in the ConcertSyncClientUtil namespace.
The value of this variable is set when Concert.DelayTransactionsWhileEditingTimeout is set, as they share the same value.
CVarDelayApplyingTransactionsWaitTimeout interacts directly with the ShouldDelayTransaction function, which uses it to determine if a transaction should be delayed based on user activity.
Developers should be aware that this variable is used in time-sensitive operations and its value is accessed on any thread (GetValueOnAnyThread).
Best practices for using CVarDelayApplyingTransactionsWaitTimeout include:
- Accessing its value using GetValueOnAnyThread() when needed in multi-threaded contexts.
- Considering the performance implications of frequent checks against this value in time-critical code paths.
- Ensuring that any modifications to this variable are synchronized with Concert.DelayTransactionsWhileEditingTimeout to maintain consistency.
#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/ConcertSyncClientUtil.cpp:55
Scope (from outer to inner):
file
namespace ConcertSyncClientUtil
Source code excerpt:
static TAutoConsoleVariable<int32> CVarDelayApplyingTransactionsWaitTimeout(
TEXT("Concert.DelayTransactionsWhileEditingTimeout"), 5,
TEXT("When Concert.DelayTransactionsWhileEditing is enabled we make sure the user has not been idle too long to prevent transactions from stacking up. The timeout value is specified in seconds."));
bool IsUserEditing()
{
static FName SEditableTextType(TEXT("SEditableText"));
static FName SMultiLineEditableTextType(TEXT("SMultiLineEditableText"));
#Associated Variable and Callsites
This variable is associated with another variable named CVarDelayApplyingTransactionsWaitTimeout
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncClient/Source/ConcertSyncClient/Private/ConcertSyncClientUtil.cpp:54
Scope (from outer to inner):
file
namespace ConcertSyncClientUtil
Source code excerpt:
TEXT("Focus is lost by the editor when a transaction is applied. This variable suspends applying a transaction until the user has removed focus on editable UI."));
static TAutoConsoleVariable<int32> CVarDelayApplyingTransactionsWaitTimeout(
TEXT("Concert.DelayTransactionsWhileEditingTimeout"), 5,
TEXT("When Concert.DelayTransactionsWhileEditing is enabled we make sure the user has not been idle too long to prevent transactions from stacking up. The timeout value is specified in seconds."));
bool IsUserEditing()
{
static FName SEditableTextType(TEXT("SEditableText"));
#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncClient/Source/ConcertSyncClient/Private/ConcertSyncClientUtil.cpp:97
Scope (from outer to inner):
file
namespace ConcertSyncClientUtil
function bool ShouldDelayTransaction
Source code excerpt:
double LastUpdateTime = App.GetLastUserInteractionTime();
double Duration = App.GetCurrentTime() - LastUpdateTime;
if (static_cast<int32>(Duration) > CVarDelayApplyingTransactionsWaitTimeout.GetValueOnAnyThread())
{
return false;
}
}
return bIsEditing;
}