mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Obtain debug overlay interface through factory
This commit is contained in:
parent
4b5d24a51f
commit
2cd28ab304
@ -30,6 +30,7 @@
|
||||
#include "game/client/cliententitylist.h"
|
||||
#include "gameui/IConsole.h"
|
||||
#endif // !DEDICATED
|
||||
#include "public/idebugoverlay.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
@ -74,14 +75,15 @@ bool CModAppSystemGroup::Create(CModAppSystemGroup* pModAppSystemGroup)
|
||||
//InitPluginSystem(pModAppSystemGroup);
|
||||
//CALL_PLUGIN_CALLBACKS(g_pPluginSystem->GetCreateCallbacks(), pModAppSystemGroup);
|
||||
|
||||
g_pDebugOverlay = g_pFactory->GetFactoryPtr(VDEBUG_OVERLAY_INTERFACE_VERSION, false).RCast<CIVDebugOverlay*>();
|
||||
#ifndef CLIENT_DLL
|
||||
g_pServerGameDLL = g_pFactory->GetFactoryPtr(INTERFACEVERSION_SERVERGAMEDLL, false).RCast<CServerGameDLL*>();
|
||||
g_pServerGameClients = g_pFactory->GetFactoryPtr(INTERFACEVERSION_SERVERGAMECLIENTS_NEW, false).RCast<CServerGameClients*>();
|
||||
if (!g_pServerGameClients)
|
||||
g_pServerGameClients = g_pFactory->GetFactoryPtr(INTERFACEVERSION_SERVERGAMECLIENTS, false).RCast<CServerGameClients*>();
|
||||
g_pServerGameEntities = g_pFactory->GetFactoryPtr(INTERFACEVERSION_SERVERGAMEENTS, false).RCast<CServerGameEnts*>();
|
||||
#endif // !CLIENT_DLL
|
||||
|
||||
#endif // !CLIENT_DLL
|
||||
#ifndef DEDICATED
|
||||
g_pClientEntityList = g_pFactory->GetFactoryPtr(VCLIENTENTITYLIST_INTERFACE_VERSION, false).RCast<CClientEntityList*>();
|
||||
g_pEngineTraceClient = g_pFactory->GetFactoryPtr(INTERFACEVERSION_ENGINETRACE_CLIENT, false).RCast<CEngineTraceClient*>();
|
||||
|
@ -40,26 +40,4 @@ public:
|
||||
};
|
||||
|
||||
inline CIVDebugOverlay* g_pDebugOverlay = nullptr;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class VDebugOverlayBase : public IDetour
|
||||
{
|
||||
virtual void GetAdr(void) const
|
||||
{
|
||||
spdlog::debug("| VAR: g_pDebugOverlay : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_pDebugOverlay));
|
||||
spdlog::debug("+----------------------------------------------------------------+\n");
|
||||
}
|
||||
virtual void GetFun(void) const { }
|
||||
virtual void GetVar(void) const
|
||||
{
|
||||
g_pDebugOverlay = g_GameDll.FindPatternSIMD("48 8D 05 ?? ?? ?? ?? C3 CC CC CC CC CC CC CC CC 48 8D 05 ?? ?? ?? ?? C3 CC CC CC CC CC CC CC CC 48 83 EC 28 F3 0F 10 41 ??")
|
||||
.ResolveRelativeAddressSelf(0x3, 0x7).RCast<CIVDebugOverlay*>();
|
||||
}
|
||||
virtual void GetCon(void) const { }
|
||||
virtual void Attach(void) const { }
|
||||
virtual void Detach(void) const { }
|
||||
};
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
REGISTER(VDebugOverlayBase);
|
||||
#endif // IDEBUGOVERLAY_H
|
Loading…
x
Reference in New Issue
Block a user