Concert.AlwaysCloseGamePlayerOnCloseEvent
Concert.AlwaysCloseGamePlayerOnCloseEvent
#Overview
name: Concert.AlwaysCloseGamePlayerOnCloseEvent
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Force this player to close even if other editors have it open. This CVar only works on
-gameinstances.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of Concert.AlwaysCloseGamePlayerOnCloseEvent is to control the behavior of closing sequencer players in game instances within the Unreal Engine’s Concert system. This setting is specifically designed for multiplayer editing scenarios where multiple editors might be working on the same sequence.
This setting variable is primarily used in the Concert Sync Client module, which is part of the Concert plugin for Unreal Engine. The Concert system facilitates real-time collaboration in multi-user editing environments.
The value of this variable is set as a console variable (CVar) with a default value of 1. It can be modified at runtime through console commands or configuration files.
The associated variable CVarAlwaysCloseGamePlayerOnCloseEvent directly interacts with Concert.AlwaysCloseGamePlayerOnCloseEvent. They share the same value and purpose.
Developers must be aware that this variable only affects game instances (launched with the -game parameter) and not editor instances. When enabled (set to a value greater than 0), it forces the closure of a sequence player in a game instance even if other editors still have the sequence open.
Best practices when using this variable include:
- Consider the implications on multiplayer editing workflows before modifying its value.
- Use it judiciously to balance between synchronization needs and individual editor autonomy.
- Communicate changes to this setting with all team members to ensure consistent behavior across different instances.
Regarding the associated variable CVarAlwaysCloseGamePlayerOnCloseEvent:
This is the actual C++ variable that implements the functionality of Concert.AlwaysCloseGamePlayerOnCloseEvent. It is defined as a TAutoConsoleVariable
The purpose and usage of CVarAlwaysCloseGamePlayerOnCloseEvent are identical to Concert.AlwaysCloseGamePlayerOnCloseEvent. It is used within the FConcertClientSequencerManager class to determine whether a game sequencer player should always be closed.
The value of this variable is checked in the ShouldAlwaysCloseGameSequencerPlayer() function, which likely influences the behavior of the sequencer manager in game instances.
Developers should be aware that modifying CVarAlwaysCloseGamePlayerOnCloseEvent directly in code will have the same effect as changing Concert.AlwaysCloseGamePlayerOnCloseEvent through console commands or configuration files.
Best practices for CVarAlwaysCloseGamePlayerOnCloseEvent include:
- Use the GetValueOnAnyThread() method when accessing its value to ensure thread-safe operations.
- Consider the performance implications of frequent checks to this variable in performance-critical code sections.
- Document any hard-coded changes to this variable’s value to maintain consistency with the engine’s default behavior.
#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/ConcertClientSequencerManager.cpp:59
Scope: file
Source code excerpt:
// Enable always closing player on remote machine whenever a sequencer is closed on an editor.
static TAutoConsoleVariable<int32> CVarAlwaysCloseGamePlayerOnCloseEvent(
TEXT("Concert.AlwaysCloseGamePlayerOnCloseEvent"), 1, TEXT("Force this player to close even if other editors have it open. This CVar only works on `-game` instances."));
class FConcertClientSequencePreloader : public TSharedFromThis<FConcertClientSequencePreloader>
{
public:
void OnPreloadEvent(const FConcertSessionContext& InEventContext, const FConcertSequencerPreloadRequest& InEvent);
#Associated Variable and Callsites
This variable is associated with another variable named CVarAlwaysCloseGamePlayerOnCloseEvent
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncClient/Source/ConcertSyncClient/Private/ConcertClientSequencerManager.cpp:58
Scope: file
Source code excerpt:
// Enable always closing player on remote machine whenever a sequencer is closed on an editor.
static TAutoConsoleVariable<int32> CVarAlwaysCloseGamePlayerOnCloseEvent(
TEXT("Concert.AlwaysCloseGamePlayerOnCloseEvent"), 1, TEXT("Force this player to close even if other editors have it open. This CVar only works on `-game` instances."));
class FConcertClientSequencePreloader : public TSharedFromThis<FConcertClientSequencePreloader>
{
public:
#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncClient/Source/ConcertSyncClient/Private/ConcertClientSequencerManager.cpp:364
Scope (from outer to inner):
file
function bool FConcertClientSequencerManager::ShouldAlwaysCloseGameSequencerPlayer
Source code excerpt:
bool FConcertClientSequencerManager::ShouldAlwaysCloseGameSequencerPlayer() const
{
return CVarAlwaysCloseGamePlayerOnCloseEvent.GetValueOnAnyThread() > 0;
}
namespace UE::Private::ConcertClientSequencerManager
{
void ApplyPlayRangeToPlayer(ULevelSequencePlayer* Player, const FFrameNumberRange& PlayRange)