2021-12-25 22:36:38 +01:00
|
|
|
#include "core/stdafx.h"
|
|
|
|
#include "tier0/cvar.h"
|
|
|
|
#include "tier0/IConVar.h"
|
|
|
|
#include "engine/sys_dll2.h"
|
|
|
|
|
2022-01-09 16:14:17 +01:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// ENGINE |
|
2021-12-25 22:36:38 +01:00
|
|
|
ConVar* cm_debug_cmdquery = new ConVar();
|
|
|
|
ConVar* cm_return_false_cmdquery_all = new ConVar();
|
2021-12-27 02:23:03 +01:00
|
|
|
ConVar* cm_return_false_cmdquery_cheats = new ConVar();
|
2022-01-05 22:56:49 +01:00
|
|
|
ConVar* r_debug_overlay_nodecay = new ConVar();
|
2022-02-06 15:54:52 +01:00
|
|
|
|
|
|
|
ConVar* rcon_address = new ConVar();
|
|
|
|
ConVar* rcon_password = new ConVar();
|
2022-01-09 16:14:17 +01:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// SERVER |
|
2021-12-25 22:36:38 +01:00
|
|
|
ConVar* sv_showconnecting = new ConVar();
|
2021-12-28 02:23:13 +01:00
|
|
|
ConVar* sv_pylonvisibility = new ConVar();
|
2022-02-06 15:54:52 +01:00
|
|
|
|
2022-02-08 16:32:00 +01:00
|
|
|
#ifdef DEDICATED
|
2022-02-14 03:02:38 +01:00
|
|
|
ConVar* sv_rcon_debug = new ConVar();
|
2022-02-06 15:54:52 +01:00
|
|
|
ConVar* sv_rcon_banpenalty = new ConVar(); // TODO
|
|
|
|
ConVar* sv_rcon_maxfailures = new ConVar();
|
2022-02-08 16:32:00 +01:00
|
|
|
ConVar* sv_rcon_maxignores = new ConVar();
|
|
|
|
ConVar* sv_rcon_maxsockets = new ConVar();
|
|
|
|
ConVar* sv_rcon_whitelist_address = new ConVar();
|
|
|
|
#endif // DEDICATED
|
2022-01-09 16:14:17 +01:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// CLIENT |
|
2022-02-08 16:32:00 +01:00
|
|
|
#ifndef DEDICATED
|
2021-12-25 22:36:38 +01:00
|
|
|
ConVar* cl_drawconsoleoverlay = new ConVar();
|
|
|
|
ConVar* cl_consoleoverlay_lines = new ConVar();
|
|
|
|
ConVar* cl_consoleoverlay_offset_x = new ConVar();
|
|
|
|
ConVar* cl_consoleoverlay_offset_y = new ConVar();
|
2022-01-12 02:53:07 +01:00
|
|
|
ConVar* cl_consoleoverlay_native_clr = new ConVar();
|
|
|
|
ConVar* cl_consoleoverlay_server_clr = new ConVar();
|
|
|
|
ConVar* cl_consoleoverlay_client_clr = new ConVar();
|
|
|
|
ConVar* cl_consoleoverlay_ui_clr = new ConVar();
|
2022-01-08 02:05:33 +01:00
|
|
|
|
|
|
|
ConVar* cl_showsimstats = new ConVar();
|
|
|
|
ConVar* cl_simstats_offset_x = new ConVar();
|
|
|
|
ConVar* cl_simstats_offset_y = new ConVar();
|
|
|
|
|
|
|
|
ConVar* cl_showgpustats = new ConVar();
|
|
|
|
ConVar* cl_gpustats_offset_x = new ConVar();
|
|
|
|
ConVar* cl_gpustats_offset_y = new ConVar();
|
2022-01-17 23:20:03 +01:00
|
|
|
|
2022-01-22 15:51:09 +01:00
|
|
|
ConVar* con_max_size_logvector = new ConVar();
|
2022-01-17 23:20:03 +01:00
|
|
|
ConVar* con_suggestion_limit = new ConVar();
|
2022-01-19 19:00:40 +01:00
|
|
|
ConVar* con_suggestion_helptext = new ConVar();
|
2022-02-08 16:32:00 +01:00
|
|
|
#endif // !DEDICATED
|
2022-01-09 16:14:17 +01:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// FILESYSTEM |
|
2022-01-20 00:59:31 +01:00
|
|
|
ConVar* fs_warning_level_sdk = new ConVar();
|
2022-01-14 20:45:36 +01:00
|
|
|
ConVar* fs_show_warning_output = new ConVar();
|
2021-12-25 22:36:38 +01:00
|
|
|
ConVar* fs_packedstore_entryblock_stats = new ConVar();
|
2022-01-09 16:14:17 +01:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// MATERIALSYSTEM |
|
2022-02-08 16:32:00 +01:00
|
|
|
#ifndef DEDICATED
|
2021-12-27 16:53:35 +01:00
|
|
|
ConVar* mat_showdxoutput = new ConVar();
|
2022-02-08 16:32:00 +01:00
|
|
|
#endif // !DEDICATED
|
2022-01-09 16:14:17 +01:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// SQUIRREL |
|
2021-12-25 22:36:38 +01:00
|
|
|
ConVar* sq_showrsonloading = new ConVar();
|
|
|
|
ConVar* sq_showscriptloading = new ConVar();
|
|
|
|
ConVar* sq_showvmoutput = new ConVar();
|
|
|
|
ConVar* sq_showvmwarning = new ConVar();
|
2022-01-09 16:14:17 +01:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// NETCHANNEL |
|
2021-12-25 22:36:38 +01:00
|
|
|
ConVar* net_userandomkey = new ConVar();
|
|
|
|
ConVar* r5net_matchmaking_hostname = new ConVar();
|
|
|
|
ConVar* r5net_show_debug = new ConVar();
|
|
|
|
|
2022-01-09 16:14:17 +01:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose: finds base commands.
|
|
|
|
// Input : *pszCommandName -
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
ConCommandBase* CCVar::FindCommandBase(const char* pszCommandName)
|
|
|
|
{
|
2022-01-23 18:26:48 +01:00
|
|
|
static int index = 14;
|
|
|
|
return CallVFunc<ConCommandBase*>(index, this, pszCommandName);
|
2022-01-09 16:14:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose: finds ConVars.
|
|
|
|
// Input : *pszVarName -
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
ConVar* CCVar::FindVar(const char* pszVarName)
|
|
|
|
{
|
2022-01-23 18:26:48 +01:00
|
|
|
static int index = 16;
|
|
|
|
return CallVFunc<ConVar*>(index, this, pszVarName);
|
2022-01-09 16:14:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose: finds ConCommands.
|
|
|
|
// Input : *pszCommandName -
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
ConCommand* CCVar::FindCommand(const char* pszCommandName)
|
|
|
|
{
|
2022-01-23 18:26:48 +01:00
|
|
|
static int index = 18;
|
|
|
|
return CallVFunc<ConCommand*>(index, this, pszCommandName);
|
2022-01-09 16:14:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose: iterates over all ConVars
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
CCVarIteratorInternal* CCVar::FactoryInternalIterator()
|
|
|
|
{
|
2022-01-23 18:26:48 +01:00
|
|
|
static int index = 41;
|
|
|
|
return CallVFunc<CCVarIteratorInternal*>(index, this);
|
2022-01-09 16:14:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose: returns all ConVars
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
std::unordered_map<std::string, ConCommandBase*> CCVar::DumpToMap()
|
|
|
|
{
|
|
|
|
std::stringstream ss;
|
2022-01-15 15:25:19 +01:00
|
|
|
CCVarIteratorInternal* itint = FactoryInternalIterator(); // Allocate new InternalIterator.
|
2022-01-09 16:14:17 +01:00
|
|
|
|
|
|
|
std::unordered_map<std::string, ConCommandBase*> allConVars;
|
|
|
|
|
|
|
|
for (itint->SetFirst(); itint->IsValid(); itint->Next()) // Loop through all instances.
|
|
|
|
{
|
|
|
|
ConCommandBase* pCommand = itint->Get();
|
|
|
|
const char* pszCommandName = pCommand->m_pszName;
|
|
|
|
allConVars[pszCommandName] = pCommand;
|
|
|
|
}
|
|
|
|
|
|
|
|
return allConVars;
|
|
|
|
}
|
|
|
|
|
2021-12-25 22:36:38 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2022-01-17 23:20:03 +01:00
|
|
|
std::vector<std::string> g_vsvAllConVars;
|
2022-01-10 01:31:25 +01:00
|
|
|
CCVar* g_pCVar = reinterpret_cast<CCVar*>(p_CEngineAPI_Connect.FindPatternSelf("48 8D 0D", ADDRESS::Direction::DOWN, 40).ResolveRelativeAddressSelf(0x3, 0x7).GetPtr());
|