Skip to content

Instantly share code, notes, and snippets.

@es3n1n
Created May 13, 2021 18:06
Show Gist options
  • Save es3n1n/fe2051a24ffef32a8219823e7ef69b05 to your computer and use it in GitHub Desktop.
Save es3n1n/fe2051a24ffef32a8219823e7ef69b05 to your computer and use it in GitHub Desktop.
csgo convar flags
#include <cstdint>
enum e_cvar_flags : uint32_t {
none = 0,
unregistered = (1<<0), // If this is set, don't add to linked list, etc.
developmentonly = (1<<1), // Hidden in released products. Flag is removed automatically if ALLOW_DEVELOPMENT_CVARS is defined.
gamedll = (1<<2), // defined by the game DLL
clientdll = (1<<3), // defined by the client DLL
hidden = (1<<4), // Hidden. Doesn't appear in find or auto complete. Like DEVELOPMENTONLY, but can't be compiled out.
priv /* protected */ = (1<<5) , // It's a server cvar, but we don't send the data since it's a password, etc. Sends 1 if it's not bland/zero, 0 otherwise as value
sponly = (1<<6), // This cvar cannot be changed by clients connected to a multiplayer server.
archive = (1<<7), // set to cause it to be saved to vars.rc
notify = (1<<8), // notifies players when changed
userinfo = (1<<9), // changes the client's info string
printableonly = (1<<10), // This cvar's string cannot contain unprintable characters ( e.g., used for player name etc ).
gamedll_for_remote_clients = (1<<10), // When on concommands this allows remote clients to execute this cmd on the server.
unlogged = (1<<11), // If this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log
never_as_string = (1<<12), // never try to print that cvar
replicated = (1<<13), // server setting enforced on clients, TODO rename to FCAR_SERVER at some time
cheat = (1<<14), // Only useable in singleplayer / debug / multiplayer & sv_cheats
ss = (1<<15), // causes varnameN where N == 2 through max splitscreen slots for mod to be autogenerated
demo = (1<<16), // record this cvar when starting a demo file
dontrecord = (1<<17), // don't record these command in demofiles
ss_added = (1<<18), // This is one of the "added" FCVAR_SS variables for the splitscreen players
release = (1<<19), // Cvars tagged with this are the only cvars avaliable to customers
reload_materials = (1<<20), // If this cvar changes, it forces a material reload
reload_textures = (1<<21), // If this cvar changes, if forces a texture reload
not_connected = (1<<22), // cvar cannot be changed by a client that is connected to a server
material_system_thread = (1<<23), // Indicates this cvar is read from the material system thread
archive_gameconsole = (1<<24), // cvar written to config.cfg on the Xbox
server_can_execute = (1<<28),
server_cannot_query = (1<<29),
clientcmd_can_execute = (1<<30), // IVEngineClient::ClientCmd is allowed to execute this command.
accessible_from_threads = (1<<25), // used as a debugging tool necessary to check material system thread convars
};
local bit = require('bit')
local e_cvar_flags = {
none = 0,
unregistered = bit.lshift(1, 0), -- If this is set, don't add to linked list, etc.
developmentonly = bit.lshift(1, 1), -- Hidden in released products. Flag is removed automatically if ALLOW_DEVELOPMENT_CVARS is defined.
gamedll = bit.lshift(1, 2), -- defined by the game DLL
clientdll = bit.lshift(1, 3), -- defined by the client DLL
hidden = bit.lshift(1, 4), -- Hidden. Doesn't appear in find or auto complete. Like DEVELOPMENTONLY, but can't be compiled out.
protected = bit.lshift(1, 5), -- It's a server cvar, but we don't send the data since it's a password, etc. Sends 1 if it's not bland/zero, 0 otherwise as value
sponly = bit.lshift(1, 6), -- This cvar cannot be changed by clients connected to a multiplayer server.
archive = bit.lshift(1, 7), -- set to cause it to be saved to vars.rc
notify = bit.lshift(1, 8), -- notifies players when changed
userinfo = bit.lshift(1, 9), -- changes the client's info string
printableonly = bit.lshift(1, 10), -- This cvar's string cannot contain unprintable characters ( e.g., used for player name etc ).
gamedll_for_remote_clients = bit.lshift(1, 10), -- When on concommands this allows remote clients to execute this cmd on the server.
unlogged = bit.lshift(1, 11), -- If this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log
never_as_string = bit.lshift(1, 12), -- never try to print that cvar
replicated = bit.lshift(1, 13), -- server setting enforced on clients, TODO rename to FCAR_SERVER at some time
cheat = bit.lshift(1, 14), -- Only useable in singleplayer / debug / multiplayer & sv_cheats
ss = bit.lshift(1, 15), -- causes varnameN where N == 2 through max splitscreen slots for mod to be autogenerated
demo = bit.lshift(1, 16), -- record this cvar when starting a demo file
dontrecord = bit.lshift(1, 17), -- don't record these command in demofiles
ss_added = bit.lshift(1, 18), -- This is one of the "added" FCVAR_SS variables for the splitscreen players
release = bit.lshift(1, 19), -- Cvars tagged with this are the only cvars avaliable to customers
reload_materials = bit.lshift(1, 20), -- If this cvar changes, it forces a material reload
reload_textures = bit.lshift(1, 21), -- If this cvar changes, if forces a texture reload
not_connected = bit.lshift(1, 22), -- cvar cannot be changed by a client that is connected to a server
material_system_thread = bit.lshift(1, 23), -- Indicates this cvar is read from the material system thread
archive_gameconsole = bit.lshift(1, 24), -- cvar written to config.cfg on the Xbox
server_can_execute = bit.lshift(1, 28),
server_cannot_query = bit.lshift(1, 29),
clientcmd_can_execute = bit.lshift(1, 30), -- IVEngineClient::ClientCmd is allowed to execute this command.
accessible_from_threads = bit.lshift(1, 25), -- used as a debugging tool necessary to check material system thread convars
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment