mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Fully implemented ConVar class so we could statically construct all SDK convars, this avoids a level of indirection, and allows for creating ConVar's everywhere in the project. This patch also removed the settings tab of the ImGui server browser, as it has threading issues, while it technically never caused a crash yet, it has been removed as there was no point keeping it vs the work required to make it thread save (it only managed 2 convars which are perfectly manageable through cfg's or the in-game console). Also temporarily disabled the creation of ConVar's in the mod system due to a memory leak, we would allocate and register a convar based on details parsed out of a mod file definition, but never unregister and free it.
53 lines
2.0 KiB
C++
53 lines
2.0 KiB
C++
#pragma once
|
|
|
|
inline bool(*v_SetupGamemode)(const char* pszPlayList);
|
|
|
|
/* ==== CONCOMMANDCALLBACK ============================================================================================================================================== */
|
|
inline void(*v__Cmd_Exec_f)(const CCommand& args);
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
void MP_GameMode_Changed_f(IConVar* pConVar, const char* pOldString);
|
|
#ifndef CLIENT_DLL
|
|
void Host_Changelevel_f(const CCommand& args);
|
|
#endif // !CLIENT_DLL
|
|
void VPK_Pack_f(const CCommand& args);
|
|
void VPK_Unpack_f(const CCommand& args);
|
|
void VPK_Mount_f(const CCommand& args);
|
|
void VPK_Unmount_f(const CCommand& args);
|
|
void NET_UseSocketsForLoopbackChanged_f(IConVar* pConVar, const char* pOldString);
|
|
#ifndef DEDICATED
|
|
|
|
void GFX_NVN_Changed_f(IConVar* pConVar, const char* pOldString);
|
|
#endif // !DEDICATED
|
|
void LanguageChanged_f(IConVar* pConVar, const char* pOldString);
|
|
#ifndef DEDICATED
|
|
void Mat_CrossHair_f(const CCommand& args);
|
|
void Line_f(const CCommand& args);
|
|
void Sphere_f(const CCommand& args);
|
|
void Capsule_f(const CCommand& args);
|
|
#endif // !DEDICATED
|
|
void BHit_f(const CCommand& args);
|
|
|
|
void CVHelp_f(const CCommand& args);
|
|
void CVList_f(const CCommand& args);
|
|
void CVDiff_f(const CCommand& args);
|
|
void CVFlag_f(const CCommand& args);
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
class VCallback : public IDetour
|
|
{
|
|
virtual void GetAdr(void) const
|
|
{
|
|
LogFunAdr("SetupGamemode", v_SetupGamemode);
|
|
LogFunAdr("Cmd_Exec_f", v__Cmd_Exec_f);
|
|
}
|
|
virtual void GetFun(void) const
|
|
{
|
|
g_GameDll.FindPatternSIMD("40 53 48 83 EC 20 48 8B D9 48 C7 C0 ?? ?? ?? ??").GetPtr(v_SetupGamemode);
|
|
g_GameDll.FindPatternSIMD("40 55 53 48 8D AC 24 ?? ?? ?? ?? B8 ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 2B E0 48 8B D9").GetPtr(v__Cmd_Exec_f);
|
|
}
|
|
virtual void GetVar(void) const { }
|
|
virtual void GetCon(void) const { }
|
|
virtual void Detour(const bool bAttach) const;
|
|
};
|
|
///////////////////////////////////////////////////////////////////////////////
|