diff --git a/rehlds/engine/sys_dll.cpp b/rehlds/engine/sys_dll.cpp index 293119d2..c7434d0a 100644 --- a/rehlds/engine/sys_dll.cpp +++ b/rehlds/engine/sys_dll.cpp @@ -677,6 +677,11 @@ qboolean EXT_FUNC Voice_SetClientListening(int iReceiver, int iSender, qboolean } DISPATCHFUNCTION GetDispatch(char *pname) +{ + return g_RehldsHookchains.m_GetDispatch.callChain(GetDispatch_Internal, pname); +} + +DISPATCHFUNCTION GetDispatch_Internal(char* pname) { int i; DISPATCHFUNCTION pDispatch; diff --git a/rehlds/engine/sys_dll.h b/rehlds/engine/sys_dll.h index adab1551..66ea83c9 100644 --- a/rehlds/engine/sys_dll.h +++ b/rehlds/engine/sys_dll.h @@ -115,6 +115,7 @@ NOBODY void GameSetBackground(qboolean bNewSetting); qboolean Voice_GetClientListening(int iReceiver, int iSender); qboolean Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen); DISPATCHFUNCTION GetDispatch(char *pname); +DISPATCHFUNCTION GetDispatch_Internal(char* pname); const char *FindAddressInTable(extensiondll_t *pDll, uint32 function); uint32 FindNameInTable(extensiondll_t *pDll, const char *pName); NOBODY const char *ConvertNameToLocalPlatform(const char *pchInName); diff --git a/rehlds/public/rehlds/rehlds_api.h b/rehlds/public/rehlds/rehlds_api.h index bc835819..356d75d6 100644 --- a/rehlds/public/rehlds/rehlds_api.h +++ b/rehlds/public/rehlds/rehlds_api.h @@ -37,7 +37,7 @@ #include "pr_dlls.h" #define REHLDS_API_VERSION_MAJOR 3 -#define REHLDS_API_VERSION_MINOR 13 +#define REHLDS_API_VERSION_MINOR 14 //Steam_NotifyClientConnect hook typedef IHookChain IRehldsHook_Steam_NotifyClientConnect; @@ -259,6 +259,10 @@ typedef IVoidHookChainRegistry IRehldsHookRegistry_SV_ClientPrintf typedef IHookChain IRehldsHook_SV_AllowPhysent; typedef IHookChainRegistry IRehldsHookRegistry_SV_AllowPhysent; +//GetDispatch hook +typedef IHookChain IRehldsHook_GetDispatch; +typedef IHookChainRegistry IRehldsHookRegistry_GetDispatch; + class IRehldsHookchains { public: virtual ~IRehldsHookchains() { } @@ -318,6 +322,7 @@ class IRehldsHookchains { virtual IRehldsHookRegistry_SV_AddResource* SV_AddResource() = 0; virtual IRehldsHookRegistry_SV_ClientPrintf* SV_ClientPrintf() = 0; virtual IRehldsHookRegistry_SV_AllowPhysent* SV_AllowPhysent() = 0; + virtual IRehldsHookRegistry_GetDispatch* GetDispatch() = 0; }; struct RehldsFuncs_t { diff --git a/rehlds/rehlds/rehlds_api_impl.cpp b/rehlds/rehlds/rehlds_api_impl.cpp index d1862203..94af4212 100644 --- a/rehlds/rehlds/rehlds_api_impl.cpp +++ b/rehlds/rehlds/rehlds_api_impl.cpp @@ -883,6 +883,10 @@ IRehldsHookRegistry_SV_AllowPhysent* CRehldsHookchains::SV_AllowPhysent() { return &m_SV_AllowPhysent; } +EXT_FUNC IRehldsHookRegistry_GetDispatch* CRehldsHookchains::GetDispatch() { + return &m_GetDispatch; +} + int EXT_FUNC CRehldsApi::GetMajorVersion() { return REHLDS_API_VERSION_MAJOR; diff --git a/rehlds/rehlds/rehlds_api_impl.h b/rehlds/rehlds/rehlds_api_impl.h index 699bd164..b5829f14 100644 --- a/rehlds/rehlds/rehlds_api_impl.h +++ b/rehlds/rehlds/rehlds_api_impl.h @@ -254,6 +254,10 @@ typedef IVoidHookChainRegistryImpl CRehldsHookRegistry_SV_ClientPri typedef IHookChainImpl CRehldsHook_SV_AllowPhysent; typedef IHookChainRegistryImpl CRehldsHookRegistry_SV_AllowPhysent; +//GetDispatch hook +typedef IHookChainImpl CRehldsHook_GetDispatch; +typedef IHookChainRegistryImpl CRehldsHookRegistry_GetDispatch; + class CRehldsHookchains : public IRehldsHookchains { public: CRehldsHookRegistry_Steam_NotifyClientConnect m_Steam_NotifyClientConnect; @@ -311,6 +315,7 @@ class CRehldsHookchains : public IRehldsHookchains { CRehldsHookRegistry_SV_AddResource m_SV_AddResource; CRehldsHookRegistry_SV_ClientPrintf m_SV_ClientPrintf; CRehldsHookRegistry_SV_AllowPhysent m_SV_AllowPhysent; + CRehldsHookRegistry_GetDispatch m_GetDispatch; public: EXT_FUNC virtual IRehldsHookRegistry_Steam_NotifyClientConnect* Steam_NotifyClientConnect(); @@ -368,6 +373,7 @@ class CRehldsHookchains : public IRehldsHookchains { EXT_FUNC virtual IRehldsHookRegistry_SV_AddResource* SV_AddResource(); EXT_FUNC virtual IRehldsHookRegistry_SV_ClientPrintf* SV_ClientPrintf(); EXT_FUNC virtual IRehldsHookRegistry_SV_AllowPhysent* SV_AllowPhysent(); + EXT_FUNC virtual IRehldsHookRegistry_GetDispatch* GetDispatch(); }; extern CRehldsHookchains g_RehldsHookchains;