con.DebugEarlyCheat
con.DebugEarlyCheat
#Overview
name: con.DebugEarlyCheat
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
used internally to test the console variable system
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of con.DebugEarlyCheat is to serve as an internal testing mechanism for the console variable system in Unreal Engine 5. It is specifically used to test the behavior of console variables marked with the ECVF_Cheat flag.
This setting variable is primarily used within the Core module of Unreal Engine, particularly in the console management and configuration utilities subsystems. The main files referencing this variable are ConsoleManager.cpp and ConfigUtilities.cpp.
The value of this variable is set in the ConsoleManager.cpp file, where it is initialized with a value of 22. It is defined as a TAutoConsoleVariable with the int32 type and the ECVF_Cheat flag.
The associated variable CVarDebugEarlyCheat interacts directly with con.DebugEarlyCheat, as they represent the same console variable. CVarDebugEarlyCheat is used in the C++ code to access and manipulate the value of con.DebugEarlyCheat.
Developers must be aware that this variable is intended for internal testing purposes only and should not be modified or relied upon in production code. It is specifically designed to test the behavior of cheat-flagged console variables.
Best practices when using this variable include:
- Do not modify its value or behavior in production code.
- Use it only for understanding or extending the console variable system’s testing capabilities.
- Be aware that it may be used in automated tests to verify the correct handling of cheat-flagged console variables.
Regarding the associated variable CVarDebugEarlyCheat:
The purpose of CVarDebugEarlyCheat is to provide a C++ interface for accessing and manipulating the con.DebugEarlyCheat console variable within the engine’s code.
It is used in the Core module, specifically in the console management system, to test and verify the behavior of cheat-flagged console variables.
The value of CVarDebugEarlyCheat is set when it is initialized in ConsoleManager.cpp, mirroring the value of con.DebugEarlyCheat.
CVarDebugEarlyCheat interacts directly with con.DebugEarlyCheat, as they represent the same console variable. It is used in C++ code to access the value, particularly in testing scenarios.
Developers should be aware that CVarDebugEarlyCheat is an internal testing tool and should not be used or modified in game-specific code.
Best practices for CVarDebugEarlyCheat include:
- Treat it as a read-only variable in most scenarios.
- Use it only when extending or testing the console variable system.
- Be cautious of any code that attempts to modify its value, as it may interfere with internal testing mechanisms.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:2203, section: [SystemSettings]
- INI Section:
SystemSettings
- Raw value:
True
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/HAL/ConsoleManager.cpp:1631
Scope: file
Source code excerpt:
// part of the automated test for console variables
static TAutoConsoleVariable<int32> CVarDebugEarlyCheat(
TEXT("con.DebugEarlyCheat"),
22,
TEXT("used internally to test the console variable system"),
ECVF_Cheat);
#endif
void FConsoleManager::CallAllConsoleVariableSinks()
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/Misc/ConfigUtilities.cpp:240
Scope (from outer to inner):
file
namespace UE::ConfigUtilities
function void OnSetCVarFromIniEntry
Source code excerpt:
{
// We have one special cvar to test cheating and here we don't want to both the user of the engine
if(FCString::Stricmp(Key, TEXT("con.DebugEarlyCheat")) != 0)
{
ensureMsgf(false, TEXT("The ini file '%s' tries to set the console variable '%s' marked with ECVF_Cheat, this is only allowed in consolevariables.ini"),
IniFile, Key);
}
}
#endif // !DISABLE_CHEAT_CVARS
#Associated Variable and Callsites
This variable is associated with another variable named CVarDebugEarlyCheat
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/HAL/ConsoleManager.cpp:1630
Scope: file
Source code excerpt:
ECVF_Default);
// part of the automated test for console variables
static TAutoConsoleVariable<int32> CVarDebugEarlyCheat(
TEXT("con.DebugEarlyCheat"),
22,
TEXT("used internally to test the console variable system"),
ECVF_Cheat);
#endif
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/HAL/ConsoleManager.cpp:1656
Scope (from outer to inner):
file
function void FConsoleManager::CallAllConsoleVariableSinks
Source code excerpt:
int32 ValA = CVarDebugEarlyDefault.GetValueOnGameThread();
int32 ValB = CVarDebugEarlyCheat.GetValueOnGameThread();
int32 ValC = VarC->GetInt();
int32 ValD = VarD->GetInt();
// in BaseEngine.ini we set all 4 cvars to "True" but only the non cheat one should pick up the value
check(ValA == 1);
check(ValB == 22);