2021-12-25 22:36:38 +01:00
|
|
|
#pragma once
|
2022-04-09 16:16:40 +02:00
|
|
|
#include "tier1/IConVar.h"
|
2021-12-25 22:36:38 +01:00
|
|
|
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
// ENGINE |
|
2022-04-14 19:18:59 +02:00
|
|
|
extern ConVar* single_frame_shutdown_for_reload;
|
2022-04-30 03:30:16 +02:00
|
|
|
extern ConVar* old_gather_props;
|
2022-06-15 01:24:29 +02:00
|
|
|
extern ConVar* enable_debug_overlays;
|
2022-05-01 21:09:05 +02:00
|
|
|
|
2022-05-01 01:32:23 +02:00
|
|
|
extern ConVar* staticProp_defaultBuildFrustum;
|
2022-05-01 21:09:05 +02:00
|
|
|
extern ConVar* staticProp_no_fade_scalar;
|
|
|
|
extern ConVar* staticProp_gather_size_weight;
|
|
|
|
|
|
|
|
extern ConVar* model_defaultFadeDistScale;
|
|
|
|
extern ConVar* model_defaultFadeDistMin;
|
2022-04-14 19:18:59 +02:00
|
|
|
|
|
|
|
extern ConVar* hostname;
|
2022-07-01 02:20:47 +02:00
|
|
|
extern ConVar* hostdesc;
|
2022-06-28 00:47:01 +02:00
|
|
|
extern ConVar* hostip;
|
2022-04-14 19:18:59 +02:00
|
|
|
extern ConVar* hostport;
|
|
|
|
extern ConVar* host_hasIrreversibleShutdown;
|
|
|
|
|
|
|
|
extern ConVar* mp_gamemode;
|
|
|
|
|
2021-12-25 22:36:38 +01:00
|
|
|
extern ConVar* cm_debug_cmdquery;
|
2022-04-26 20:24:51 +02:00
|
|
|
extern ConVar* cm_unset_all_cmdquery;
|
|
|
|
extern ConVar* cm_unset_dev_cmdquery;
|
|
|
|
extern ConVar* cm_unset_cheat_cmdquery;
|
2022-02-06 15:54:52 +01:00
|
|
|
|
|
|
|
extern ConVar* rcon_address;
|
|
|
|
extern ConVar* rcon_password;
|
2022-04-29 20:12:54 +02:00
|
|
|
|
|
|
|
extern ConVar* r_debug_overlay_nodecay;
|
2022-07-10 14:30:28 +02:00
|
|
|
extern ConVar* r_debug_overlay_invisible;
|
|
|
|
extern ConVar* r_debug_overlay_wireframe;
|
2022-07-11 21:23:26 +02:00
|
|
|
extern ConVar* r_debug_overlay_zbuffer;
|
2022-04-29 20:12:54 +02:00
|
|
|
extern ConVar* r_drawWorldMeshes;
|
|
|
|
extern ConVar* r_drawWorldMeshesDepthOnly;
|
|
|
|
extern ConVar* r_drawWorldMeshesDepthAtTheEnd;
|
2022-07-20 22:50:55 +01:00
|
|
|
|
|
|
|
extern ConVar* stream_overlay;
|
2021-12-25 22:36:38 +01:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
// SERVER |
|
2022-04-03 03:10:48 +02:00
|
|
|
extern ConVar* ai_ainDumpOnLoad;
|
|
|
|
extern ConVar* ai_ainDebugConnect;
|
2022-07-11 12:00:08 +02:00
|
|
|
extern ConVar* ai_script_nodes_draw;
|
|
|
|
extern ConVar* ai_script_nodes_draw_index;
|
2022-07-20 21:23:56 +02:00
|
|
|
|
2022-03-18 03:14:07 +01:00
|
|
|
extern ConVar* navmesh_always_reachable;
|
2022-07-20 21:23:56 +02:00
|
|
|
extern ConVar* navmesh_debug_type;
|
|
|
|
extern ConVar* navmesh_draw_bvtree;
|
2022-07-21 01:24:07 +02:00
|
|
|
extern ConVar* navmesh_draw_portal;
|
2022-07-21 02:21:59 +02:00
|
|
|
extern ConVar* navmesh_draw_poly_bounds;
|
|
|
|
extern ConVar* navmesh_draw_poly_inner;
|
2022-07-20 21:23:56 +02:00
|
|
|
|
2021-12-25 22:36:38 +01:00
|
|
|
extern ConVar* sv_showconnecting;
|
2022-05-24 19:26:05 +02:00
|
|
|
extern ConVar* sv_pylonVisibility;
|
2022-03-27 11:42:24 +02:00
|
|
|
extern ConVar* sv_pylonRefreshInterval;
|
|
|
|
extern ConVar* sv_banlistRefreshInterval;
|
|
|
|
extern ConVar* sv_statusRefreshInterval;
|
2022-02-08 16:32:00 +01:00
|
|
|
#ifdef DEDICATED
|
2022-02-14 03:02:38 +01:00
|
|
|
extern ConVar* sv_rcon_debug;
|
2022-02-06 15:54:52 +01:00
|
|
|
extern ConVar* sv_rcon_banpenalty;
|
|
|
|
extern ConVar* sv_rcon_maxfailures;
|
2022-02-08 16:32:00 +01:00
|
|
|
extern ConVar* sv_rcon_maxignores;
|
|
|
|
extern ConVar* sv_rcon_maxsockets;
|
2022-02-06 15:54:52 +01:00
|
|
|
extern ConVar* sv_rcon_whitelist_address;
|
2022-02-08 16:32:00 +01:00
|
|
|
#endif // DEDICATED
|
2021-12-25 22:36:38 +01:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
// CLIENT |
|
2022-02-08 16:32:00 +01:00
|
|
|
#ifndef DEDICATED
|
2021-12-25 22:36:38 +01:00
|
|
|
extern ConVar* cl_drawconsoleoverlay;
|
|
|
|
extern ConVar* cl_consoleoverlay_lines;
|
2022-02-28 01:01:40 +01:00
|
|
|
extern ConVar* cl_consoleoverlay_invert_rect_x;
|
|
|
|
extern ConVar* cl_consoleoverlay_invert_rect_y;
|
2021-12-25 22:36:38 +01:00
|
|
|
extern ConVar* cl_consoleoverlay_offset_x;
|
|
|
|
extern ConVar* cl_consoleoverlay_offset_y;
|
2022-02-17 18:00:29 +01:00
|
|
|
|
|
|
|
extern ConVar* cl_conoverlay_script_server_clr;
|
|
|
|
extern ConVar* cl_conoverlay_script_client_clr;
|
|
|
|
extern ConVar* cl_conoverlay_script_ui_clr;
|
|
|
|
extern ConVar* cl_conoverlay_native_server_clr;
|
|
|
|
extern ConVar* cl_conoverlay_native_client_clr;
|
|
|
|
extern ConVar* cl_conoverlay_native_ui_clr;
|
|
|
|
extern ConVar* cl_conoverlay_native_engine_clr;
|
|
|
|
extern ConVar* cl_conoverlay_native_fs_clr;
|
|
|
|
extern ConVar* cl_conoverlay_native_rtech_clr;
|
|
|
|
extern ConVar* cl_conoverlay_native_ms_clr;
|
|
|
|
extern ConVar* cl_conoverlay_netcon_clr;
|
|
|
|
extern ConVar* cl_conoverlay_warning_clr;
|
|
|
|
extern ConVar* cl_conoverlay_error_clr;
|
2022-01-08 02:05:33 +01:00
|
|
|
|
2022-02-28 01:01:40 +01:00
|
|
|
extern ConVar* cl_showhoststats;
|
|
|
|
extern ConVar* cl_hoststats_invert_rect_x;
|
|
|
|
extern ConVar* cl_hoststats_invert_rect_y;
|
|
|
|
extern ConVar* cl_hoststats_offset_x;
|
|
|
|
extern ConVar* cl_hoststats_offset_y;
|
|
|
|
|
2022-01-08 02:05:33 +01:00
|
|
|
extern ConVar* cl_showsimstats;
|
2022-02-28 01:01:40 +01:00
|
|
|
extern ConVar* cl_simstats_invert_rect_x;
|
|
|
|
extern ConVar* cl_simstats_invert_rect_y;
|
2022-01-08 02:05:33 +01:00
|
|
|
extern ConVar* cl_simstats_offset_x;
|
|
|
|
extern ConVar* cl_simstats_offset_y;
|
|
|
|
|
2022-02-28 01:01:40 +01:00
|
|
|
extern ConVar* cl_showgpustats;
|
|
|
|
extern ConVar* cl_gpustats_invert_rect_x;
|
|
|
|
extern ConVar* cl_gpustats_invert_rect_y;
|
2022-01-08 02:05:33 +01:00
|
|
|
extern ConVar* cl_gpustats_offset_x;
|
|
|
|
extern ConVar* cl_gpustats_offset_y;
|
2022-01-17 23:20:03 +01:00
|
|
|
|
2022-07-01 22:33:48 +01:00
|
|
|
extern ConVar* cl_showmaterialinfo;
|
|
|
|
extern ConVar* cl_materialinfo_offset_x;
|
|
|
|
extern ConVar* cl_materialinfo_offset_y;
|
|
|
|
|
2022-01-22 15:51:09 +01:00
|
|
|
extern ConVar* con_max_size_logvector;
|
2022-01-17 23:20:03 +01:00
|
|
|
extern ConVar* con_suggestion_limit;
|
2022-04-26 20:24:51 +02:00
|
|
|
extern ConVar* con_suggestion_showhelptext;
|
|
|
|
extern ConVar* con_suggestion_showflags;
|
|
|
|
extern ConVar* con_suggestion_flags_realtime;
|
2022-02-08 16:32:00 +01:00
|
|
|
#endif // !DEDICATED
|
2021-12-25 22:36:38 +01:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
// FILESYSTEM |
|
2022-01-20 00:59:31 +01:00
|
|
|
extern ConVar* fs_warning_level_sdk;
|
2022-01-14 20:45:36 +01:00
|
|
|
extern ConVar* fs_show_warning_output;
|
2021-12-25 22:36:38 +01:00
|
|
|
extern ConVar* fs_packedstore_entryblock_stats;
|
2022-06-02 01:57:18 +02:00
|
|
|
extern ConVar* fs_packedstore_workspace;
|
2021-12-25 22:36:38 +01:00
|
|
|
//-------------------------------------------------------------------------
|
2022-01-05 22:56:49 +01:00
|
|
|
// MATERIALSYSTEM |
|
2022-02-08 16:32:00 +01:00
|
|
|
#ifndef DEDICATED
|
2021-12-25 22:36:38 +01:00
|
|
|
extern ConVar* mat_showdxoutput;
|
2022-02-08 16:32:00 +01:00
|
|
|
#endif // !DEDICATED
|
2021-12-25 22:36:38 +01:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
// SQUIRREL |
|
|
|
|
extern ConVar* sq_showrsonloading;
|
|
|
|
extern ConVar* sq_showscriptloading;
|
|
|
|
extern ConVar* sq_showvmoutput;
|
|
|
|
extern ConVar* sq_showvmwarning;
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
// NETCHANNEL |
|
2022-04-27 18:22:08 +02:00
|
|
|
extern ConVar* net_tracePayload;
|
|
|
|
extern ConVar* net_encryptionEnable;
|
|
|
|
extern ConVar* net_useRandomKey;
|
2022-04-14 19:18:59 +02:00
|
|
|
extern ConVar* net_usesocketsforloopback;
|
2022-07-01 10:29:27 +02:00
|
|
|
extern ConVar* pylon_matchmaking_hostname;
|
|
|
|
extern ConVar* pylon_showdebug;
|
2022-03-27 11:42:24 +02:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
// RTECH API |
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
// RUI |
|
2022-03-23 23:28:12 +01:00
|
|
|
#ifndef DEDICATED
|
|
|
|
extern ConVar* rui_drawEnable;
|
|
|
|
#endif // !DEDICATED
|
2021-12-25 22:36:38 +01:00
|
|
|
|
2022-01-09 16:14:17 +01:00
|
|
|
class CCVarIteratorInternal // Fully reversed table, just look at the virtual function table and rename the function.
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void SetFirst(void) = 0; //0
|
|
|
|
virtual void Next(void) = 0; //1
|
|
|
|
virtual bool IsValid(void) = 0; //2
|
|
|
|
virtual ConCommandBase* Get(void) = 0; //3
|
|
|
|
};
|
|
|
|
|
|
|
|
class CCVar
|
|
|
|
{
|
|
|
|
public:
|
2022-04-14 19:18:59 +02:00
|
|
|
ConCommandBase* RegisterConCommand(ConCommandBase* pCommandToAdd);
|
|
|
|
ConCommandBase* UnregisterConCommand(ConCommandBase* pCommandToRemove);
|
2022-01-09 16:14:17 +01:00
|
|
|
ConCommandBase* FindCommandBase(const char* pszCommandName); // @0x1405983A0 in R5pc_r5launch_N1094_CL456479_2019_10_30_05_20_PM
|
|
|
|
ConVar* FindVar(const char* pszVarName); // @0x1405983B0 in R5pc_r5launch_N1094_CL456479_2019_10_30_05_20_PM
|
|
|
|
ConCommand* FindCommand(const char* pszCommandName);
|
2022-04-14 19:18:59 +02:00
|
|
|
CCVarIteratorInternal* FactoryInternalIterator(void);
|
|
|
|
unordered_map<string, ConCommandBase*> DumpToMap(void);
|
2022-01-09 16:14:17 +01:00
|
|
|
};
|
|
|
|
|
2021-12-25 22:36:38 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2022-01-10 01:31:25 +01:00
|
|
|
extern CCVar* g_pCVar;
|
2021-12-25 22:36:38 +01:00
|
|
|
|
2022-04-09 06:05:47 +02:00
|
|
|
/* ==== CCVAR =========================================================================================================================================================== */
|
2022-04-18 03:35:08 +02:00
|
|
|
inline CMemory p_CCVar_Disconnect;
|
|
|
|
inline auto CCVar_Disconnect = p_CCVar_Disconnect.RCast<void* (*)(void)>();
|
|
|
|
|
|
|
|
inline CMemory p_CCVar_GetCommandLineValue;
|
|
|
|
inline auto CCVar_GetCommandLineValue = p_CCVar_GetCommandLineValue.RCast<const char* (*)(CCVar* thisptr, const char* pVariableName)>();
|
2021-12-25 22:36:38 +01:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2022-05-13 14:53:25 +02:00
|
|
|
class VCVar : public IDetour
|
2021-12-25 22:36:38 +01:00
|
|
|
{
|
2022-04-11 01:44:30 +02:00
|
|
|
virtual void GetAdr(void) const
|
2021-12-25 22:36:38 +01:00
|
|
|
{
|
2022-05-13 14:53:25 +02:00
|
|
|
spdlog::debug("| FUN: CCVar::Disconnect : {:#18x} |\n", p_CCVar_Disconnect.GetPtr());
|
|
|
|
spdlog::debug("| FUN: CCVar::GetCommandLineValue : {:#18x} |\n", p_CCVar_GetCommandLineValue.GetPtr());
|
|
|
|
spdlog::debug("| VAR: g_pCVar : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_pCVar));
|
|
|
|
spdlog::debug("+----------------------------------------------------------------+\n");
|
2021-12-25 22:36:38 +01:00
|
|
|
}
|
2022-04-18 03:35:08 +02:00
|
|
|
virtual void GetFun(void) const
|
|
|
|
{
|
|
|
|
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
|
|
|
p_CCVar_Disconnect = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x57\x41\x56\x48\x83\xEC\x38\x4C\x8B\x35"), "xxxxxxxxxxx");
|
|
|
|
CCVar_Disconnect = p_CCVar_Disconnect.RCast<void* (*)(void)>(); /*40 57 41 56 48 83 EC 38 4C 8B 35 ? ? ? ?*/
|
|
|
|
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
|
|
|
p_CCVar_Disconnect = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x28\x48\x8B\x0D\x00\x00\x00\x00\x48\x85\xC9\x74\x26\x80\x3D\x00\x00\x00\x00\x00\x74\x1D\x48\x8B\x01\x8B\x15\x00\x00\x00\x00\xFF\x50\x58\xC7\x05\x00\x00\x00\x00\x00\x00\x00\x00\xC6\x05\x00\x00\x00\x00\x00\x48\xC7\x05\x00\x00\x00"), "xxxxxxx????xxxxxxx?????xxxxxxx????xxxxx????????xx");
|
|
|
|
CCVar_Disconnect = p_CCVar_Disconnect.RCast<void* (*)(void)>(); /*48 83 EC 28 48 8B 0D ? ? ? ? 48 85 C9 74 26 80 3D ? ? ? ? ? 74 1D 48 8B 01 8B 15 ? ? ? ? FF 50 58 C7 05 ? ? ? ? ? ? ? ? C6 05 ? ? ? ? ? 48 C7 05 ? ? ? ? ? ? ? ?*/
|
|
|
|
#endif
|
|
|
|
p_CCVar_GetCommandLineValue = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x55\x48\x83\xEC\x20\x48\x8D\x6C\x24\x00\x48\x89\x5D\x10\x49\xC7\xC0\x00\x00\x00\x00"), "xxxxxxxxxx?xxxxxxx????");
|
|
|
|
CCVar_GetCommandLineValue = p_CCVar_GetCommandLineValue.RCast<const char* (*)(CCVar* thisptr, const char* pVariableName)>(); /*40 55 48 83 EC 20 48 8D 6C 24 ? 48 89 5D 10 49 C7 C0 ? ? ? ?*/
|
|
|
|
}
|
|
|
|
virtual void GetVar(void) const
|
|
|
|
{
|
|
|
|
g_pCVar = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>(
|
|
|
|
"\x48\x83\xEC\x28\x48\x8B\x05\x00\x00\x00\x00\x48\x8D\x0D\x00\x00\x00\x00\x48\x85\xC0\x48\x89\x15"),
|
|
|
|
"xxxxxxx????xxx????xxxxxx").FindPatternSelf("48 8D 0D", CMemory::Direction::DOWN, 40).ResolveRelativeAddressSelf(0x3, 0x7).RCast<CCVar*>();
|
|
|
|
}
|
2022-04-11 01:44:30 +02:00
|
|
|
virtual void GetCon(void) const { }
|
|
|
|
virtual void Attach(void) const { }
|
|
|
|
virtual void Detach(void) const { }
|
2021-12-25 22:36:38 +01:00
|
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2022-05-13 14:53:25 +02:00
|
|
|
REGISTER(VCVar);
|