demo.ReplayStreamerAutoDemoPrefix
demo.ReplayStreamerAutoDemoPrefix
#Overview
name: demo.ReplayStreamerAutoDemoPrefix
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Prefix to use when generating automatic demo names.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of demo.ReplayStreamerAutoDemoPrefix is to set a prefix for automatically generated demo names in Unreal Engine’s network replay system. This setting variable is primarily used in the network replay streaming subsystem of Unreal Engine.
The NetworkReplayStreaming module relies on this setting variable, as evidenced by its usage in the NetworkReplayStreaming.cpp file.
The value of this variable is set using a TAutoConsoleVariable, which means it can be modified at runtime through console commands. The default value is set to “demo”.
This variable interacts with the associated variable CVarReplayStreamerAutoDemoPrefix, which is used to access the value of demo.ReplayStreamerAutoDemoPrefix within the C++ code.
Developers should be aware that this variable affects the naming convention of automatically generated replay files. Changing this prefix could impact how replay files are identified and managed within the game and potentially by external tools.
Best practices when using this variable include:
- Choosing a meaningful prefix that helps identify the nature of the replay files.
- Ensuring consistency across different builds or versions of the game to maintain compatibility.
- Considering the implications on any custom tools or systems that might rely on the replay file naming convention.
Regarding the associated variable CVarReplayStreamerAutoDemoPrefix:
This is a TAutoConsoleVariable of type FString that directly corresponds to the demo.ReplayStreamerAutoDemoPrefix setting. It’s used within the C++ code to access and manipulate the prefix value.
The value of CVarReplayStreamerAutoDemoPrefix is retrieved in the GetAutomaticReplayPrefix() function of the FNetworkReplayStreaming class. This function is likely called whenever the system needs to generate a new automatic replay name.
Developers should use the CVarReplayStreamerAutoDemoPrefix.GetValueOnAnyThread() method to access the current value of the prefix in C++ code, as demonstrated in the GetAutomaticReplayPrefix() function.
When working with CVarReplayStreamerAutoDemoPrefix, it’s important to remember that changes to this variable will immediately affect the naming of new replay files. Therefore, any modifications should be carefully considered and tested to ensure they don’t disrupt existing systems or user expectations.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/NetworkReplayStreaming/NetworkReplayStreaming/Private/NetworkReplayStreaming.cpp:62
Scope: file
Source code excerpt:
static TAutoConsoleVariable<FString> CVarReplayStreamerAutoDemoPrefix(
TEXT("demo.ReplayStreamerAutoDemoPrefix"),
FString(TEXT("demo")),
TEXT("Prefix to use when generating automatic demo names.")
);
static TAutoConsoleVariable<int32> CVarReplayStreamerAutoDemoUseDateTimePostfix(
TEXT("demo.ReplayStreamerAutoDemoUseDateTimePostfix"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarReplayStreamerAutoDemoPrefix
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/NetworkReplayStreaming/NetworkReplayStreaming/Private/NetworkReplayStreaming.cpp:61
Scope: file
Source code excerpt:
}
static TAutoConsoleVariable<FString> CVarReplayStreamerAutoDemoPrefix(
TEXT("demo.ReplayStreamerAutoDemoPrefix"),
FString(TEXT("demo")),
TEXT("Prefix to use when generating automatic demo names.")
);
static TAutoConsoleVariable<int32> CVarReplayStreamerAutoDemoUseDateTimePostfix(
#Loc: <Workspace>/Engine/Source/Runtime/NetworkReplayStreaming/NetworkReplayStreaming/Private/NetworkReplayStreaming.cpp:75
Scope (from outer to inner):
file
function FString FNetworkReplayStreaming::GetAutomaticReplayPrefix
Source code excerpt:
FString FNetworkReplayStreaming::GetAutomaticReplayPrefix()
{
return CVarReplayStreamerAutoDemoPrefix.GetValueOnAnyThread();
}
FString FNetworkReplayStreaming::GetReplayFileExtension()
{
return TEXT(".replay");
}