mirror of
https://github.com/rehlds/rehlds.git
synced 2025-03-15 15:00:20 +03:00
Add GetDispatch hook
This commit is contained in:
parent
f955b07b69
commit
32348af364
@ -677,6 +677,11 @@ qboolean EXT_FUNC Voice_SetClientListening(int iReceiver, int iSender, qboolean
|
|||||||
}
|
}
|
||||||
|
|
||||||
DISPATCHFUNCTION GetDispatch(char *pname)
|
DISPATCHFUNCTION GetDispatch(char *pname)
|
||||||
|
{
|
||||||
|
return g_RehldsHookchains.m_GetDispatch.callChain(GetDispatch_Internal, pname);
|
||||||
|
}
|
||||||
|
|
||||||
|
DISPATCHFUNCTION GetDispatch_Internal(char* pname)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
DISPATCHFUNCTION pDispatch;
|
DISPATCHFUNCTION pDispatch;
|
||||||
|
@ -115,6 +115,7 @@ NOBODY void GameSetBackground(qboolean bNewSetting);
|
|||||||
qboolean Voice_GetClientListening(int iReceiver, int iSender);
|
qboolean Voice_GetClientListening(int iReceiver, int iSender);
|
||||||
qboolean Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen);
|
qboolean Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen);
|
||||||
DISPATCHFUNCTION GetDispatch(char *pname);
|
DISPATCHFUNCTION GetDispatch(char *pname);
|
||||||
|
DISPATCHFUNCTION GetDispatch_Internal(char* pname);
|
||||||
const char *FindAddressInTable(extensiondll_t *pDll, uint32 function);
|
const char *FindAddressInTable(extensiondll_t *pDll, uint32 function);
|
||||||
uint32 FindNameInTable(extensiondll_t *pDll, const char *pName);
|
uint32 FindNameInTable(extensiondll_t *pDll, const char *pName);
|
||||||
NOBODY const char *ConvertNameToLocalPlatform(const char *pchInName);
|
NOBODY const char *ConvertNameToLocalPlatform(const char *pchInName);
|
||||||
|
@ -259,6 +259,10 @@ typedef IVoidHookChainRegistry<const char *> IRehldsHookRegistry_SV_ClientPrintf
|
|||||||
typedef IHookChain<bool, edict_t*, edict_t*> IRehldsHook_SV_AllowPhysent;
|
typedef IHookChain<bool, edict_t*, edict_t*> IRehldsHook_SV_AllowPhysent;
|
||||||
typedef IHookChainRegistry<bool, edict_t*, edict_t*> IRehldsHookRegistry_SV_AllowPhysent;
|
typedef IHookChainRegistry<bool, edict_t*, edict_t*> IRehldsHookRegistry_SV_AllowPhysent;
|
||||||
|
|
||||||
|
//GetDispatch hook
|
||||||
|
typedef IHookChain<DISPATCHFUNCTION, char*> IRehldsHook_GetDispatch;
|
||||||
|
typedef IHookChainRegistry<DISPATCHFUNCTION, char*> IRehldsHookRegistry_GetDispatch;
|
||||||
|
|
||||||
class IRehldsHookchains {
|
class IRehldsHookchains {
|
||||||
public:
|
public:
|
||||||
virtual ~IRehldsHookchains() { }
|
virtual ~IRehldsHookchains() { }
|
||||||
@ -318,6 +322,7 @@ public:
|
|||||||
virtual IRehldsHookRegistry_SV_AddResource* SV_AddResource() = 0;
|
virtual IRehldsHookRegistry_SV_AddResource* SV_AddResource() = 0;
|
||||||
virtual IRehldsHookRegistry_SV_ClientPrintf* SV_ClientPrintf() = 0;
|
virtual IRehldsHookRegistry_SV_ClientPrintf* SV_ClientPrintf() = 0;
|
||||||
virtual IRehldsHookRegistry_SV_AllowPhysent* SV_AllowPhysent() = 0;
|
virtual IRehldsHookRegistry_SV_AllowPhysent* SV_AllowPhysent() = 0;
|
||||||
|
virtual IRehldsHookRegistry_GetDispatch* GetDispatch() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RehldsFuncs_t {
|
struct RehldsFuncs_t {
|
||||||
|
@ -883,6 +883,10 @@ IRehldsHookRegistry_SV_AllowPhysent* CRehldsHookchains::SV_AllowPhysent() {
|
|||||||
return &m_SV_AllowPhysent;
|
return &m_SV_AllowPhysent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EXT_FUNC IRehldsHookRegistry_GetDispatch* CRehldsHookchains::GetDispatch() {
|
||||||
|
return &m_GetDispatch;
|
||||||
|
}
|
||||||
|
|
||||||
int EXT_FUNC CRehldsApi::GetMajorVersion()
|
int EXT_FUNC CRehldsApi::GetMajorVersion()
|
||||||
{
|
{
|
||||||
return REHLDS_API_VERSION_MAJOR;
|
return REHLDS_API_VERSION_MAJOR;
|
||||||
|
@ -254,6 +254,10 @@ typedef IVoidHookChainRegistryImpl<const char*> CRehldsHookRegistry_SV_ClientPri
|
|||||||
typedef IHookChainImpl<bool, edict_t*, edict_t*> CRehldsHook_SV_AllowPhysent;
|
typedef IHookChainImpl<bool, edict_t*, edict_t*> CRehldsHook_SV_AllowPhysent;
|
||||||
typedef IHookChainRegistryImpl<bool, edict_t*, edict_t*> CRehldsHookRegistry_SV_AllowPhysent;
|
typedef IHookChainRegistryImpl<bool, edict_t*, edict_t*> CRehldsHookRegistry_SV_AllowPhysent;
|
||||||
|
|
||||||
|
//GetDispatch hook
|
||||||
|
typedef IHookChainImpl<DISPATCHFUNCTION, char*> CRehldsHook_GetDispatch;
|
||||||
|
typedef IHookChainRegistryImpl<DISPATCHFUNCTION, char*> CRehldsHookRegistry_GetDispatch;
|
||||||
|
|
||||||
class CRehldsHookchains : public IRehldsHookchains {
|
class CRehldsHookchains : public IRehldsHookchains {
|
||||||
public:
|
public:
|
||||||
CRehldsHookRegistry_Steam_NotifyClientConnect m_Steam_NotifyClientConnect;
|
CRehldsHookRegistry_Steam_NotifyClientConnect m_Steam_NotifyClientConnect;
|
||||||
@ -311,6 +315,7 @@ public:
|
|||||||
CRehldsHookRegistry_SV_AddResource m_SV_AddResource;
|
CRehldsHookRegistry_SV_AddResource m_SV_AddResource;
|
||||||
CRehldsHookRegistry_SV_ClientPrintf m_SV_ClientPrintf;
|
CRehldsHookRegistry_SV_ClientPrintf m_SV_ClientPrintf;
|
||||||
CRehldsHookRegistry_SV_AllowPhysent m_SV_AllowPhysent;
|
CRehldsHookRegistry_SV_AllowPhysent m_SV_AllowPhysent;
|
||||||
|
CRehldsHookRegistry_GetDispatch m_GetDispatch;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
EXT_FUNC virtual IRehldsHookRegistry_Steam_NotifyClientConnect* Steam_NotifyClientConnect();
|
EXT_FUNC virtual IRehldsHookRegistry_Steam_NotifyClientConnect* Steam_NotifyClientConnect();
|
||||||
@ -368,6 +373,7 @@ public:
|
|||||||
EXT_FUNC virtual IRehldsHookRegistry_SV_AddResource* SV_AddResource();
|
EXT_FUNC virtual IRehldsHookRegistry_SV_AddResource* SV_AddResource();
|
||||||
EXT_FUNC virtual IRehldsHookRegistry_SV_ClientPrintf* SV_ClientPrintf();
|
EXT_FUNC virtual IRehldsHookRegistry_SV_ClientPrintf* SV_ClientPrintf();
|
||||||
EXT_FUNC virtual IRehldsHookRegistry_SV_AllowPhysent* SV_AllowPhysent();
|
EXT_FUNC virtual IRehldsHookRegistry_SV_AllowPhysent* SV_AllowPhysent();
|
||||||
|
EXT_FUNC virtual IRehldsHookRegistry_GetDispatch* GetDispatch();
|
||||||
};
|
};
|
||||||
|
|
||||||
extern CRehldsHookchains g_RehldsHookchains;
|
extern CRehldsHookchains g_RehldsHookchains;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user