Whats the relation between Cvars and cheats?

0

It is not clear if there is a distinction and how to do it.

What will work about cvars in release mode and what not, can one enable the console with a restricted set of vars available?

Documentation seems to not answer to these questions.

asked 7 years ago165 views
4 Answers
0
Accepted Answer

Hi @REDACTEDUSER

The cvars obey the rules specified for them in IConsole.h using the flags they are created with. For example the e_TimeOfDaySpeed cvar is registered with VF_CHEAT and VF_CHEAT_NOCHECK

REGISTER_CVAR_CB(e_TimeOfDaySpeed, 0.0f, VF_CHEAT | VF_CHEAT_NOCHECK, "Time of Day change speed", OnTimeOfDaySpeedVarChange);

These are the flags that explain how they behave in various modes (release, profile, etc)

    // Flags used by ICVar
enum EVarFlags
{
VF_NULL = 0x00000000, // just to have one recognizable spot where the flags are located in the Register call
VF_CHEAT = 0x00000002, // stays in the default state when cheats are disabled
VF_DEV_ONLY = 0x00000004, // cvar is only registered with the console in non release builds
VF_DEDI_ONLY = 0x00000008, // cvar is only registered with the console in non release or dedicated server builds
VF_NET_SYNCED = 0x00000080, // synchronised between server and client(s); server authorative
VF_DUMPTODISK = 0x00000100,
VF_READONLY = 0x00000800, // can not be changed by the user
VF_REQUIRE_LEVEL_RELOAD = 0x00001000,
VF_REQUIRE_APP_RESTART = 0x00002000,
VF_WARNING_NOTUSED = 0x00004000, // shows warning that this var was not used in config file
VF_COPYNAME = 0x00008000, // otherwise the const char * to the name will be stored without copying the memory
VF_MODIFIED = 0x00010000, // Set when variable value modified.
VF_WASINCONFIG = 0x00020000, // Set when variable was present in config file.
VF_BITFIELD = 0x00040000, // Allow bitfield setting syntax.
VF_RESTRICTEDMODE = 0x00080000, // is visible and usable in restricted (normal user) console mode
VF_INVISIBLE = 0x00100000, // Invisible to the user in console
VF_ALWAYSONCHANGE = 0x00200000, // Always accept variable value and call on change callback even if variable value didnt change
VF_BLOCKFRAME = 0x00400000, // Blocks the execution of console commands for one frame
VF_CONST_CVAR = 0x00800000, // Set if it is a const cvar not to be set inside cfg-files
VF_CHEAT_ALWAYS_CHECK = 0x01000000, // This variable is critical to check in every hash, since it's extremely vulnerable
VF_CHEAT_NOCHECK = 0x02000000, // This variable is set as VF_CHEAT but doesn't have to be checked/hashed since it's harmless to hack
VF_SYSSPEC_OVERWRITE = 0x04000000, // This variable is specified by system.cfg with the intention to overwrite all subsequent settings
VF_CVARGRP_IGNOREINREALVAL = 0x08000000, // This variable will be ignored when cvar group's real val is checked (Needed for cvars which are in a group but change in various situations)
VF_RENDERER_CVAR = 0x20000000, // The update of this variable will be done in render thread
VF_DEPRECATED = 0x40000000, // Deprecated cvars use default values which cannot be modified outside the code
VF_EXPERIMENTAL = 0x80000000, // This variable is used by WIP or experimental feature
}

I hope this answers your question, but let me know if I can provide more information or examples.

answered 7 years ago
0

I'll try to find out for you.

answered 7 years ago
0

REMOVEDUPLOAD

high five!

answered 7 years ago
0

Thanks it was exactly the informations I was looking for.

answered 7 years ago

This post is closed: Adding new answers, comments, and votes is disabled.