2021-12-25 22:36:38 +01:00
|
|
|
#pragma once
|
2023-01-16 21:09:21 +01:00
|
|
|
#include "public/edict.h"
|
2023-01-16 23:05:36 +01:00
|
|
|
#include "public/eiface.h"
|
2023-01-16 16:54:01 +01:00
|
|
|
|
2022-04-09 02:18:57 +02:00
|
|
|
/* ==== CVENGINESERVER ================================================================================================================================================== */
|
2024-01-02 15:21:36 +01:00
|
|
|
inline bool(*CVEngineServer__PersistenceAvailable)(void* entidx, int clientidx);
|
2022-01-26 23:43:16 +01:00
|
|
|
|
2023-01-31 22:40:15 +01:00
|
|
|
inline bool* m_bIsDedicated = nullptr;
|
2021-12-25 22:36:38 +01:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2022-09-18 23:19:50 +02:00
|
|
|
|
2023-01-16 23:05:36 +01:00
|
|
|
class CVEngineServer : public IVEngineServer
|
|
|
|
{
|
2023-01-17 00:32:08 +01:00
|
|
|
public:
|
|
|
|
static bool PersistenceAvailable(void* entidx, int clientidx);
|
2023-01-17 00:07:53 +01:00
|
|
|
// Implementation in GameDLL.
|
2023-01-16 23:05:36 +01:00
|
|
|
};
|
2023-01-17 00:07:53 +01:00
|
|
|
extern CVEngineServer* g_pEngineServer;
|
|
|
|
extern IVEngineServer* g_pEngineServerVFTable;
|
2023-01-16 23:05:36 +01:00
|
|
|
|
2021-12-25 22:36:38 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
class HVEngineServer : public IDetour
|
|
|
|
{
|
2022-04-11 01:44:30 +02:00
|
|
|
virtual void GetAdr(void) const
|
2021-12-25 22:36:38 +01:00
|
|
|
{
|
2024-01-02 15:21:36 +01:00
|
|
|
LogConAdr("CVEngineServer::`vftable'", g_pEngineServerVFTable);
|
|
|
|
LogFunAdr("CVEngineServer::PersistenceAvailable", CVEngineServer__PersistenceAvailable);
|
|
|
|
LogVarAdr("m_bIsDedicated", m_bIsDedicated); // !TODO: part of CServer!
|
2021-12-25 22:36:38 +01:00
|
|
|
}
|
2022-04-18 03:35:08 +02:00
|
|
|
virtual void GetFun(void) const
|
|
|
|
{
|
2024-01-02 15:21:36 +01:00
|
|
|
g_GameDll.FindPatternSIMD("3B 15 ?? ?? ?? ?? 7D 33").GetPtr(CVEngineServer__PersistenceAvailable);
|
2022-04-18 03:35:08 +02:00
|
|
|
}
|
|
|
|
virtual void GetVar(void) const
|
|
|
|
{
|
2023-01-17 00:32:08 +01:00
|
|
|
CMemory pEngineServerVFTable = g_GameDll.GetVirtualMethodTable(".?AVCVEngineServer@@", 0);
|
|
|
|
|
|
|
|
g_pEngineServerVFTable = pEngineServerVFTable.RCast<CVEngineServer*>();
|
2023-01-31 22:40:15 +01:00
|
|
|
m_bIsDedicated = pEngineServerVFTable.WalkVTableSelf(3).DerefSelf().ResolveRelativeAddress(0x3, 0x7).RCast<bool*>();
|
2022-04-18 03:35:08 +02:00
|
|
|
}
|
2022-04-11 01:44:30 +02:00
|
|
|
virtual void GetCon(void) const { }
|
2023-11-26 13:21:20 +01:00
|
|
|
virtual void Detour(const bool bAttach) const;
|
2021-12-25 22:36:38 +01:00
|
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|