demo.InternalPauseChannels
demo.InternalPauseChannels
#Overview
name: demo.InternalPauseChannels
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
If true, run standard logic for PauseChannels rather than letting the game handle it via FOnPauseChannelsDelegate.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of demo.InternalPauseChannels is to control the behavior of pausing channels in the Unreal Engine’s demo playback system. Specifically, it determines whether the engine should use its standard logic for pausing channels or allow the game to handle it through a custom delegate.
This setting variable is primarily used in the Unreal Engine’s networking and demo playback subsystems. Based on the callsites, it’s evident that the DemoNetDriver module relies on this variable.
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 with a default value of 1 (true).
The associated variable CVarDemoInternalPauseChannels interacts directly with demo.InternalPauseChannels, as they share the same value and purpose.
Developers must be aware that when this variable is set to 1 (true), the engine will use its internal logic for pausing channels during demo playback. If set to 0 (false), the game is expected to handle channel pausing through the FOnPauseChannelsDelegate.
Best practices when using this variable include:
- Carefully consider whether your game needs custom channel pausing logic. If not, leave this set to true for standard behavior.
- If implementing custom channel pausing, ensure that your FOnPauseChannelsDelegate is properly set up and tested when this variable is set to false.
- Be aware that changing this value at runtime could affect ongoing demo playback, so it’s generally better to set it before starting a demo.
Regarding the associated variable CVarDemoInternalPauseChannels:
The purpose of CVarDemoInternalPauseChannels is identical to demo.InternalPauseChannels. It’s the actual TAutoConsoleVariable object that represents the console variable in the engine’s code.
This variable is used directly in the DemoNetDriver’s PauseChannels function to determine whether to use the internal pausing logic or not.
The value of CVarDemoInternalPauseChannels is set when the console variable is initialized, and it can be changed through console commands or configuration files.
Developers should be aware that this variable is accessed using the GetValueOnAnyThread() method, which suggests it’s designed to be thread-safe for reading.
Best practices for CVarDemoInternalPauseChannels include:
- Use this variable for runtime checks in C++ code when you need to determine whether to use internal channel pausing.
- Be cautious about caching the value, as it can be changed at runtime. Always call GetValueOnAnyThread() when you need the current value.
- If you’re extending the DemoNetDriver functionality, consider this variable’s state when implementing features related to channel pausing.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DemoNetDriver.cpp:69
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarDemoJumpToEndOfLiveReplay(TEXT("demo.JumpToEndOfLiveReplay"), 1, TEXT("If true, fast forward to a few seconds before the end when starting playback, if the replay is still being recorded."));
static TAutoConsoleVariable<int32> CVarDemoInternalPauseChannels(TEXT("demo.InternalPauseChannels"), 1, TEXT("If true, run standard logic for PauseChannels rather than letting the game handle it via FOnPauseChannelsDelegate."));
static int32 GDemoLoopCount = 0;
static FAutoConsoleVariableRef CVarDemoLoopCount( TEXT( "demo.LoopCount" ), GDemoLoopCount, TEXT( "If > 1, will play the replay that many times before stopping." ) );
static int32 GDemoSaveRollbackActorState = 1;
static FAutoConsoleVariableRef CVarDemoSaveRollbackActorState( TEXT( "demo.SaveRollbackActorState" ), GDemoSaveRollbackActorState, TEXT( "If true, rollback actors will save some replicated state to apply when respawned." ) );
#Associated Variable and Callsites
This variable is associated with another variable named CVarDemoInternalPauseChannels
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DemoNetDriver.cpp:69
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarDemoJumpToEndOfLiveReplay(TEXT("demo.JumpToEndOfLiveReplay"), 1, TEXT("If true, fast forward to a few seconds before the end when starting playback, if the replay is still being recorded."));
static TAutoConsoleVariable<int32> CVarDemoInternalPauseChannels(TEXT("demo.InternalPauseChannels"), 1, TEXT("If true, run standard logic for PauseChannels rather than letting the game handle it via FOnPauseChannelsDelegate."));
static int32 GDemoLoopCount = 0;
static FAutoConsoleVariableRef CVarDemoLoopCount( TEXT( "demo.LoopCount" ), GDemoLoopCount, TEXT( "If > 1, will play the replay that many times before stopping." ) );
static int32 GDemoSaveRollbackActorState = 1;
static FAutoConsoleVariableRef CVarDemoSaveRollbackActorState( TEXT( "demo.SaveRollbackActorState" ), GDemoSaveRollbackActorState, TEXT( "If true, rollback actors will save some replicated state to apply when respawned." ) );
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DemoNetDriver.cpp:2387
Scope (from outer to inner):
file
function void UDemoNetDriver::PauseChannels
Source code excerpt:
}
if (CVarDemoInternalPauseChannels.GetValueOnAnyThread() > 0)
{
// Pause all non player controller actors
for (int32 i = ServerConnection->OpenChannels.Num() - 1; i >= 0; i--)
{
UChannel* OpenChannel = ServerConnection->OpenChannels[i];