2021-12-25 22:36:38 +01:00
|
|
|
#pragma once
|
|
|
|
|
2022-05-06 00:34:46 +02:00
|
|
|
class CEngineClient
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void SetRestrictServerCommands(bool bRestrict);
|
2022-05-07 12:28:58 +02:00
|
|
|
bool GetRestrictServerCommands() const;
|
2022-05-06 00:34:46 +02:00
|
|
|
void SetRestrictClientCommands(bool bRestrict);
|
2022-05-07 12:28:58 +02:00
|
|
|
bool GetRestrictClientCommands() const;
|
2022-07-24 14:05:38 +02:00
|
|
|
int GetLocalPlayer(); // Local player index.
|
2023-11-25 17:41:08 +01:00
|
|
|
|
|
|
|
// Hook statics:
|
|
|
|
static void _ClientCmd(CEngineClient* thisptr, const char* const szCmdString);
|
2022-05-06 00:34:46 +02:00
|
|
|
};
|
|
|
|
|
2022-04-09 02:18:57 +02:00
|
|
|
/* ==== CVENGINECLIENT ================================================================================================================================================== */
|
2021-12-25 22:36:38 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2023-11-25 17:41:08 +01:00
|
|
|
inline CMemory p_CEngineClient__ClientCmd;
|
|
|
|
inline void(*CEngineClient__ClientCmd)(CEngineClient* thisptr, const char* const szCmdString);
|
|
|
|
|
2022-08-15 22:29:16 +02:00
|
|
|
inline CMemory g_pEngineClientVFTable = nullptr;
|
|
|
|
inline CEngineClient* g_pEngineClient = nullptr;
|
2021-12-25 22:36:38 +01:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
class HVEngineClient : public IDetour
|
|
|
|
{
|
2022-04-11 01:44:30 +02:00
|
|
|
virtual void GetAdr(void) const
|
2021-12-25 22:36:38 +01:00
|
|
|
{
|
2023-01-25 11:19:53 +01:00
|
|
|
LogConAdr("CEngineClient::`vftable'", g_pEngineClientVFTable.GetPtr());
|
2023-11-25 17:41:08 +01:00
|
|
|
LogFunAdr("CEngineClient::ClientCmd", p_CEngineClient__ClientCmd.GetPtr());
|
|
|
|
}
|
|
|
|
virtual void GetFun(void) const
|
|
|
|
{
|
|
|
|
p_CEngineClient__ClientCmd = g_GameDll.FindPatternSIMD("40 53 48 83 EC 20 80 3D ?? ?? ?? ?? ?? 48 8B DA 74 0C");
|
|
|
|
CEngineClient__ClientCmd = p_CEngineClient__ClientCmd.RCast<void(*)(CEngineClient*, const char* const)>();
|
2021-12-25 22:36:38 +01:00
|
|
|
}
|
2022-08-15 22:29:16 +02:00
|
|
|
virtual void GetVar(void) const { }
|
2022-05-06 00:34:46 +02:00
|
|
|
virtual void GetCon(void) const
|
|
|
|
{
|
2022-08-15 22:29:16 +02:00
|
|
|
g_pEngineClientVFTable = g_GameDll.GetVirtualMethodTable(".?AVCEngineClient@@");
|
|
|
|
g_pEngineClient = g_pEngineClientVFTable.RCast<CEngineClient*>();
|
2022-04-18 03:35:08 +02:00
|
|
|
}
|
2023-11-26 13:21:20 +01:00
|
|
|
virtual void Detour(const bool bAttach) const;
|
2021-12-25 22:36:38 +01:00
|
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|