2022-02-24 01:51:11 +01:00
|
|
|
//=============================================================================//
|
|
|
|
//
|
|
|
|
// Purpose: Interface server dll virtual functions to the SDK.
|
|
|
|
//
|
|
|
|
// $NoKeywords: $
|
|
|
|
//=============================================================================//
|
2023-01-19 15:25:45 +01:00
|
|
|
#ifndef GAMEINTERFACE_H
|
|
|
|
#define GAMEINTERFACE_H
|
2023-01-16 21:09:21 +01:00
|
|
|
#include "public/eiface.h"
|
2022-02-24 01:51:11 +01:00
|
|
|
|
2023-01-16 21:09:21 +01:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Forward declarations
|
|
|
|
//-----------------------------------------------------------------------------
|
2022-12-03 02:57:11 +01:00
|
|
|
class ServerClass;
|
|
|
|
|
2023-01-16 21:09:21 +01:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------
|
2022-02-24 01:51:11 +01:00
|
|
|
class CServerGameDLL
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void GameInit(void);
|
|
|
|
void PrecompileScriptsJob(void);
|
|
|
|
void LevelShutdown(void);
|
|
|
|
void GameShutdown(void);
|
|
|
|
float GetTickInterval(void);
|
2022-12-03 02:57:11 +01:00
|
|
|
ServerClass* GetAllServerClasses(void);
|
2022-09-18 20:42:16 +01:00
|
|
|
|
|
|
|
static void __fastcall OnReceivedSayTextMessage(void* thisptr, int senderId, const char* text, bool isTeamChat);
|
2022-02-24 01:51:11 +01:00
|
|
|
};
|
2023-01-16 21:09:21 +01:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
class CServerGameClients : public IServerGameClients
|
|
|
|
{
|
|
|
|
};
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
class CServerGameEnts : public IServerGameEnts
|
2022-04-12 02:48:46 +02:00
|
|
|
{
|
|
|
|
};
|
2022-02-24 01:51:11 +01:00
|
|
|
|
2022-09-18 20:42:16 +01:00
|
|
|
inline CMemory p_CServerGameDLL__OnReceivedSayTextMessage;
|
|
|
|
inline auto CServerGameDLL__OnReceivedSayTextMessage = p_CServerGameDLL__OnReceivedSayTextMessage.RCast<void(__fastcall*)(void* thisptr, int senderId, const char* text, bool isTeamChat)>();
|
|
|
|
|
2023-01-24 00:53:45 +01:00
|
|
|
inline CMemory p_RunFrameServer;
|
|
|
|
inline auto v_RunFrameServer = p_RunFrameServer.RCast<void(*)(double flFrameTime, bool bRunOverlays, bool bUniformUpdate)>();
|
|
|
|
|
2022-02-24 01:51:11 +01:00
|
|
|
extern CServerGameDLL* g_pServerGameDLL;
|
2022-04-12 02:48:46 +02:00
|
|
|
extern CServerGameClients* g_pServerGameClients;
|
2023-01-16 21:09:21 +01:00
|
|
|
extern CServerGameEnts* g_pServerGameEntities;
|
2022-02-24 01:51:11 +01:00
|
|
|
|
2023-01-20 14:07:25 +01:00
|
|
|
extern CGlobalVars** g_pGlobals;
|
2023-01-17 11:21:10 +01:00
|
|
|
|
2022-02-24 01:51:11 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2022-05-13 14:53:25 +02:00
|
|
|
class VServerGameDLL : public IDetour
|
2022-02-24 01:51:11 +01:00
|
|
|
{
|
2022-04-11 01:44:30 +02:00
|
|
|
virtual void GetAdr(void) const
|
2022-02-24 01:51:11 +01:00
|
|
|
{
|
2023-01-25 02:26:52 +01:00
|
|
|
LogFunAdr("CServerGameDLL::OnReceivedSayTextMessage", p_CServerGameDLL__OnReceivedSayTextMessage.GetPtr());
|
|
|
|
LogFunAdr("RunFrameServer", p_RunFrameServer.GetPtr());
|
|
|
|
LogVarAdr("g_pServerGameDLL", reinterpret_cast<uintptr_t>(g_pServerGameDLL));
|
|
|
|
LogVarAdr("g_pServerGameClients", reinterpret_cast<uintptr_t>(g_pServerGameClients));
|
|
|
|
LogVarAdr("g_pServerGameEntities", reinterpret_cast<uintptr_t>(g_pServerGameEntities));
|
|
|
|
LogVarAdr("g_pGlobals", reinterpret_cast<uintptr_t>(g_pGlobals));
|
2022-02-24 01:51:11 +01:00
|
|
|
}
|
2022-09-18 20:42:16 +01:00
|
|
|
virtual void GetFun(void) const
|
|
|
|
{
|
2023-03-01 00:09:38 +01:00
|
|
|
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
|
|
|
p_CServerGameDLL__OnReceivedSayTextMessage = g_GameDll.FindPatternSIMD("40 55 57 41 55 41 56 41 57 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 4C 8B 15 ?? ?? ?? ??");
|
|
|
|
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
2022-12-01 22:44:55 +01:00
|
|
|
p_CServerGameDLL__OnReceivedSayTextMessage = g_GameDll.FindPatternSIMD("85 D2 0F 8E ?? ?? ?? ?? 4C 8B DC");
|
2023-03-01 00:09:38 +01:00
|
|
|
#endif
|
2022-09-18 20:42:16 +01:00
|
|
|
CServerGameDLL__OnReceivedSayTextMessage = p_CServerGameDLL__OnReceivedSayTextMessage.RCast<void(__fastcall*)(void* thisptr, int senderId, const char* text, bool isTeamChat)>();
|
2023-01-24 00:53:45 +01:00
|
|
|
|
|
|
|
p_RunFrameServer = g_GameDll.FindPatternSIMD("48 89 5C 24 ?? 57 48 83 EC 30 0F 29 74 24 ?? 48 8D 0D ?? ?? ?? ??");
|
|
|
|
v_RunFrameServer = p_RunFrameServer.RCast<void(*)(double, bool, bool)>();
|
2022-09-18 20:42:16 +01:00
|
|
|
}
|
2023-01-17 11:21:10 +01:00
|
|
|
virtual void GetVar(void) const
|
|
|
|
{
|
2023-01-20 14:07:25 +01:00
|
|
|
g_pGlobals = g_GameDll.FindPatternSIMD("4C 8B 0D ?? ?? ?? ?? 48 8B D1").ResolveRelativeAddressSelf(0x3, 0x7).RCast<CGlobalVars**>();
|
2023-01-17 11:21:10 +01:00
|
|
|
}
|
2022-04-11 01:44:30 +02:00
|
|
|
virtual void GetCon(void) const { }
|
2023-01-25 02:26:52 +01:00
|
|
|
virtual void Attach(void) const;
|
|
|
|
virtual void Detach(void) const;
|
2022-02-24 01:51:11 +01:00
|
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2023-01-19 15:25:45 +01:00
|
|
|
#endif // GAMEINTERFACE_H
|