mirror of
https://github.com/rehlds/reapi.git
synced 2025-01-01 09:35:47 +03:00
Added C_DLLEXPORT
This commit is contained in:
parent
c3dc656ced
commit
392026e50b
@ -23,12 +23,13 @@ extern CHook *g_currentHookChain;
|
|||||||
template <typename ...t_args>
|
template <typename ...t_args>
|
||||||
inline bool callVoidForward_Pre(int func, t_args... args)
|
inline bool callVoidForward_Pre(int func, t_args... args)
|
||||||
{
|
{
|
||||||
|
auto hook = hooklist[func];
|
||||||
register int ret = RH_UNSET;
|
register int ret = RH_UNSET;
|
||||||
for (auto it = hooklist[func]->pre.begin(), end = hooklist[func]->pre.end(); it != end; ++it)
|
for (auto it = hook->pre.begin(), end = hook->pre.end(); it != end; ++it)
|
||||||
{
|
{
|
||||||
if ((*it)->GetState() == FSTATE_OK)
|
if ((*it)->GetState() == FSTATE_OK)
|
||||||
{
|
{
|
||||||
ret = g_amxxapi.ExecuteForward((*it)->m_forward, args...);
|
ret = g_amxxapi.ExecuteForward((*it)->GetForwardID(), args...);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,12 +40,13 @@ inline bool callVoidForward_Pre(int func, t_args... args)
|
|||||||
template <typename ...t_args>
|
template <typename ...t_args>
|
||||||
inline void callVoidForward_Post(int func, t_args... args)
|
inline void callVoidForward_Post(int func, t_args... args)
|
||||||
{
|
{
|
||||||
for (auto it = hooklist[func]->post.begin(), end = hooklist[func]->post.end(); it != end; ++it)
|
auto hook = hooklist[func];
|
||||||
|
for (auto it = hook->post.begin(), end = hook->post.end(); it != end; ++it)
|
||||||
{
|
{
|
||||||
if ((*it)->GetState() == FSTATE_OK)
|
if ((*it)->GetState() == FSTATE_OK)
|
||||||
{
|
{
|
||||||
g_currentHookChain = (*it);
|
g_currentHookChain = (*it);
|
||||||
g_amxxapi.ExecuteForward((*it)->m_forward, args...);
|
g_amxxapi.ExecuteForward((*it)->GetForwardID(), args...);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -52,12 +54,13 @@ inline void callVoidForward_Post(int func, t_args... args)
|
|||||||
template <typename t_chain, typename ...t_args>
|
template <typename t_chain, typename ...t_args>
|
||||||
inline void callVoidForward(t_chain chain, int func, t_args... args)
|
inline void callVoidForward(t_chain chain, int func, t_args... args)
|
||||||
{
|
{
|
||||||
|
auto hook = hooklist[func];
|
||||||
register int ret = RH_UNSET;
|
register int ret = RH_UNSET;
|
||||||
for (auto it = hooklist[func]->pre.begin(), end = hooklist[func]->pre.end(); it != end; ++it)
|
for (auto it = hook->pre.begin(), end = hook->pre.end(); it != end; ++it)
|
||||||
{
|
{
|
||||||
if ((*it)->GetState() == FSTATE_OK)
|
if ((*it)->GetState() == FSTATE_OK)
|
||||||
{
|
{
|
||||||
ret = g_amxxapi.ExecuteForward((*it)->m_forward, args...);
|
ret = g_amxxapi.ExecuteForward((*it)->GetForwardID(), args...);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,12 +71,12 @@ inline void callVoidForward(t_chain chain, int func, t_args... args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Post
|
// Post
|
||||||
for (auto it = hooklist[func]->post.begin(), end = hooklist[func]->post.end(); it != end; ++it)
|
for (auto it = hook->post.begin(), end = hook->post.end(); it != end; ++it)
|
||||||
{
|
{
|
||||||
if ((*it)->GetState() == FSTATE_OK)
|
if ((*it)->GetState() == FSTATE_OK)
|
||||||
{
|
{
|
||||||
g_currentHookChain = (*it);
|
g_currentHookChain = (*it);
|
||||||
g_amxxapi.ExecuteForward((*it)->m_forward, args...);
|
g_amxxapi.ExecuteForward((*it)->GetForwardID(), args...);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -81,12 +84,13 @@ inline void callVoidForward(t_chain chain, int func, t_args... args)
|
|||||||
template <typename ...t_args>
|
template <typename ...t_args>
|
||||||
inline bool callForward_Pre(int func, t_args... args)
|
inline bool callForward_Pre(int func, t_args... args)
|
||||||
{
|
{
|
||||||
|
auto hook = hooklist[func];
|
||||||
register int ret = RH_UNSET;
|
register int ret = RH_UNSET;
|
||||||
for (auto it = hooklist[func]->pre.begin(), end = hooklist[func]->pre.end(); it != end; ++it)
|
for (auto it = hook->pre.begin(), end = hook->pre.end(); it != end; ++it)
|
||||||
{
|
{
|
||||||
if ((*it)->GetState() == FSTATE_OK)
|
if ((*it)->GetState() == FSTATE_OK)
|
||||||
{
|
{
|
||||||
ret = g_amxxapi.ExecuteForward((*it)->m_forward, args...);
|
ret = g_amxxapi.ExecuteForward((*it)->GetForwardID(), args...);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,13 +101,14 @@ inline bool callForward_Pre(int func, t_args... args)
|
|||||||
template <typename ...t_args>
|
template <typename ...t_args>
|
||||||
inline bool callForward_Post(int func, t_args... args)
|
inline bool callForward_Post(int func, t_args... args)
|
||||||
{
|
{
|
||||||
|
auto hook = hooklist[func];
|
||||||
register int ret = RH_UNSET;
|
register int ret = RH_UNSET;
|
||||||
for (auto it = hooklist[func]->post.begin(), end = hooklist[func]->post.end(); it != end; ++it)
|
for (auto it = hook->post.begin(), end = hook->post.end(); it != end; ++it)
|
||||||
{
|
{
|
||||||
if ((*it)->GetState() == FSTATE_OK)
|
if ((*it)->GetState() == FSTATE_OK)
|
||||||
{
|
{
|
||||||
g_currentHookChain = (*it);
|
g_currentHookChain = (*it);
|
||||||
ret = g_amxxapi.ExecuteForward((*it)->m_forward, args...);
|
ret = g_amxxapi.ExecuteForward((*it)->GetForwardID(), args...);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,6 +123,9 @@ void SV_ActivateServer(IRehldsHook_SV_ActivateServer *chain, int runPhysics);
|
|||||||
void Cvar_DirectSet(IRehldsHook_Cvar_DirectSet *chain, cvar_t *var, const char *value);
|
void Cvar_DirectSet(IRehldsHook_Cvar_DirectSet *chain, cvar_t *var, const char *value);
|
||||||
|
|
||||||
// regamedll functions
|
// regamedll functions
|
||||||
|
int GetForceCamera(IReGameHook_GetForceCamera *chain, CBasePlayer *pObserver);
|
||||||
|
|
||||||
|
// regamedll functions - player
|
||||||
void CBasePlayer_Spawn(IReGameHook_CBasePlayer_Spawn *chain, CBasePlayer *pthis);
|
void CBasePlayer_Spawn(IReGameHook_CBasePlayer_Spawn *chain, CBasePlayer *pthis);
|
||||||
void CBasePlayer_Precache(IReGameHook_CBasePlayer_Precache *chain, CBasePlayer *pthis);
|
void CBasePlayer_Precache(IReGameHook_CBasePlayer_Precache *chain, CBasePlayer *pthis);
|
||||||
int CBasePlayer_ObjectCaps(IReGameHook_CBasePlayer_ObjectCaps *chain, CBasePlayer *pthis);
|
int CBasePlayer_ObjectCaps(IReGameHook_CBasePlayer_ObjectCaps *chain, CBasePlayer *pthis);
|
||||||
@ -140,6 +148,4 @@ void CBasePlayer_UpdateClientData(IReGameHook_CBasePlayer_UpdateClientData *chai
|
|||||||
void CBasePlayer_ImpulseCommands(IReGameHook_CBasePlayer_ImpulseCommands *chain, CBasePlayer *pthis);
|
void CBasePlayer_ImpulseCommands(IReGameHook_CBasePlayer_ImpulseCommands *chain, CBasePlayer *pthis);
|
||||||
void CBasePlayer_RoundRespawn(IReGameHook_CBasePlayer_RoundRespawn *chain, CBasePlayer *pthis);
|
void CBasePlayer_RoundRespawn(IReGameHook_CBasePlayer_RoundRespawn *chain, CBasePlayer *pthis);
|
||||||
void CBasePlayer_Blind(IReGameHook_CBasePlayer_Blind *chain, CBasePlayer *pthis, float flUntilTime, float flHoldTime, float flFadeTime, int iAlpha);
|
void CBasePlayer_Blind(IReGameHook_CBasePlayer_Blind *chain, CBasePlayer *pthis, float flUntilTime, float flHoldTime, float flFadeTime, int iAlpha);
|
||||||
|
|
||||||
CBaseEntity *CBasePlayer_Observer_IsValidTarget(IReGameHook_CBasePlayer_Observer_IsValidTarget *chain, CBasePlayer *pthis, int iPlayerIndex, bool bSameTeam);
|
CBaseEntity *CBasePlayer_Observer_IsValidTarget(IReGameHook_CBasePlayer_Observer_IsValidTarget *chain, CBasePlayer *pthis, int iPlayerIndex, bool bSameTeam);
|
||||||
int GetForceCamera(IReGameHook_GetForceCamera *chain, CBasePlayer *pObserver);
|
|
||||||
|
@ -36,3 +36,13 @@
|
|||||||
#include "hook_callback.h"
|
#include "hook_callback.h"
|
||||||
#include "member_list.h"
|
#include "member_list.h"
|
||||||
#include "natives.h"
|
#include "natives.h"
|
||||||
|
|
||||||
|
#undef DLLEXPORT
|
||||||
|
#ifdef _WIN32
|
||||||
|
#define DLLEXPORT __declspec(dllexport)
|
||||||
|
#define NOINLINE __declspec(noinline)
|
||||||
|
#else
|
||||||
|
#define DLLEXPORT __attribute__((visibility("default")))
|
||||||
|
#define NOINLINE __attribute__((noinline))
|
||||||
|
#define WINAPI /* */
|
||||||
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user