From eb75d2eae10a9496561ecfa26dd6b1603de76f11 Mon Sep 17 00:00:00 2001 From: s1lent Date: Wed, 1 Feb 2017 03:03:48 +0700 Subject: [PATCH] Refactoring hookchains --- regamedll/dlls/combat.cpp | 11 +- regamedll/public/regamedll/hookchains.h | 42 ----- regamedll/public/regamedll/regamedll_api.h | 208 ++++++++++----------- regamedll/regamedll/hookchains_impl.h | 205 +++----------------- regamedll/regamedll/regamedll_api_impl.h | 208 ++++++++++----------- 5 files changed, 238 insertions(+), 436 deletions(-) diff --git a/regamedll/dlls/combat.cpp b/regamedll/dlls/combat.cpp index 24a1588e..bfb9c5c1 100644 --- a/regamedll/dlls/combat.cpp +++ b/regamedll/dlls/combat.cpp @@ -922,6 +922,11 @@ void EXT_FUNC PlayerBlind(CBasePlayer *pPlayer, entvars_t *pevInflictor, entvars } } +void EXT_FUNC RadiusFlash_TraceLine_hook(CBasePlayer *pPlayer, entvars_t *pevInflictor, entvars_t *pevAttacker, Vector &vecSrc, Vector &vecSpot, TraceResult *tr) +{ + UTIL_TraceLine(vecSrc, vecSpot, dont_ignore_monsters, ENT(pevInflictor), tr); +} + void RadiusFlash(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int iClassIgnore, int bitsDamageType) { CBaseEntity *pEntity = NULL; @@ -965,14 +970,12 @@ void RadiusFlash(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, continue; vecSpot = pPlayer->BodyTarget(vecSrc); - UTIL_TraceLine(vecSrc, vecSpot, dont_ignore_monsters, ENT(pevInflictor), &tr); - g_ReGameHookchains.m_RadiusFlash_TraceLine.callChain(NULL, pPlayer, pevInflictor, pevAttacker, vecSrc, vecSpot, &tr); + g_ReGameHookchains.m_RadiusFlash_TraceLine.callChain(RadiusFlash_TraceLine_hook, pPlayer, pevInflictor, pevAttacker, vecSrc, vecSpot, &tr); if (tr.flFraction != 1.0f && tr.pHit != pPlayer->pev->pContainingEntity) continue; - UTIL_TraceLine(vecSpot, vecSrc, dont_ignore_monsters, tr.pHit, &tr2); - g_ReGameHookchains.m_RadiusFlash_TraceLine.callChain(NULL, pPlayer, VARS(tr.pHit), pevAttacker, vecSpot, vecSrc, &tr2); + g_ReGameHookchains.m_RadiusFlash_TraceLine.callChain(RadiusFlash_TraceLine_hook, pPlayer, VARS(tr.pHit), pevAttacker, vecSpot, vecSrc, &tr2); if (tr2.flFraction >= 1.0) { diff --git a/regamedll/public/regamedll/hookchains.h b/regamedll/public/regamedll/hookchains.h index 7ea472a6..2554a4af 100644 --- a/regamedll/public/regamedll/hookchains.h +++ b/regamedll/public/regamedll/hookchains.h @@ -47,28 +47,6 @@ public: virtual t_ret callOriginal(t_class *, t_args... args) = 0; }; -template -class IVoidHookChain -{ -protected: - virtual ~IVoidHookChain() {} - -public: - virtual void callNext(t_args... args) = 0; - virtual void callOriginal(t_args... args) = 0; -}; - -template -class IVoidHookChainClass -{ -protected: - virtual ~IVoidHookChainClass() {} - -public: - virtual void callNext(t_class *, t_args... args) = 0; - virtual void callOriginal(t_class *, t_args... args) = 0; -}; - // Specifies priorities for hooks call order in the chain. // For equal priorities first registered hook will be called first. enum HookChainPriority @@ -99,23 +77,3 @@ public: virtual void registerHook(hookfunc_t hook, int priority = HC_PRIORITY_DEFAULT) = 0; virtual void unregisterHook(hookfunc_t hook) = 0; }; - -// Hook chain registry(for hooks [un]registration) -template -class IVoidHookChainRegistry { -public: - typedef void(*hookfunc_t)(IVoidHookChain*, t_args...); - - virtual void registerHook(hookfunc_t hook, int priority = HC_PRIORITY_DEFAULT) = 0; - virtual void unregisterHook(hookfunc_t hook) = 0; -}; - -// Hook chain registry(for hooks [un]registration) -template -class IVoidHookChainRegistryClass { -public: - typedef void(*hookfunc_t)(IVoidHookChainClass*, t_class *, t_args...); - - virtual void registerHook(hookfunc_t hook, int priority = HC_PRIORITY_DEFAULT) = 0; - virtual void unregisterHook(hookfunc_t hook) = 0; -}; diff --git a/regamedll/public/regamedll/regamedll_api.h b/regamedll/public/regamedll/regamedll_api.h index d901c1a5..3f03c634 100644 --- a/regamedll/public/regamedll/regamedll_api.h +++ b/regamedll/public/regamedll/regamedll_api.h @@ -39,12 +39,12 @@ #define REGAMEDLL_API_VERSION_MINOR 2 // CBasePlayer::Spawn hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_Spawn; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Spawn; +typedef IHookChainClass IReGameHook_CBasePlayer_Spawn; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Spawn; // CBasePlayer::Precache hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_Precache; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Precache; +typedef IHookChainClass IReGameHook_CBasePlayer_Precache; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Precache; // CBasePlayer::ObjectCaps hook typedef IHookChainClass IReGameHook_CBasePlayer_ObjectCaps; @@ -55,8 +55,8 @@ typedef IHookChainClass IReGameHook_CBasePlayer_Classify typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Classify; // CBasePlayer::TraceAttack hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_TraceAttack; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_TraceAttack; +typedef IHookChainClass IReGameHook_CBasePlayer_TraceAttack; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_TraceAttack; // CBasePlayer::TakeDamage hook typedef IHookChainClass IReGameHook_CBasePlayer_TakeDamage; @@ -67,16 +67,16 @@ typedef IHookChainClass IReGameHook_CBasePl typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_TakeHealth; // CBasePlayer::Killed hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_Killed; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Killed; +typedef IHookChainClass IReGameHook_CBasePlayer_Killed; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Killed; // CBasePlayer::AddPoints hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_AddPoints; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_AddPoints; +typedef IHookChainClass IReGameHook_CBasePlayer_AddPoints; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_AddPoints; // CBasePlayer::AddPointsToTeam hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_AddPointsToTeam; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_AddPointsToTeam; +typedef IHookChainClass IReGameHook_CBasePlayer_AddPointsToTeam; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_AddPointsToTeam; // CBasePlayer::AddPlayerItem hook typedef IHookChainClass IReGameHook_CBasePlayer_AddPlayerItem; @@ -91,68 +91,68 @@ typedef IHookChainClass IReGameHook_C typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_GiveAmmo; // CBasePlayer::ResetMaxSpeed hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_ResetMaxSpeed; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_ResetMaxSpeed; +typedef IHookChainClass IReGameHook_CBasePlayer_ResetMaxSpeed; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_ResetMaxSpeed; // CBasePlayer::Jump hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_Jump; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Jump; +typedef IHookChainClass IReGameHook_CBasePlayer_Jump; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Jump; // CBasePlayer::Duck hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_Duck; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Duck; +typedef IHookChainClass IReGameHook_CBasePlayer_Duck; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Duck; // CBasePlayer::PreThink hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_PreThink; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_PreThink; +typedef IHookChainClass IReGameHook_CBasePlayer_PreThink; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_PreThink; // CBasePlayer::PostThink hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_PostThink; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_PostThink; +typedef IHookChainClass IReGameHook_CBasePlayer_PostThink; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_PostThink; // CBasePlayer::UpdateClientData hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_UpdateClientData; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_UpdateClientData; +typedef IHookChainClass IReGameHook_CBasePlayer_UpdateClientData; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_UpdateClientData; // CBasePlayer::ImpulseCommands hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_ImpulseCommands; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_ImpulseCommands; +typedef IHookChainClass IReGameHook_CBasePlayer_ImpulseCommands; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_ImpulseCommands; // CBasePlayer::RoundRespawn hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_RoundRespawn; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_RoundRespawn; +typedef IHookChainClass IReGameHook_CBasePlayer_RoundRespawn; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_RoundRespawn; // CBasePlayer::Blind hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_Blind; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Blind; +typedef IHookChainClass IReGameHook_CBasePlayer_Blind; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Blind; // CBasePlayer::Observer_IsValidTarget hook typedef IHookChainClass IReGameHook_CBasePlayer_Observer_IsValidTarget; typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Observer_IsValidTarget; // CBasePlayer::SetAnimation hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_SetAnimation; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_SetAnimation; +typedef IHookChainClass IReGameHook_CBasePlayer_SetAnimation; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_SetAnimation; // CBasePlayer::GiveDefaultItems hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_GiveDefaultItems; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_GiveDefaultItems; +typedef IHookChainClass IReGameHook_CBasePlayer_GiveDefaultItems; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_GiveDefaultItems; // CBasePlayer::GiveNamedItem hook typedef IHookChainClass IReGameHook_CBasePlayer_GiveNamedItem; typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_GiveNamedItem; // CBasePlayer::AddAccount hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_AddAccount; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_AddAccount; +typedef IHookChainClass IReGameHook_CBasePlayer_AddAccount; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_AddAccount; // CBasePlayer::GiveShield hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_GiveShield; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_GiveShield; +typedef IHookChainClass IReGameHook_CBasePlayer_GiveShield; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_GiveShield; // CBasePlayer:SetClientUserInfoModel hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_SetClientUserInfoModel; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_SetClientUserInfoModel; +typedef IHookChainClass IReGameHook_CBasePlayer_SetClientUserInfoModel; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_SetClientUserInfoModel; // CBasePlayer:SetClientUserInfoName hook typedef IHookChainClass IReGameHook_CBasePlayer_SetClientUserInfoName; @@ -163,56 +163,56 @@ typedef IHookChainClass IReGameHo typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_HasRestrictItem; // CBasePlayer::DropPlayerItem hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_DropPlayerItem; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_DropPlayerItem; +typedef IHookChainClass IReGameHook_CBasePlayer_DropPlayerItem; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_DropPlayerItem; // CBasePlayer::DropShield hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_DropShield; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_DropShield; +typedef IHookChainClass IReGameHook_CBasePlayer_DropShield; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_DropShield; // CBasePlayer::OnSpawnEquip hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_OnSpawnEquip; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_OnSpawnEquip; +typedef IHookChainClass IReGameHook_CBasePlayer_OnSpawnEquip; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_OnSpawnEquip; // CBasePlayer::Radio hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_Radio; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Radio; +typedef IHookChainClass IReGameHook_CBasePlayer_Radio; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Radio; // CBasePlayer::Disappear hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_Disappear; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Disappear; +typedef IHookChainClass IReGameHook_CBasePlayer_Disappear; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Disappear; // CBasePlayer::MakeVIP hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_MakeVIP; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_MakeVIP; +typedef IHookChainClass IReGameHook_CBasePlayer_MakeVIP; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_MakeVIP; // CBasePlayer::MakeBomber hook typedef IHookChainClass IReGameHook_CBasePlayer_MakeBomber; typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_MakeBomber; // CBasePlayer::StartObserver hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_StartObserver; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_StartObserver; +typedef IHookChainClass IReGameHook_CBasePlayer_StartObserver; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_StartObserver; // CBasePlayer::GetIntoGame hook typedef IHookChainClass IReGameHook_CBasePlayer_GetIntoGame; typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_GetIntoGame; // CBaseAnimating::ResetSequenceInfo hook -typedef IVoidHookChainClass IReGameHook_CBaseAnimating_ResetSequenceInfo; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo; +typedef IHookChainClass IReGameHook_CBaseAnimating_ResetSequenceInfo; +typedef IHookChainRegistryClass IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo; // GetForceCamera hook typedef IHookChain IReGameHook_GetForceCamera; typedef IHookChainRegistry IReGameHookRegistry_GetForceCamera; // PlayerBlind hook -typedef IVoidHookChain IReGameHook_PlayerBlind; -typedef IVoidHookChainRegistry IReGameHookRegistry_PlayerBlind; +typedef IHookChain IReGameHook_PlayerBlind; +typedef IHookChainRegistry IReGameHookRegistry_PlayerBlind; // RadiusFlash_TraceLine hook -typedef IVoidHookChain IReGameHook_RadiusFlash_TraceLine; -typedef IVoidHookChainRegistry IReGameHookRegistry_RadiusFlash_TraceLine; +typedef IHookChain IReGameHook_RadiusFlash_TraceLine; +typedef IHookChainRegistry IReGameHookRegistry_RadiusFlash_TraceLine; // RoundEnd hook typedef IHookChain IReGameHook_RoundEnd; @@ -223,32 +223,32 @@ typedef IHookChain IReGameHook_InstallGameRules; typedef IHookChainRegistry IReGameHookRegistry_InstallGameRules; // PM_Init hook -typedef IVoidHookChain IReGameHook_PM_Init; -typedef IVoidHookChainRegistry IReGameHookRegistry_PM_Init; +typedef IHookChain IReGameHook_PM_Init; +typedef IHookChainRegistry IReGameHookRegistry_PM_Init; // PM_Move hook -typedef IVoidHookChain IReGameHook_PM_Move; -typedef IVoidHookChainRegistry IReGameHookRegistry_PM_Move; +typedef IHookChain IReGameHook_PM_Move; +typedef IHookChainRegistry IReGameHookRegistry_PM_Move; // PM_AirMove hook -typedef IVoidHookChain IReGameHook_PM_AirMove; -typedef IVoidHookChainRegistry IReGameHookRegistry_PM_AirMove; +typedef IHookChain IReGameHook_PM_AirMove; +typedef IHookChainRegistry IReGameHookRegistry_PM_AirMove; // HandleMenu_ChooseAppearance hook -typedef IVoidHookChain IReGameHook_HandleMenu_ChooseAppearance; -typedef IVoidHookChainRegistry IReGameHookRegistry_HandleMenu_ChooseAppearance; +typedef IHookChain IReGameHook_HandleMenu_ChooseAppearance; +typedef IHookChainRegistry IReGameHookRegistry_HandleMenu_ChooseAppearance; // HandleMenu_ChooseTeam hook typedef IHookChain IReGameHook_HandleMenu_ChooseTeam; typedef IHookChainRegistry IReGameHookRegistry_HandleMenu_ChooseTeam; // ShowMenu hook -typedef IVoidHookChain IReGameHook_ShowMenu; -typedef IVoidHookChainRegistry IReGameHookRegistry_ShowMenu; +typedef IHookChain IReGameHook_ShowMenu; +typedef IHookChainRegistry IReGameHookRegistry_ShowMenu; // ShowVGUIMenu hook -typedef IVoidHookChain IReGameHook_ShowVGUIMenu; -typedef IVoidHookChainRegistry IReGameHookRegistry_ShowVGUIMenu; +typedef IHookChain IReGameHook_ShowVGUIMenu; +typedef IHookChainRegistry IReGameHookRegistry_ShowVGUIMenu; // BuyGunAmmo hook typedef IHookChain IReGameHook_BuyGunAmmo; @@ -279,8 +279,8 @@ typedef IHookChain IReGameHook_CSGameR typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_FPlayerCanTakeDamage; // CHalfLifeMultiplay::PlayerSpawn hook -typedef IVoidHookChain IReGameHook_CSGameRules_PlayerSpawn; -typedef IVoidHookChainRegistry IReGameHookRegistry_CSGameRules_PlayerSpawn; +typedef IHookChain IReGameHook_CSGameRules_PlayerSpawn; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_PlayerSpawn; // CHalfLifeMultiplay::FPlayerCanRespawn hook typedef IHookChain IReGameHook_CSGameRules_FPlayerCanRespawn; @@ -291,16 +291,16 @@ typedef IHookChain IReGameHook_CSGameRule typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_GetPlayerSpawnSpot; // CHalfLifeMultiplay::ClientUserInfoChanged hook -typedef IVoidHookChain IReGameHook_CSGameRules_ClientUserInfoChanged; -typedef IVoidHookChainRegistry IReGameHookRegistry_CSGameRules_ClientUserInfoChanged; +typedef IHookChain IReGameHook_CSGameRules_ClientUserInfoChanged; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_ClientUserInfoChanged; // CHalfLifeMultiplay::PlayerKilled hook -typedef IVoidHookChain IReGameHook_CSGameRules_PlayerKilled; -typedef IVoidHookChainRegistry IReGameHookRegistry_CSGameRules_PlayerKilled; +typedef IHookChain IReGameHook_CSGameRules_PlayerKilled; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_PlayerKilled; // CHalfLifeMultiplay::DeathNotice hook -typedef IVoidHookChain IReGameHook_CSGameRules_DeathNotice; -typedef IVoidHookChainRegistry IReGameHookRegistry_CSGameRules_DeathNotice; +typedef IHookChain IReGameHook_CSGameRules_DeathNotice; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_DeathNotice; // CHalfLifeMultiplay::CanHavePlayerItem hook typedef IHookChain IReGameHook_CSGameRules_CanHavePlayerItem; @@ -311,52 +311,52 @@ typedef IHookChain IReGameHook_CSGameRules_DeadPlayerW typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_DeadPlayerWeapons; // CHalfLifeMultiplay::ServerDeactivate hook -typedef IVoidHookChain<> IReGameHook_CSGameRules_ServerDeactivate; -typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_ServerDeactivate; +typedef IHookChain IReGameHook_CSGameRules_ServerDeactivate; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_ServerDeactivate; // CHalfLifeMultiplay::CheckMapConditions hook -typedef IVoidHookChain<> IReGameHook_CSGameRules_CheckMapConditions; -typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_CheckMapConditions; +typedef IHookChain IReGameHook_CSGameRules_CheckMapConditions; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_CheckMapConditions; // CHalfLifeMultiplay::CleanUpMap hook -typedef IVoidHookChain<> IReGameHook_CSGameRules_CleanUpMap; -typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_CleanUpMap; +typedef IHookChain IReGameHook_CSGameRules_CleanUpMap; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_CleanUpMap; // CHalfLifeMultiplay::RestartRound hook -typedef IVoidHookChain<> IReGameHook_CSGameRules_RestartRound; -typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_RestartRound; +typedef IHookChain IReGameHook_CSGameRules_RestartRound; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_RestartRound; // CHalfLifeMultiplay::CheckWinConditions hook -typedef IVoidHookChain<> IReGameHook_CSGameRules_CheckWinConditions; -typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_CheckWinConditions; +typedef IHookChain IReGameHook_CSGameRules_CheckWinConditions; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_CheckWinConditions; // CHalfLifeMultiplay::RemoveGuns hook -typedef IVoidHookChain<> IReGameHook_CSGameRules_RemoveGuns; -typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_RemoveGuns; +typedef IHookChain IReGameHook_CSGameRules_RemoveGuns; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_RemoveGuns; // CHalfLifeMultiplay::GiveC4 hook -typedef IVoidHookChain<> IReGameHook_CSGameRules_GiveC4; -typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_GiveC4; +typedef IHookChain IReGameHook_CSGameRules_GiveC4; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_GiveC4; // CHalfLifeMultiplay::ChangeLevel hook -typedef IVoidHookChain<> IReGameHook_CSGameRules_ChangeLevel; -typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_ChangeLevel; +typedef IHookChain IReGameHook_CSGameRules_ChangeLevel; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_ChangeLevel; // CHalfLifeMultiplay::GoToIntermission hook -typedef IVoidHookChain<> IReGameHook_CSGameRules_GoToIntermission; -typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_GoToIntermission; +typedef IHookChain IReGameHook_CSGameRules_GoToIntermission; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_GoToIntermission; // CHalfLifeMultiplay::BalanceTeams hook -typedef IVoidHookChain<> IReGameHook_CSGameRules_BalanceTeams; -typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_BalanceTeams; +typedef IHookChain IReGameHook_CSGameRules_BalanceTeams; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_BalanceTeams; // CHalfLifeMultiplay::OnRoundFreezeEnd hook -typedef IVoidHookChain<> IReGameHook_CSGameRules_OnRoundFreezeEnd; -typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_OnRoundFreezeEnd; +typedef IHookChain IReGameHook_CSGameRules_OnRoundFreezeEnd; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_OnRoundFreezeEnd; // PM_UpdateStepSound hook -typedef IVoidHookChain<> IReGameHook_PM_UpdateStepSound; -typedef IVoidHookChainRegistry<> IReGameHookRegistry_PM_UpdateStepSound; +typedef IHookChain IReGameHook_PM_UpdateStepSound; +typedef IHookChainRegistry IReGameHookRegistry_PM_UpdateStepSound; class IReGameHookchains { public: diff --git a/regamedll/regamedll/hookchains_impl.h b/regamedll/regamedll/hookchains_impl.h index bef8dcb5..ebbeea28 100644 --- a/regamedll/regamedll/hookchains_impl.h +++ b/regamedll/regamedll/hookchains_impl.h @@ -30,6 +30,18 @@ #define MAX_HOOKS_IN_CHAIN 30 +template +bool is_void(t_ret (t_class::*)(t_args...)) { return false; } + +template +bool is_void(t_ret (*)(t_args...)) { return false; } + +template +bool is_void(void (t_class::*)(t_args...)) { return true; } + +template +bool is_void(void (*)(t_args...)) { return true; } + // Implementation for chains in modules template class IHookChainImpl : public IHookChain { @@ -39,7 +51,7 @@ public: IHookChainImpl(void** hooks, origfunc_t orig) : m_Hooks(hooks), m_OriginalFunc(orig) { - if (orig == NULL) + if (orig == NULL && !is_void(orig)) Sys_Error("%s: Non-void HookChain without original function.", __FUNCTION__); } @@ -54,11 +66,11 @@ public: return nexthook(&nextChain, args...); } - return m_OriginalFunc(args...); + return m_OriginalFunc ? m_OriginalFunc(args...) : t_ret(); } virtual t_ret callOriginal(t_args... args) { - return m_OriginalFunc(args...); + return m_OriginalFunc ? m_OriginalFunc(args...) : t_ret(); } private: @@ -75,8 +87,8 @@ public: IHookChainClassImpl(void** hooks, origfunc_t orig) : m_Hooks(hooks), m_OriginalFunc(orig) { - if (orig == NULL) - regamedll_syserror("Non-void HookChain without original function."); + if (orig == NULL && !is_void(orig)) + Sys_Error("%s: Non-void HookChain without original function.", __FUNCTION__); } virtual ~IHookChainClassImpl() {} @@ -90,11 +102,11 @@ public: return nexthook(&nextChain, object, args...); } - return (object->*m_OriginalFunc)(args...); + return m_OriginalFunc ? (object->*m_OriginalFunc)(args...) : t_ret(); } virtual t_ret callOriginal(t_class *object, t_args... args) { - return (object->*m_OriginalFunc)(args...); + return m_OriginalFunc ? (object->*m_OriginalFunc)(args...) : t_ret(); } private: @@ -111,8 +123,8 @@ public: IHookChainClassEmptyImpl(void** hooks, origfunc_t orig, t_class *object) : m_Hooks(hooks), m_OriginalFunc(orig), m_Object(object) { - if (orig == NULL) - regamedll_syserror("Non-void HookChain without original function."); + if (orig == NULL && !is_void(orig)) + Sys_Error("%s: Non-void HookChain without original function.", __FUNCTION__); } virtual ~IHookChainClassEmptyImpl() {} @@ -126,11 +138,11 @@ public: return nexthook(&nextChain, args...); } - return (m_Object->*m_OriginalFunc)(args...); + return m_OriginalFunc ? (m_Object->*m_OriginalFunc)(args...) : t_ret(); } virtual t_ret callOriginal(t_args... args) { - return (m_Object->*m_OriginalFunc)(args...); + return m_OriginalFunc ? (m_Object->*m_OriginalFunc)(args...) : t_ret(); } private: @@ -139,111 +151,6 @@ private: origfunc_t m_OriginalFunc; }; -// Implementation for void chains in modules -template -class IVoidHookChainImpl : public IVoidHookChain { -public: - typedef void(*hookfunc_t)(IVoidHookChain*, t_args...); - typedef void(*origfunc_t)(t_args...); - - IVoidHookChainImpl(void** hooks, origfunc_t orig) : m_Hooks(hooks), m_OriginalFunc(orig) {} - virtual ~IVoidHookChainImpl() {} - - virtual void callNext(t_args... args) { - hookfunc_t nexthook = (hookfunc_t)m_Hooks[0]; - - if (nexthook) - { - IVoidHookChainImpl nextChain(m_Hooks + 1, m_OriginalFunc); - nexthook(&nextChain, args...); - } - else - { - if (m_OriginalFunc) - m_OriginalFunc(args...); - } - } - - virtual void callOriginal(t_args... args) { - if (m_OriginalFunc) - m_OriginalFunc(args...); - } - -private: - void** m_Hooks; - origfunc_t m_OriginalFunc; -}; - -template -class IVoidHookChainClassEmptyImpl : public IVoidHookChain { -public: - typedef void(*hookfunc_t)(IVoidHookChain*, t_args...); - typedef void(t_class::*origfunc_t)(t_args...); - - IVoidHookChainClassEmptyImpl(void** hooks, origfunc_t orig, t_class *object) : m_Hooks(hooks), m_OriginalFunc(orig), m_Object(object) {} - virtual ~IVoidHookChainClassEmptyImpl() {} - - virtual void callNext(t_args... args) { - hookfunc_t nexthook = (hookfunc_t)m_Hooks[0]; - - if (nexthook) - { - IVoidHookChainClassEmptyImpl nextChain(m_Hooks + 1, m_OriginalFunc, m_Object); - nexthook(&nextChain, args...); - } - else - { - if (m_Object && m_OriginalFunc) - (m_Object->*m_OriginalFunc)(args...); - } - } - - virtual void callOriginal(t_args... args) { - if (m_Object && m_OriginalFunc) - (m_Object->*m_OriginalFunc)(args...); - } - -private: - void** m_Hooks; - t_class *m_Object; - origfunc_t m_OriginalFunc; -}; - -// Implementation for void chains in modules -template -class IVoidHookChainClassImpl : public IVoidHookChainClass { -public: - typedef void(*hookfunc_t)(IVoidHookChainClass*, t_class *, t_args...); - typedef void(t_class::*origfunc_t)(t_args...); - - IVoidHookChainClassImpl(void** hooks, origfunc_t orig) : m_Hooks(hooks), m_OriginalFunc(orig) {} - virtual ~IVoidHookChainClassImpl() {} - - virtual void callNext(t_class *object, t_args... args) { - hookfunc_t nexthook = (hookfunc_t)m_Hooks[0]; - - if (nexthook) - { - IVoidHookChainClassImpl nextChain(m_Hooks + 1, m_OriginalFunc); - nexthook(&nextChain, object, args...); - } - else - { - if (object && m_OriginalFunc) - (object->*m_OriginalFunc)(args...); - } - } - - virtual void callOriginal(t_class *object, t_args... args) { - if (object && m_OriginalFunc) - (object->*m_OriginalFunc)(args...); - } - -private: - void** m_Hooks; - origfunc_t m_OriginalFunc; -}; - class AbstractHookChainRegistry { protected: void* m_Hooks[MAX_HOOKS_IN_CHAIN + 1]; // +1 for null @@ -321,69 +228,3 @@ public: removeHook((void*)hook); } }; - -template -class IVoidHookChainRegistryClassEmptyImpl : public IVoidHookChainRegistry , public AbstractHookChainRegistry { -public: - typedef void(*hookfunc_t)(IVoidHookChain*, t_args...); - typedef void(t_class::*origfunc_t)(t_args...); - - virtual ~IVoidHookChainRegistryClassEmptyImpl() { } - - void callChain(origfunc_t origFunc, t_class *object, t_args... args) { - IVoidHookChainClassEmptyImpl chain(m_Hooks, origFunc, object); - chain.callNext(args...); - } - - virtual void registerHook(hookfunc_t hook, int priority) { - addHook((void*)hook, priority); - } - - virtual void unregisterHook(hookfunc_t hook) { - removeHook((void*)hook); - } -}; - -template -class IVoidHookChainRegistryImpl : public IVoidHookChainRegistry , public AbstractHookChainRegistry { -public: - typedef void(*hookfunc_t)(IVoidHookChain*, t_args...); - typedef void(*origfunc_t)(t_args...); - - virtual ~IVoidHookChainRegistryImpl() { } - - void callChain(origfunc_t origFunc, t_args... args) { - IVoidHookChainImpl chain(m_Hooks, origFunc); - chain.callNext(args...); - } - - virtual void registerHook(hookfunc_t hook, int priority) { - addHook((void*)hook, priority); - } - - virtual void unregisterHook(hookfunc_t hook) { - removeHook((void*)hook); - } -}; - -template -class IVoidHookChainRegistryClassImpl : public IVoidHookChainRegistryClass , public AbstractHookChainRegistry { -public: - typedef void(*hookfunc_t)(IVoidHookChainClass*, t_class *, t_args...); - typedef void(t_class::*origfunc_t)(t_args...); - - virtual ~IVoidHookChainRegistryClassImpl() { } - - void callChain(origfunc_t origFunc, t_class *object, t_args... args) { - IVoidHookChainClassImpl chain(m_Hooks, origFunc); - chain.callNext(object, args...); - } - - virtual void registerHook(hookfunc_t hook, int priority) { - addHook((void*)hook, priority); - } - - virtual void unregisterHook(hookfunc_t hook) { - removeHook((void*)hook); - } -}; diff --git a/regamedll/regamedll/regamedll_api_impl.h b/regamedll/regamedll/regamedll_api_impl.h index 5166e884..ec07b59c 100644 --- a/regamedll/regamedll/regamedll_api_impl.h +++ b/regamedll/regamedll/regamedll_api_impl.h @@ -35,12 +35,12 @@ IReGameHookRegistry_##func* CReGameHookchains::func() { return &m_##func; } // CBasePlayer::Spawn hook -typedef IVoidHookChainClassImpl CReGameHook_CBasePlayer_Spawn; -typedef IVoidHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_Spawn; +typedef IHookChainClassImpl CReGameHook_CBasePlayer_Spawn; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_Spawn; // CBasePlayer::Precache hook -typedef IVoidHookChainClassImpl CReGameHook_CBasePlayer_Precache; -typedef IVoidHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_Precache; +typedef IHookChainClassImpl CReGameHook_CBasePlayer_Precache; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_Precache; // CBasePlayer::ObjectCaps hook typedef IHookChainClassImpl CReGameHook_CBasePlayer_ObjectCaps; @@ -51,8 +51,8 @@ typedef IHookChainClassImpl CReGameHook_CBasePlayer_Classify; typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_Classify; // CBasePlayer::TraceAttack hook -typedef IVoidHookChainClassImpl CReGameHook_CBasePlayer_TraceAttack; -typedef IVoidHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_TraceAttack; +typedef IHookChainClassImpl CReGameHook_CBasePlayer_TraceAttack; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_TraceAttack; // CBasePlayer::TakeDamage hook typedef IHookChainClassImpl CReGameHook_CBasePlayer_TakeDamage; @@ -63,16 +63,16 @@ typedef IHookChainClassImpl CReGameHook_CBasePlay typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_TakeHealth; // CBasePlayer::Killed hook -typedef IVoidHookChainClassImpl CReGameHook_CBasePlayer_Killed; -typedef IVoidHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_Killed; +typedef IHookChainClassImpl CReGameHook_CBasePlayer_Killed; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_Killed; // CBasePlayer::AddPoints hook -typedef IVoidHookChainClassImpl CReGameHook_CBasePlayer_AddPoints; -typedef IVoidHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_AddPoints; +typedef IHookChainClassImpl CReGameHook_CBasePlayer_AddPoints; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_AddPoints; // CBasePlayer::AddPointsToTeam hook -typedef IVoidHookChainClassImpl CReGameHook_CBasePlayer_AddPointsToTeam; -typedef IVoidHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_AddPointsToTeam; +typedef IHookChainClassImpl CReGameHook_CBasePlayer_AddPointsToTeam; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_AddPointsToTeam; // CBasePlayer::AddPlayerItem hook typedef IHookChainClassImpl CReGameHook_CBasePlayer_AddPlayerItem; @@ -87,68 +87,68 @@ typedef IHookChainClassImpl CReGameHook_CBa typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_GiveAmmo; // CBasePlayer::ResetMaxSpeed hook -typedef IVoidHookChainClassImpl CReGameHook_CBasePlayer_ResetMaxSpeed; -typedef IVoidHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_ResetMaxSpeed; +typedef IHookChainClassImpl CReGameHook_CBasePlayer_ResetMaxSpeed; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_ResetMaxSpeed; // CBasePlayer::Jump hook -typedef IVoidHookChainClassImpl CReGameHook_CBasePlayer_Jump; -typedef IVoidHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_Jump; +typedef IHookChainClassImpl CReGameHook_CBasePlayer_Jump; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_Jump; // CBasePlayer::Duck hook -typedef IVoidHookChainClassImpl CReGameHook_CBasePlayer_Duck; -typedef IVoidHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_Duck; +typedef IHookChainClassImpl CReGameHook_CBasePlayer_Duck; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_Duck; // CBasePlayer::PreThink hook -typedef IVoidHookChainClassImpl CReGameHook_CBasePlayer_PreThink; -typedef IVoidHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_PreThink; +typedef IHookChainClassImpl CReGameHook_CBasePlayer_PreThink; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_PreThink; // CBasePlayer::PostThink hook -typedef IVoidHookChainClassImpl CReGameHook_CBasePlayer_PostThink; -typedef IVoidHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_PostThink; +typedef IHookChainClassImpl CReGameHook_CBasePlayer_PostThink; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_PostThink; // CBasePlayer::UpdateClientData hook -typedef IVoidHookChainClassImpl CReGameHook_CBasePlayer_UpdateClientData; -typedef IVoidHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_UpdateClientData; +typedef IHookChainClassImpl CReGameHook_CBasePlayer_UpdateClientData; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_UpdateClientData; // CBasePlayer::ImpulseCommands hook -typedef IVoidHookChainClassImpl CReGameHook_CBasePlayer_ImpulseCommands; -typedef IVoidHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_ImpulseCommands; +typedef IHookChainClassImpl CReGameHook_CBasePlayer_ImpulseCommands; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_ImpulseCommands; // CBasePlayer::RoundRespawn hook -typedef IVoidHookChainClassImpl CReGameHook_CBasePlayer_RoundRespawn; -typedef IVoidHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_RoundRespawn; +typedef IHookChainClassImpl CReGameHook_CBasePlayer_RoundRespawn; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_RoundRespawn; // CBasePlayer::Blind hook -typedef IVoidHookChainClassImpl CReGameHook_CBasePlayer_Blind; -typedef IVoidHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_Blind; +typedef IHookChainClassImpl CReGameHook_CBasePlayer_Blind; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_Blind; // CBasePlayer::Observer_IsValidTarget hook typedef IHookChainClassImpl CReGameHook_CBasePlayer_Observer_IsValidTarget; typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_Observer_IsValidTarget; // CBasePlayer::SetAnimation hook -typedef IVoidHookChainClassImpl CReGameHook_CBasePlayer_SetAnimation; -typedef IVoidHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_SetAnimation; +typedef IHookChainClassImpl CReGameHook_CBasePlayer_SetAnimation; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_SetAnimation; // CBasePlayer::GiveDefaultItems hook -typedef IVoidHookChainClassImpl CReGameHook_CBasePlayer_GiveDefaultItems; -typedef IVoidHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_GiveDefaultItems; +typedef IHookChainClassImpl CReGameHook_CBasePlayer_GiveDefaultItems; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_GiveDefaultItems; // CBasePlayer::GiveNamedItem hook typedef IHookChainClassImpl CReGameHook_CBasePlayer_GiveNamedItem; typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_GiveNamedItem; // CBasePlayer::AddAccount hook -typedef IVoidHookChainClassImpl CReGameHook_CBasePlayer_AddAccount; -typedef IVoidHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_AddAccount; +typedef IHookChainClassImpl CReGameHook_CBasePlayer_AddAccount; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_AddAccount; // CBasePlayer::GiveShield hook -typedef IVoidHookChainClassImpl CReGameHook_CBasePlayer_GiveShield; -typedef IVoidHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_GiveShield; +typedef IHookChainClassImpl CReGameHook_CBasePlayer_GiveShield; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_GiveShield; // CBasePlayer:SetClientUserInfoModel hook -typedef IVoidHookChainClassImpl CReGameHook_CBasePlayer_SetClientUserInfoModel; -typedef IVoidHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_SetClientUserInfoModel; +typedef IHookChainClassImpl CReGameHook_CBasePlayer_SetClientUserInfoModel; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_SetClientUserInfoModel; // CBasePlayer:SetClientUserInfoName hook typedef IHookChainClassImpl CReGameHook_CBasePlayer_SetClientUserInfoName; @@ -159,56 +159,56 @@ typedef IHookChainClassImpl CReGameHook typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_HasRestrictItem; // CBasePlayer::DropPlayerItem hook -typedef IVoidHookChainClassImpl CReGameHook_CBasePlayer_DropPlayerItem; -typedef IVoidHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_DropPlayerItem; +typedef IHookChainClassImpl CReGameHook_CBasePlayer_DropPlayerItem; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_DropPlayerItem; // CBasePlayer::DropShield hook -typedef IVoidHookChainClassImpl CReGameHook_CBasePlayer_DropShield; -typedef IVoidHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_DropShield; +typedef IHookChainClassImpl CReGameHook_CBasePlayer_DropShield; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_DropShield; // CBasePlayer::OnSpawnEquip hook -typedef IVoidHookChainClassImpl CReGameHook_CBasePlayer_OnSpawnEquip; -typedef IVoidHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_OnSpawnEquip; +typedef IHookChainClassImpl CReGameHook_CBasePlayer_OnSpawnEquip; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_OnSpawnEquip; // CBasePlayer::Radio hook -typedef IVoidHookChainClassImpl CReGameHook_CBasePlayer_Radio; -typedef IVoidHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_Radio; +typedef IHookChainClassImpl CReGameHook_CBasePlayer_Radio; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_Radio; // CBasePlayer::Disappear hook -typedef IVoidHookChainClassImpl CReGameHook_CBasePlayer_Disappear; -typedef IVoidHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_Disappear; +typedef IHookChainClassImpl CReGameHook_CBasePlayer_Disappear; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_Disappear; // CBasePlayer::MakeVIP hook -typedef IVoidHookChainClassImpl CReGameHook_CBasePlayer_MakeVIP; -typedef IVoidHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_MakeVIP; +typedef IHookChainClassImpl CReGameHook_CBasePlayer_MakeVIP; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_MakeVIP; // CBasePlayer::MakeBomber hook typedef IHookChainClassImpl CReGameHook_CBasePlayer_MakeBomber; typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_MakeBomber; // CBasePlayer::StartObserver hook -typedef IVoidHookChainClassImpl CReGameHook_CBasePlayer_StartObserver; -typedef IVoidHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_StartObserver; +typedef IHookChainClassImpl CReGameHook_CBasePlayer_StartObserver; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_StartObserver; // CBasePlayer::GetIntoGame hook typedef IHookChainClassImpl CReGameHook_CBasePlayer_GetIntoGame; typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_GetIntoGame; // CBaseAnimating::ResetSequenceInfo hook -typedef IVoidHookChainClassImpl CReGameHook_CBaseAnimating_ResetSequenceInfo; -typedef IVoidHookChainRegistryClassImpl CReGameHookRegistry_CBaseAnimating_ResetSequenceInfo; +typedef IHookChainClassImpl CReGameHook_CBaseAnimating_ResetSequenceInfo; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBaseAnimating_ResetSequenceInfo; // GetForceCamera hook typedef IHookChainImpl CReGameHook_GetForceCamera; typedef IHookChainRegistryImpl CReGameHookRegistry_GetForceCamera; // PlayerBlind hook -typedef IVoidHookChainImpl CReGameHook_PlayerBlind; -typedef IVoidHookChainRegistryImpl CReGameHookRegistry_PlayerBlind; +typedef IHookChainImpl CReGameHook_PlayerBlind; +typedef IHookChainRegistryImpl CReGameHookRegistry_PlayerBlind; // RadiusFlash_TraceLine hook -typedef IVoidHookChainImpl CReGameHook_RadiusFlash_TraceLine; -typedef IVoidHookChainRegistryImpl CReGameHookRegistry_RadiusFlash_TraceLine; +typedef IHookChainImpl CReGameHook_RadiusFlash_TraceLine; +typedef IHookChainRegistryImpl CReGameHookRegistry_RadiusFlash_TraceLine; // RoundEnd hook typedef IHookChainClassImpl CReGameHook_RoundEnd; @@ -219,32 +219,32 @@ typedef IHookChainImpl CReGameHook_InstallGameRules; typedef IHookChainRegistryImpl CReGameHookRegistry_InstallGameRules; // PM_Init hook -typedef IVoidHookChainImpl CReGameHook_PM_Init; -typedef IVoidHookChainRegistryImpl CReGameHookRegistry_PM_Init; +typedef IHookChainImpl CReGameHook_PM_Init; +typedef IHookChainRegistryImpl CReGameHookRegistry_PM_Init; // PM_Move hook -typedef IVoidHookChainImpl CReGameHook_PM_Move; -typedef IVoidHookChainRegistryImpl CReGameHookRegistry_PM_Move; +typedef IHookChainImpl CReGameHook_PM_Move; +typedef IHookChainRegistryImpl CReGameHookRegistry_PM_Move; // PM_AirMove hook -typedef IVoidHookChainImpl CReGameHook_PM_AirMove; -typedef IVoidHookChainRegistryImpl CReGameHookRegistry_PM_AirMove; +typedef IHookChainImpl CReGameHook_PM_AirMove; +typedef IHookChainRegistryImpl CReGameHookRegistry_PM_AirMove; // HandleMenu_ChooseAppearance hook -typedef IVoidHookChainImpl CReGameHook_HandleMenu_ChooseAppearance; -typedef IVoidHookChainRegistryImpl CReGameHookRegistry_HandleMenu_ChooseAppearance; +typedef IHookChainImpl CReGameHook_HandleMenu_ChooseAppearance; +typedef IHookChainRegistryImpl CReGameHookRegistry_HandleMenu_ChooseAppearance; // HandleMenu_ChooseTeam hook typedef IHookChainImpl CReGameHook_HandleMenu_ChooseTeam; typedef IHookChainRegistryImpl CReGameHookRegistry_HandleMenu_ChooseTeam; // ShowMenu hook -typedef IVoidHookChainImpl CReGameHook_ShowMenu; -typedef IVoidHookChainRegistryImpl CReGameHookRegistry_ShowMenu; +typedef IHookChainImpl CReGameHook_ShowMenu; +typedef IHookChainRegistryImpl CReGameHookRegistry_ShowMenu; // ShowVGUIMenu hook -typedef IVoidHookChainImpl CReGameHook_ShowVGUIMenu; -typedef IVoidHookChainRegistryImpl CReGameHookRegistry_ShowVGUIMenu; +typedef IHookChainImpl CReGameHook_ShowVGUIMenu; +typedef IHookChainRegistryImpl CReGameHookRegistry_ShowVGUIMenu; // BuyGunAmmo hook typedef IHookChainImpl CReGameHook_BuyGunAmmo; @@ -275,8 +275,8 @@ typedef IHookChainClassImpl CReGameHookRegistry_CSGameRules_FPlayerCanTakeDamage; // CHalfLifeMultiplay::PlayerSpawn hook -typedef IVoidHookChainClassImpl CReGameHook_CSGameRules_PlayerSpawn; -typedef IVoidHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_PlayerSpawn; +typedef IHookChainClassImpl CReGameHook_CSGameRules_PlayerSpawn; +typedef IHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_PlayerSpawn; // CHalfLifeMultiplay::FPlayerCanRespawn hook typedef IHookChainClassImpl CReGameHook_CSGameRules_FPlayerCanRespawn; @@ -287,16 +287,16 @@ typedef IHookChainClassImpl typedef IHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_GetPlayerSpawnSpot; // CHalfLifeMultiplay::ClientUserInfoChanged hook -typedef IVoidHookChainClassImpl CReGameHook_CSGameRules_ClientUserInfoChanged; -typedef IVoidHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_ClientUserInfoChanged; +typedef IHookChainClassImpl CReGameHook_CSGameRules_ClientUserInfoChanged; +typedef IHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_ClientUserInfoChanged; // CHalfLifeMultiplay::PlayerKilled hook -typedef IVoidHookChainClassImpl CReGameHook_CSGameRules_PlayerKilled; -typedef IVoidHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_PlayerKilled; +typedef IHookChainClassImpl CReGameHook_CSGameRules_PlayerKilled; +typedef IHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_PlayerKilled; // CHalfLifeMultiplay::DeathNotice hook -typedef IVoidHookChainClassImpl CReGameHook_CSGameRules_DeathNotice; -typedef IVoidHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_DeathNotice; +typedef IHookChainClassImpl CReGameHook_CSGameRules_DeathNotice; +typedef IHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_DeathNotice; // CHalfLifeMultiplay::CanHavePlayerItem hook typedef IHookChainClassImpl CReGameHook_CSGameRules_CanHavePlayerItem; @@ -307,52 +307,52 @@ typedef IHookChainClassImpl CReGam typedef IHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_DeadPlayerWeapons; // CHalfLifeMultiplay::ServerDeactivate hook -typedef IVoidHookChainClassImpl CReGameHook_CSGameRules_ServerDeactivate; -typedef IVoidHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_ServerDeactivate; +typedef IHookChainClassImpl CReGameHook_CSGameRules_ServerDeactivate; +typedef IHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_ServerDeactivate; // CHalfLifeMultiplay::CheckMapConditions hook -typedef IVoidHookChainClassImpl CReGameHook_CSGameRules_CheckMapConditions; -typedef IVoidHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_CheckMapConditions; +typedef IHookChainClassImpl CReGameHook_CSGameRules_CheckMapConditions; +typedef IHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_CheckMapConditions; // CHalfLifeMultiplay::CleanUpMap hook -typedef IVoidHookChainClassImpl CReGameHook_CSGameRules_CleanUpMap; -typedef IVoidHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_CleanUpMap; +typedef IHookChainClassImpl CReGameHook_CSGameRules_CleanUpMap; +typedef IHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_CleanUpMap; // CHalfLifeMultiplay::RestartRound hook -typedef IVoidHookChainClassImpl CReGameHook_CSGameRules_RestartRound; -typedef IVoidHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_RestartRound; +typedef IHookChainClassImpl CReGameHook_CSGameRules_RestartRound; +typedef IHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_RestartRound; // CHalfLifeMultiplay::CheckWinConditions hook -typedef IVoidHookChainClassImpl CReGameHook_CSGameRules_CheckWinConditions; -typedef IVoidHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_CheckWinConditions; +typedef IHookChainClassImpl CReGameHook_CSGameRules_CheckWinConditions; +typedef IHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_CheckWinConditions; // CHalfLifeMultiplay::RemoveGuns hook -typedef IVoidHookChainClassImpl CReGameHook_CSGameRules_RemoveGuns; -typedef IVoidHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_RemoveGuns; +typedef IHookChainClassImpl CReGameHook_CSGameRules_RemoveGuns; +typedef IHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_RemoveGuns; // CHalfLifeMultiplay::GiveC4 hook -typedef IVoidHookChainClassImpl CReGameHook_CSGameRules_GiveC4; -typedef IVoidHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_GiveC4; +typedef IHookChainClassImpl CReGameHook_CSGameRules_GiveC4; +typedef IHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_GiveC4; // CHalfLifeMultiplay::ChangeLevel hook -typedef IVoidHookChainClassImpl CReGameHook_CSGameRules_ChangeLevel; -typedef IVoidHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_ChangeLevel; +typedef IHookChainClassImpl CReGameHook_CSGameRules_ChangeLevel; +typedef IHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_ChangeLevel; // CHalfLifeMultiplay::GoToIntermission hook -typedef IVoidHookChainClassImpl CReGameHook_CSGameRules_GoToIntermission; -typedef IVoidHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_GoToIntermission; +typedef IHookChainClassImpl CReGameHook_CSGameRules_GoToIntermission; +typedef IHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_GoToIntermission; // CHalfLifeMultiplay::BalanceTeams hook -typedef IVoidHookChainClassImpl CReGameHook_CSGameRules_BalanceTeams; -typedef IVoidHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_BalanceTeams; +typedef IHookChainClassImpl CReGameHook_CSGameRules_BalanceTeams; +typedef IHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_BalanceTeams; // CHalfLifeMultiplay::OnRoundFreezeEnd hook -typedef IVoidHookChainClassImpl CReGameHook_CSGameRules_OnRoundFreezeEnd; -typedef IVoidHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_OnRoundFreezeEnd; +typedef IHookChainClassImpl CReGameHook_CSGameRules_OnRoundFreezeEnd; +typedef IHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_OnRoundFreezeEnd; // PM_UpdateStepSound hook -typedef IVoidHookChainImpl<> CReGameHook_PM_UpdateStepSound; -typedef IVoidHookChainRegistryImpl<> CReGameHookRegistry_PM_UpdateStepSound; +typedef IHookChainImpl CReGameHook_PM_UpdateStepSound; +typedef IHookChainRegistryImpl CReGameHookRegistry_PM_UpdateStepSound; class CReGameHookchains: public IReGameHookchains { public: