r5sdk/r5dev/client/vengineclient_impl.h
Kawe Mazidjatari 5548a74d59 Major cleanup (see description)
* Fix all compiler error for GameSDK on S0 and S1.
* Remove some unused patterns and globals (launch performance gains of 100ms).
* Remove most duplicate patterns.
* Relocate globals from engine to a more appropriate location.
* Renamed some unknown vars to a more appropriate name (most of these where obtained a while back, but as we reversed more parts of the engine, some of these vars become known).
* Renamed some vars to fit the naming convention used in the SDK.
* Fixed pattern debug logging using the wrong pointer, thus displaying the wrong address.
2022-08-18 02:15:23 +02:00

38 lines
1.4 KiB
C++

#pragma once
class CEngineClient
{
public:
void SetRestrictServerCommands(bool bRestrict);
bool GetRestrictServerCommands() const;
void SetRestrictClientCommands(bool bRestrict);
bool GetRestrictClientCommands() const;
int GetLocalPlayer(); // Local player index.
};
/* ==== CVENGINECLIENT ================================================================================================================================================== */
///////////////////////////////////////////////////////////////////////////////
inline CMemory g_pEngineClientVFTable = nullptr;
inline CEngineClient* g_pEngineClient = nullptr;
///////////////////////////////////////////////////////////////////////////////
class HVEngineClient : public IDetour
{
virtual void GetAdr(void) const
{
spdlog::debug("| CON: g_pEngineClientVFTable : {:#18x} |\n", g_pEngineClientVFTable.GetPtr());
spdlog::debug("+----------------------------------------------------------------+\n");
}
virtual void GetFun(void) const { }
virtual void GetVar(void) const { }
virtual void GetCon(void) const
{
g_pEngineClientVFTable = g_GameDll.GetVirtualMethodTable(".?AVCEngineClient@@");
g_pEngineClient = g_pEngineClientVFTable.RCast<CEngineClient*>();
}
virtual void Attach(void) const { }
virtual void Detach(void) const { }
};
///////////////////////////////////////////////////////////////////////////////
REGISTER(HVEngineClient);