Update ReSDK API to latest version (#520)

This commit is contained in:
Vincent Herbet 2018-08-25 09:20:06 +02:00 committed by GitHub
parent ce14df0c77
commit f822cc610f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 891 additions and 308 deletions

View File

@ -17,7 +17,7 @@
#include <resdk/mod_regamedll_api.h> #include <resdk/mod_regamedll_api.h>
CsItemInfo ItemsManager; CsItemInfo ItemsManager;
ItemInfo WeaponsList[MAX_WEAPONS]; ItemInfos WeaponsList[MAX_WEAPONS];
#define PSTATE_ALIASES_TYPE 0 #define PSTATE_ALIASES_TYPE 0
#define PSTATE_ALIASES_ALIAS 1 #define PSTATE_ALIASES_ALIAS 1

View File

@ -20,12 +20,12 @@
#include <amtl/am-string.h> #include <amtl/am-string.h>
#include <sm_stringhashmap.h> #include <sm_stringhashmap.h>
struct ItemInfo struct ItemInfos
{ {
ItemInfo() : name("Empty"), ammoIndex1(-1), maxAmmo1(0), ammoIndex2(-1), maxAmmo2(0), slot(0), position(0), id(0), flags(0) ItemInfos() : name("Empty"), ammoIndex1(-1), maxAmmo1(0), ammoIndex2(-1), maxAmmo2(0), slot(0), position(0), id(0), flags(0)
{} {}
ItemInfo &operator = (ItemInfo &other) ItemInfos &operator = (ItemInfos &other)
{ {
name = other.name; name = other.name;
ammoIndex1 = other.ammoIndex1; ammoIndex1 = other.ammoIndex1;
@ -133,7 +133,7 @@ class CsItemInfo : public ITextListener_SMC
int m_EquipmentsPrice[static_cast<size_t>(Equipments::Count)]; int m_EquipmentsPrice[static_cast<size_t>(Equipments::Count)];
}; };
extern ItemInfo WeaponsList[MAX_WEAPONS]; extern ItemInfos WeaponsList[MAX_WEAPONS];
extern CsItemInfo ItemsManager; extern CsItemInfo ItemsManager;
#endif // _CSTRIKE_WEAPONS_INFOS_H_ #endif // _CSTRIKE_WEAPONS_INFOS_H_

View File

@ -22,7 +22,7 @@ bool ShouldBlock;
bool ShouldBlockHLTV; bool ShouldBlockHLTV;
bool ShouldDisableHooks; bool ShouldDisableHooks;
bool RetrieveWeaponList; bool RetrieveWeaponList;
ItemInfo CurrentWeaponList; ItemInfos CurrentWeaponList;
int ArgPosition; int ArgPosition;
int MessageIdArmorType; int MessageIdArmorType;

View File

@ -165,9 +165,18 @@
<ClInclude Include="..\..\..\..\public\memtools\CDetour\detours.h" /> <ClInclude Include="..\..\..\..\public\memtools\CDetour\detours.h" />
<ClInclude Include="..\..\..\..\public\memtools\MemoryUtils.h" /> <ClInclude Include="..\..\..\..\public\memtools\MemoryUtils.h" />
<ClInclude Include="..\..\..\..\public\resdk\common\hookchains.h" /> <ClInclude Include="..\..\..\..\public\resdk\common\hookchains.h" />
<ClInclude Include="..\..\..\..\public\resdk\cstrike\API\CSEntity.h" />
<ClInclude Include="..\..\..\..\public\resdk\cstrike\API\CSInterfaces.h" />
<ClInclude Include="..\..\..\..\public\resdk\cstrike\API\CSPlayer.h" />
<ClInclude Include="..\..\..\..\public\resdk\cstrike\API\CSPlayerItem.h" />
<ClInclude Include="..\..\..\..\public\resdk\cstrike\API\CSPlayerWeapon.h" />
<ClInclude Include="..\..\..\..\public\resdk\cstrike\regamedll_api.h" /> <ClInclude Include="..\..\..\..\public\resdk\cstrike\regamedll_api.h" />
<ClInclude Include="..\..\..\..\public\resdk\cstrike\regamedll_const.h" /> <ClInclude Include="..\..\..\..\public\resdk\cstrike\regamedll_const.h" />
<ClInclude Include="..\..\..\..\public\resdk\cstrike\regamedll_interfaces.h" /> <ClInclude Include="..\..\..\..\public\resdk\engine\cmd_rehlds.h" />
<ClInclude Include="..\..\..\..\public\resdk\engine\FlightRecorder.h" />
<ClInclude Include="..\..\..\..\public\resdk\engine\IObjectContainer.h" />
<ClInclude Include="..\..\..\..\public\resdk\engine\ObjectList.h" />
<ClInclude Include="..\..\..\..\public\resdk\engine\pr_dlls.h" />
<ClInclude Include="..\..\..\..\public\resdk\engine\rehlds_api.h" /> <ClInclude Include="..\..\..\..\public\resdk\engine\rehlds_api.h" />
<ClInclude Include="..\..\..\..\public\resdk\engine\rehlds_interfaces.h" /> <ClInclude Include="..\..\..\..\public\resdk\engine\rehlds_interfaces.h" />
<ClInclude Include="..\..\..\..\public\resdk\mod_regamedll_api.h" /> <ClInclude Include="..\..\..\..\public\resdk\mod_regamedll_api.h" />

View File

@ -39,6 +39,9 @@
<Filter Include="ReSDK\cstrike"> <Filter Include="ReSDK\cstrike">
<UniqueIdentifier>{ba0b72ba-25d8-48c3-af84-c1d4d7436636}</UniqueIdentifier> <UniqueIdentifier>{ba0b72ba-25d8-48c3-af84-c1d4d7436636}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="ReSDK\cstrike\API">
<UniqueIdentifier>{67de85cb-b8e7-4cd6-b8cf-2ff7ed540c2b}</UniqueIdentifier>
</Filter>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\CstrikeHacks.cpp"> <ClCompile Include="..\CstrikeHacks.cpp">
@ -127,9 +130,6 @@
<ClInclude Include="..\..\..\..\public\resdk\cstrike\regamedll_const.h"> <ClInclude Include="..\..\..\..\public\resdk\cstrike\regamedll_const.h">
<Filter>ReSDK\cstrike</Filter> <Filter>ReSDK\cstrike</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\..\..\public\resdk\cstrike\regamedll_interfaces.h">
<Filter>ReSDK\cstrike</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\public\resdk\engine\rehlds_api.h"> <ClInclude Include="..\..\..\..\public\resdk\engine\rehlds_api.h">
<Filter>ReSDK\engine</Filter> <Filter>ReSDK\engine</Filter>
</ClInclude> </ClInclude>
@ -142,6 +142,36 @@
<ClInclude Include="..\..\..\..\public\resdk\mod_rehlds_api.h"> <ClInclude Include="..\..\..\..\public\resdk\mod_rehlds_api.h">
<Filter>ReSDK</Filter> <Filter>ReSDK</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\..\..\public\resdk\cstrike\API\CSEntity.h">
<Filter>ReSDK\cstrike\API</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\public\resdk\cstrike\API\CSInterfaces.h">
<Filter>ReSDK\cstrike\API</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\public\resdk\cstrike\API\CSPlayer.h">
<Filter>ReSDK\cstrike\API</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\public\resdk\cstrike\API\CSPlayerItem.h">
<Filter>ReSDK\cstrike\API</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\public\resdk\cstrike\API\CSPlayerWeapon.h">
<Filter>ReSDK\cstrike\API</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\public\resdk\engine\cmd_rehlds.h">
<Filter>ReSDK\engine</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\public\resdk\engine\FlightRecorder.h">
<Filter>ReSDK\engine</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\public\resdk\engine\IObjectContainer.h">
<Filter>ReSDK\engine</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\public\resdk\engine\ObjectList.h">
<Filter>ReSDK\engine</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\public\resdk\engine\pr_dlls.h">
<Filter>ReSDK\engine</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="..\..\..\..\plugins\include\cstrike.inc"> <None Include="..\..\..\..\plugins\include\cstrike.inc">

View File

@ -120,11 +120,14 @@
<ClInclude Include="..\..\..\public\HLTypeConversion.h" /> <ClInclude Include="..\..\..\public\HLTypeConversion.h" />
<ClInclude Include="..\..\..\public\memtools\MemoryUtils.h" /> <ClInclude Include="..\..\..\public\memtools\MemoryUtils.h" />
<ClInclude Include="..\..\..\public\resdk\common\hookchains.h" /> <ClInclude Include="..\..\..\public\resdk\common\hookchains.h" />
<ClInclude Include="..\..\..\public\resdk\cstrike\API\CSEntity.h" />
<ClInclude Include="..\..\..\public\resdk\cstrike\API\CSInterfaces.h" />
<ClInclude Include="..\..\..\public\resdk\cstrike\API\CSPlayer.h" />
<ClInclude Include="..\..\..\public\resdk\cstrike\API\CSPlayerItem.h" />
<ClInclude Include="..\..\..\public\resdk\cstrike\API\CSPlayerWeapon.h" />
<ClInclude Include="..\..\..\public\resdk\cstrike\regamedll_api.h" /> <ClInclude Include="..\..\..\public\resdk\cstrike\regamedll_api.h" />
<ClInclude Include="..\..\..\public\resdk\cstrike\regamedll_const.h" /> <ClInclude Include="..\..\..\public\resdk\cstrike\regamedll_const.h" />
<ClInclude Include="..\..\..\public\resdk\cstrike\regamedll_interfaces.h" />
<ClInclude Include="..\..\..\public\resdk\mod_regamedll_api.h" /> <ClInclude Include="..\..\..\public\resdk\mod_regamedll_api.h" />
<ClInclude Include="..\..\..\public\resdk\mod_rehlds_api.h" />
<ClInclude Include="..\fakemeta_amxx.h" /> <ClInclude Include="..\fakemeta_amxx.h" />
<ClInclude Include="..\fm_tr.h" /> <ClInclude Include="..\fm_tr.h" />
<ClInclude Include="..\dllfunc.h" /> <ClInclude Include="..\dllfunc.h" />

View File

@ -45,6 +45,9 @@
<Filter Include="ReSDK\cstrike"> <Filter Include="ReSDK\cstrike">
<UniqueIdentifier>{0d1c5025-071d-43aa-b19a-2eee0d34a906}</UniqueIdentifier> <UniqueIdentifier>{0d1c5025-071d-43aa-b19a-2eee0d34a906}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="ReSDK\cstrike\API">
<UniqueIdentifier>{2800175e-06bf-42bf-b3c1-f86561471531}</UniqueIdentifier>
</Filter>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\fakemeta_amxx.cpp"> <ClCompile Include="..\fakemeta_amxx.cpp">
@ -145,14 +148,23 @@
<ClInclude Include="..\..\..\public\resdk\cstrike\regamedll_const.h"> <ClInclude Include="..\..\..\public\resdk\cstrike\regamedll_const.h">
<Filter>ReSDK\cstrike</Filter> <Filter>ReSDK\cstrike</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\..\public\resdk\cstrike\regamedll_interfaces.h">
<Filter>ReSDK\cstrike</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\resdk\mod_regamedll_api.h"> <ClInclude Include="..\..\..\public\resdk\mod_regamedll_api.h">
<Filter>ReSDK</Filter> <Filter>ReSDK</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\..\public\resdk\mod_rehlds_api.h"> <ClInclude Include="..\..\..\public\resdk\cstrike\API\CSEntity.h">
<Filter>ReSDK</Filter> <Filter>ReSDK\cstrike\API</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\resdk\cstrike\API\CSInterfaces.h">
<Filter>ReSDK\cstrike\API</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\resdk\cstrike\API\CSPlayer.h">
<Filter>ReSDK\cstrike\API</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\resdk\cstrike\API\CSPlayerItem.h">
<Filter>ReSDK\cstrike\API</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\resdk\cstrike\API\CSPlayerWeapon.h">
<Filter>ReSDK\cstrike\API</Filter>
</ClInclude> </ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -516,4 +516,16 @@ typedef struct client_s
} client_t; } client_t;
using cvar_callback_t = void (*)(const char *pszNewValue);
struct cvar_listener_t
{
cvar_listener_t(const char *var_name, cvar_callback_t handler) :
func(handler), name(var_name) {}
cvar_callback_t func;
const char *name;
};
#endif //_ENGINE_STRUCTS_H_ #endif //_ENGINE_STRUCTS_H_

View File

@ -25,6 +25,7 @@
* version. * version.
* *
*/ */
#pragma once #pragma once
template<typename t_ret, typename ...t_args> template<typename t_ret, typename ...t_args>

View File

@ -0,0 +1,65 @@
/*
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#pragma once
class CBaseEntity;
class CCSEntity
{
public:
virtual ~CCSEntity() {}
virtual void FireBullets(int iShots, Vector &vecSrc, Vector &vecDirShooting, Vector &vecSpread, float flDistance, int iBulletType, int iTracerFreq, int iDamage, entvars_t *pevAttacker);
virtual Vector FireBullets3(Vector &vecSrc, Vector &vecDirShooting, float vecSpread, float flDistance, int iPenetration, int iBulletType, int iDamage, float flRangeModifier, entvars_t *pevAttacker, bool bPistol, int shared_rand);
public:
CBaseEntity *m_pContainingEntity;
};
class CCSDelay: public CCSEntity
{
public:
};
class CCSAnimating: public CCSDelay
{
public:
};
class CCSToggle: public CCSAnimating
{
public:
};
class CCSMonster: public CCSToggle
{
public:
};

View File

@ -28,89 +28,17 @@
#pragma once #pragma once
#include "regamedll_const.h" #include "CSEntity.h"
#include "CSPlayer.h"
class CBaseEntity;
class CBasePlayer;
// Implementation wrapper
class CCSEntity {
public:
virtual ~CCSEntity() {}
virtual void FireBullets(int iShots, Vector &vecSrc, Vector &vecDirShooting, Vector &vecSpread, float flDistance, int iBulletType, int iTracerFreq, int iDamage, entvars_t *pevAttacker);
virtual Vector FireBullets3(Vector &vecSrc, Vector &vecDirShooting, float vecSpread, float flDistance, int iPenetration, int iBulletType, int iDamage, float flRangeModifier, entvars_t *pevAttacker, bool bPistol, int shared_rand);
public:
CBaseEntity *m_pContainingEntity;
};
class CCSDelay: public CCSEntity {};
class CCSAnimating: public CCSDelay {};
class CCSPlayerItem: public CCSAnimating {};
class CCSToggle: public CCSAnimating {};
class CCSMonster: public CCSToggle {};
class CCSWeaponBox: public CCSEntity {}; class CCSWeaponBox: public CCSEntity {};
class CCSArmoury: public CCSEntity {}; class CCSArmoury: public CCSEntity {};
class CCSPlayer: public CCSMonster {
public:
CCSPlayer() : m_bForceShowMenu(false)
{
m_szModel[0] = '\0';
}
virtual bool IsConnected() const;
virtual void SetAnimation(PLAYER_ANIM playerAnim);
virtual void AddAccount(int amount, RewardType type = RT_NONE, bool bTrackChange = true);
virtual CBaseEntity *GiveNamedItem(const char *pszName);
virtual CBaseEntity *GiveNamedItemEx(const char *pszName);
virtual void GiveDefaultItems();
virtual void GiveShield(bool bDeploy = true);
virtual void DropShield(bool bDeploy = true);
virtual void DropPlayerItem(const char *pszItemName);
virtual void RemoveShield();
virtual void RemoveAllItems(bool bRemoveSuit);
virtual bool RemovePlayerItem(const char* pszItemName);
virtual void SetPlayerModel(bool bHasC4);
virtual void SetPlayerModelEx(const char *modelName);
virtual void SetNewPlayerModel(const char *modelName);
virtual void ClientCommand(const char *cmd, const char *arg1 = nullptr, const char *arg2 = nullptr, const char *arg3 = nullptr);
virtual void SetProgressBarTime(int time);
virtual void SetProgressBarTime2(int time, float timeElapsed);
virtual struct edict_s *EntSelectSpawnPoint();
virtual void SetBombIcon(bool bFlash = false);
virtual void SetScoreAttrib(CBasePlayer *dest);
virtual void SendItemStatus();
virtual void ReloadWeapons(CBasePlayerItem *pWeapon = nullptr, bool bForceReload = false, bool bForceRefill = false);
virtual void Observer_SetMode(int iMode);
virtual bool SelectSpawnSpot(const char *pEntClassName, CBaseEntity* &pSpot);
virtual bool SwitchWeapon(CBasePlayerItem *pWeapon);
virtual void SwitchTeam();
virtual bool JoinTeam(TeamName team);
virtual void StartObserver(Vector& vecPosition, Vector& vecViewAngle);
virtual void TeamChangeUpdate();
virtual void DropSecondary();
virtual void DropPrimary();
virtual bool HasPlayerItem(CBasePlayerItem *pCheckItem);
virtual bool HasNamedPlayerItem(const char *pszItemName);
virtual CBasePlayerItem *GetItemById(WeaponIdType weaponID);
virtual CBasePlayerItem *GetItemByName(const char *itemName);
virtual void Disappear();
virtual void MakeVIP();
virtual bool MakeBomber();
CBasePlayer *BasePlayer() const;
public:
char m_szModel[32];
bool m_bForceShowMenu;
};
class CAPI_Bot: public CCSPlayer {}; class CAPI_Bot: public CCSPlayer {};
class CAPI_CSBot: public CAPI_Bot {}; class CAPI_CSBot: public CAPI_Bot {};
class CCSShield: public CCSEntity {}; class CCSShield: public CCSEntity {};
class CCSDeadHEV: public CCSMonster {}; class CCSDeadHEV: public CCSMonster {};
class CCSSprayCan: public CCSEntity {}; class CCSSprayCan: public CCSEntity {};
class CCSBloodSplat: public CCSEntity {}; class CCSBloodSplat: public CCSEntity {};
class CCSPlayerWeapon: public CCSPlayerItem {};
class CCSWorld: public CCSEntity {}; class CCSWorld: public CCSEntity {};
class CCSDecal: public CCSEntity {}; class CCSDecal: public CCSEntity {};
class CCSCorpse: public CCSEntity {}; class CCSCorpse: public CCSEntity {};
@ -297,7 +225,6 @@ class CCSTriggerChangeTarget: public CCSDelay {};
class CCSTriggerCamera: public CCSDelay {}; class CCSTriggerCamera: public CCSDelay {};
class CCSWeather: public CCSTrigger {}; class CCSWeather: public CCSTrigger {};
class CCSClientFog: public CCSEntity {}; class CCSClientFog: public CCSEntity {};
class CCSTriggerSetOrigin: public CCSDelay {};
inline CBasePlayer *CCSPlayer::BasePlayer() const { class CCSTriggerRandom: public CCSDelay {};
return reinterpret_cast<CBasePlayer *>(this->m_pContainingEntity); class CCSItemAirBox: public CCSArmoury {};
}

View File

@ -0,0 +1,123 @@
/*
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#pragma once
#include "CSPlayerItem.h"
#include "CSPlayerWeapon.h"
class CCSPlayer: public CCSMonster {
public:
CCSPlayer() : m_bForceShowMenu(false), m_flRespawnPending(0), m_flSpawnProtectionEndTime(0)
{
m_szModel[0] = '\0';
}
virtual bool IsConnected() const;
virtual void SetAnimation(PLAYER_ANIM playerAnim);
virtual void AddAccount(int amount, RewardType type = RT_NONE, bool bTrackChange = true);
virtual CBaseEntity *GiveNamedItem(const char *pszName);
virtual CBaseEntity *GiveNamedItemEx(const char *pszName);
virtual void GiveDefaultItems();
virtual void GiveShield(bool bDeploy = true);
virtual void DropShield(bool bDeploy = true);
virtual void DropPlayerItem(const char *pszItemName);
virtual void RemoveShield();
virtual void RemoveAllItems(bool bRemoveSuit);
virtual bool RemovePlayerItem(const char* pszItemName);
virtual void SetPlayerModel(bool bHasC4);
virtual void SetPlayerModelEx(const char *modelName);
virtual void SetNewPlayerModel(const char *modelName);
virtual void ClientCommand(const char *cmd, const char *arg1 = nullptr, const char *arg2 = nullptr, const char *arg3 = nullptr);
virtual void SetProgressBarTime(int time);
virtual void SetProgressBarTime2(int time, float timeElapsed);
virtual struct edict_s *EntSelectSpawnPoint();
virtual void SetBombIcon(bool bFlash = false);
virtual void SetScoreAttrib(CBasePlayer *dest);
virtual void SendItemStatus();
virtual void ReloadWeapons(CBasePlayerItem *pWeapon = nullptr, bool bForceReload = false, bool bForceRefill = false);
virtual void Observer_SetMode(int iMode);
virtual bool SelectSpawnSpot(const char *pEntClassName, CBaseEntity* &pSpot);
virtual bool SwitchWeapon(CBasePlayerItem *pWeapon);
virtual void SwitchTeam();
virtual bool JoinTeam(TeamName team);
virtual void StartObserver(Vector& vecPosition, Vector& vecViewAngle);
virtual void TeamChangeUpdate();
virtual void DropSecondary();
virtual void DropPrimary();
virtual bool HasPlayerItem(CBasePlayerItem *pCheckItem);
virtual bool HasNamedPlayerItem(const char *pszItemName);
virtual CBasePlayerItem *GetItemById(WeaponIdType weaponID);
virtual CBasePlayerItem *GetItemByName(const char *itemName);
virtual void Disappear();
virtual void MakeVIP();
virtual bool MakeBomber();
virtual void ResetSequenceInfo();
virtual void StartDeathCam();
virtual bool RemovePlayerItemEx(const char* pszItemName, bool bRemoveAmmo);
virtual void SetSpawnProtection(float flProtectionTime);
virtual void RemoveSpawnProtection();
CBasePlayer *BasePlayer() const;
public:
enum EProtectionState
{
ProtectionSt_NoSet,
ProtectionSt_Active,
ProtectionSt_Expired,
};
EProtectionState GetProtectionState() const;
public:
char m_szModel[32];
bool m_bForceShowMenu;
float m_flRespawnPending;
float m_flSpawnProtectionEndTime;
};
// Inlines
inline CBasePlayer *CCSPlayer::BasePlayer() const
{
return reinterpret_cast<CBasePlayer *>(this->m_pContainingEntity);
}
inline CCSPlayer::EProtectionState CCSPlayer::GetProtectionState() const
{
// no protection set
if (m_flSpawnProtectionEndTime <= 0.0f)
return ProtectionSt_NoSet;
// check if end time of protection isn't expired yet
if (m_flSpawnProtectionEndTime >= gpGlobals->time)
return ProtectionSt_Active;
// has expired
return ProtectionSt_Expired;
}

View File

@ -0,0 +1,68 @@
/*
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#pragma once
typedef struct
{
int iSlot;
int iPosition;
const char *pszAmmo1;
int iMaxAmmo1;
const char *pszAmmo2;
int iMaxAmmo2;
const char *pszName;
int iMaxClip;
int iId;
int iFlags;
int iWeight;
}
ItemInfo;
class CBasePlayerItem;
class CCSPlayerItem: public CCSAnimating
{
public:
CCSPlayerItem()
{
memset(&m_ItemInfo, 0, sizeof(m_ItemInfo));
}
virtual void SetItemInfo(ItemInfo *pInfo);
CBasePlayerItem *BasePlayerItem() const;
public:
ItemInfo m_ItemInfo;
};
// Inlines
inline CBasePlayerItem *CCSPlayerItem::BasePlayerItem() const
{
return reinterpret_cast<CBasePlayerItem *>(this->m_pContainingEntity);
}

View File

@ -0,0 +1,50 @@
/*
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#pragma once
class CBasePlayerWeapon;
class CCSPlayerWeapon: public CCSPlayerItem
{
public:
CCSPlayerWeapon() :
m_bHasSecondaryAttack(false)
{
}
CBasePlayerWeapon *BasePlayerWeapon() const;
public:
bool m_bHasSecondaryAttack;
};
// Inlines
inline CBasePlayerWeapon *CCSPlayerWeapon::BasePlayerWeapon() const
{
return reinterpret_cast<CBasePlayerWeapon *>(this->m_pContainingEntity);
}

View File

@ -25,23 +25,24 @@
* version. * version.
* *
*/ */
#pragma once #pragma once
#include <engine_strucs.h> #include <engine_strucs.h>
#include "regamedll_interfaces.h"
#include "regamedll_const.h" #include "regamedll_const.h"
#include "API/CSInterfaces.h"
#include "../common/hookchains.h" #include "../common/hookchains.h"
#define REGAMEDLL_API_VERSION_MAJOR 5 #define REGAMEDLL_API_VERSION_MAJOR 5
#define REGAMEDLL_API_VERSION_MINOR 1 #define REGAMEDLL_API_VERSION_MINOR 8
// CBasePlayer::Spawn hook // CBasePlayer::Spawn hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_Spawn; typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_Spawn;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_Spawn; typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_Spawn;
// CBasePlayer::Precache hook // CBasePlayer::Precache hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_Precache; typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_Precache;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_Precache; typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_Precache;
// CBasePlayer::ObjectCaps hook // CBasePlayer::ObjectCaps hook
typedef IHookChainClass<int, class CBasePlayer> IReGameHook_CBasePlayer_ObjectCaps; typedef IHookChainClass<int, class CBasePlayer> IReGameHook_CBasePlayer_ObjectCaps;
@ -52,8 +53,8 @@ typedef IHookChainClass<int, class CBasePlayer> IReGameHook_CBasePlayer_Classify
typedef IHookChainRegistryClass<int, class CBasePlayer> IReGameHookRegistry_CBasePlayer_Classify; typedef IHookChainRegistryClass<int, class CBasePlayer> IReGameHookRegistry_CBasePlayer_Classify;
// CBasePlayer::TraceAttack hook // CBasePlayer::TraceAttack hook
typedef IVoidHookChainClass<class CBasePlayer, struct entvars_s *, float, Vector &, TraceResult *, int> IReGameHook_CBasePlayer_TraceAttack; typedef IHookChainClass<void, class CBasePlayer, struct entvars_s *, float, Vector &, TraceResult *, int> IReGameHook_CBasePlayer_TraceAttack;
typedef IVoidHookChainRegistryClass<class CBasePlayer, struct entvars_s *, float, Vector &, TraceResult *, int> IReGameHookRegistry_CBasePlayer_TraceAttack; typedef IHookChainRegistryClass<void, class CBasePlayer, struct entvars_s *, float, Vector &, TraceResult *, int> IReGameHookRegistry_CBasePlayer_TraceAttack;
// CBasePlayer::TakeDamage hook // CBasePlayer::TakeDamage hook
typedef IHookChainClass<BOOL, class CBasePlayer, struct entvars_s *, struct entvars_s *, float&, int> IReGameHook_CBasePlayer_TakeDamage; typedef IHookChainClass<BOOL, class CBasePlayer, struct entvars_s *, struct entvars_s *, float&, int> IReGameHook_CBasePlayer_TakeDamage;
@ -64,16 +65,16 @@ typedef IHookChainClass<BOOL, class CBasePlayer, float, int> IReGameHook_CBasePl
typedef IHookChainRegistryClass<BOOL, class CBasePlayer, float, int> IReGameHookRegistry_CBasePlayer_TakeHealth; typedef IHookChainRegistryClass<BOOL, class CBasePlayer, float, int> IReGameHookRegistry_CBasePlayer_TakeHealth;
// CBasePlayer::Killed hook // CBasePlayer::Killed hook
typedef IVoidHookChainClass<class CBasePlayer, struct entvars_s *, int> IReGameHook_CBasePlayer_Killed; typedef IHookChainClass<void, class CBasePlayer, struct entvars_s *, int> IReGameHook_CBasePlayer_Killed;
typedef IVoidHookChainRegistryClass<class CBasePlayer, struct entvars_s *, int> IReGameHookRegistry_CBasePlayer_Killed; typedef IHookChainRegistryClass<void, class CBasePlayer, struct entvars_s *, int> IReGameHookRegistry_CBasePlayer_Killed;
// CBasePlayer::AddPoints hook // CBasePlayer::AddPoints hook
typedef IVoidHookChainClass<class CBasePlayer, int, BOOL> IReGameHook_CBasePlayer_AddPoints; typedef IHookChainClass<void, class CBasePlayer, int, BOOL> IReGameHook_CBasePlayer_AddPoints;
typedef IVoidHookChainRegistryClass<class CBasePlayer, int, BOOL> IReGameHookRegistry_CBasePlayer_AddPoints; typedef IHookChainRegistryClass<void, class CBasePlayer, int, BOOL> IReGameHookRegistry_CBasePlayer_AddPoints;
// CBasePlayer::AddPointsToTeam hook // CBasePlayer::AddPointsToTeam hook
typedef IVoidHookChainClass<class CBasePlayer, int, BOOL> IReGameHook_CBasePlayer_AddPointsToTeam; typedef IHookChainClass<void, class CBasePlayer, int, BOOL> IReGameHook_CBasePlayer_AddPointsToTeam;
typedef IVoidHookChainRegistryClass<class CBasePlayer, int, BOOL> IReGameHookRegistry_CBasePlayer_AddPointsToTeam; typedef IHookChainRegistryClass<void, class CBasePlayer, int, BOOL> IReGameHookRegistry_CBasePlayer_AddPointsToTeam;
// CBasePlayer::AddPlayerItem hook // CBasePlayer::AddPlayerItem hook
typedef IHookChainClass<BOOL, class CBasePlayer, class CBasePlayerItem *> IReGameHook_CBasePlayer_AddPlayerItem; typedef IHookChainClass<BOOL, class CBasePlayer, class CBasePlayerItem *> IReGameHook_CBasePlayer_AddPlayerItem;
@ -84,72 +85,72 @@ typedef IHookChainClass<BOOL, class CBasePlayer, class CBasePlayerItem *> IReGam
typedef IHookChainRegistryClass<BOOL, class CBasePlayer, class CBasePlayerItem *> IReGameHookRegistry_CBasePlayer_RemovePlayerItem; typedef IHookChainRegistryClass<BOOL, class CBasePlayer, class CBasePlayerItem *> IReGameHookRegistry_CBasePlayer_RemovePlayerItem;
// CBasePlayer::GiveAmmo hook // CBasePlayer::GiveAmmo hook
typedef IHookChainClass<int, class CBasePlayer, int , char *, int> IReGameHook_CBasePlayer_GiveAmmo; typedef IHookChainClass<int, class CBasePlayer, int , const char *, int> IReGameHook_CBasePlayer_GiveAmmo;
typedef IHookChainRegistryClass<int, class CBasePlayer, int , char *, int> IReGameHookRegistry_CBasePlayer_GiveAmmo; typedef IHookChainRegistryClass<int, class CBasePlayer, int , const char *, int> IReGameHookRegistry_CBasePlayer_GiveAmmo;
// CBasePlayer::ResetMaxSpeed hook // CBasePlayer::ResetMaxSpeed hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_ResetMaxSpeed; typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_ResetMaxSpeed;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_ResetMaxSpeed; typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_ResetMaxSpeed;
// CBasePlayer::Jump hook // CBasePlayer::Jump hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_Jump; typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_Jump;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_Jump; typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_Jump;
// CBasePlayer::Duck hook // CBasePlayer::Duck hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_Duck; typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_Duck;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_Duck; typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_Duck;
// CBasePlayer::PreThink hook // CBasePlayer::PreThink hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_PreThink; typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_PreThink;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_PreThink; typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_PreThink;
// CBasePlayer::PostThink hook // CBasePlayer::PostThink hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_PostThink; typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_PostThink;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_PostThink; typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_PostThink;
// CBasePlayer::UpdateClientData hook // CBasePlayer::UpdateClientData hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_UpdateClientData; typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_UpdateClientData;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_UpdateClientData; typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_UpdateClientData;
// CBasePlayer::ImpulseCommands hook // CBasePlayer::ImpulseCommands hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_ImpulseCommands; typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_ImpulseCommands;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_ImpulseCommands; typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_ImpulseCommands;
// CBasePlayer::RoundRespawn hook // CBasePlayer::RoundRespawn hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_RoundRespawn; typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_RoundRespawn;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_RoundRespawn; typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_RoundRespawn;
// CBasePlayer::Blind hook // CBasePlayer::Blind hook
typedef IVoidHookChainClass<class CBasePlayer, float, float, float, int> IReGameHook_CBasePlayer_Blind; typedef IHookChainClass<void, class CBasePlayer, float, float, float, int> IReGameHook_CBasePlayer_Blind;
typedef IVoidHookChainRegistryClass<class CBasePlayer, float, float, float, int> IReGameHookRegistry_CBasePlayer_Blind; typedef IHookChainRegistryClass<void, class CBasePlayer, float, float, float, int> IReGameHookRegistry_CBasePlayer_Blind;
// CBasePlayer::Observer_IsValidTarget hook // CBasePlayer::Observer_IsValidTarget hook
typedef IHookChainClass<class CBasePlayer *, class CBasePlayer, int, bool> IReGameHook_CBasePlayer_Observer_IsValidTarget; typedef IHookChainClass<class CBasePlayer *, class CBasePlayer, int, bool> IReGameHook_CBasePlayer_Observer_IsValidTarget;
typedef IHookChainRegistryClass<class CBasePlayer *, class CBasePlayer, int, bool> IReGameHookRegistry_CBasePlayer_Observer_IsValidTarget; typedef IHookChainRegistryClass<class CBasePlayer *, class CBasePlayer, int, bool> IReGameHookRegistry_CBasePlayer_Observer_IsValidTarget;
// CBasePlayer::SetAnimation hook // CBasePlayer::SetAnimation hook
typedef IVoidHookChainClass<class CBasePlayer, PLAYER_ANIM> IReGameHook_CBasePlayer_SetAnimation; typedef IHookChainClass<void, class CBasePlayer, PLAYER_ANIM> IReGameHook_CBasePlayer_SetAnimation;
typedef IVoidHookChainRegistryClass<class CBasePlayer, PLAYER_ANIM> IReGameHookRegistry_CBasePlayer_SetAnimation; typedef IHookChainRegistryClass<void, class CBasePlayer, PLAYER_ANIM> IReGameHookRegistry_CBasePlayer_SetAnimation;
// CBasePlayer::GiveDefaultItems hook // CBasePlayer::GiveDefaultItems hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_GiveDefaultItems; typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_GiveDefaultItems;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_GiveDefaultItems; typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_GiveDefaultItems;
// CBasePlayer::GiveNamedItem hook // CBasePlayer::GiveNamedItem hook
typedef IHookChainClass<class CBaseEntity *, class CBasePlayer, const char *> IReGameHook_CBasePlayer_GiveNamedItem; typedef IHookChainClass<class CBaseEntity *, class CBasePlayer, const char *> IReGameHook_CBasePlayer_GiveNamedItem;
typedef IHookChainRegistryClass<class CBaseEntity *, class CBasePlayer, const char *> IReGameHookRegistry_CBasePlayer_GiveNamedItem; typedef IHookChainRegistryClass<class CBaseEntity *, class CBasePlayer, const char *> IReGameHookRegistry_CBasePlayer_GiveNamedItem;
// CBasePlayer::AddAccount hook // CBasePlayer::AddAccount hook
typedef IVoidHookChainClass<class CBasePlayer, int, RewardType, bool> IReGameHook_CBasePlayer_AddAccount; typedef IHookChainClass<void, class CBasePlayer, int, RewardType, bool> IReGameHook_CBasePlayer_AddAccount;
typedef IVoidHookChainRegistryClass<class CBasePlayer, int, RewardType, bool> IReGameHookRegistry_CBasePlayer_AddAccount; typedef IHookChainRegistryClass<void, class CBasePlayer, int, RewardType, bool> IReGameHookRegistry_CBasePlayer_AddAccount;
// CBasePlayer::GiveShield hook // CBasePlayer::GiveShield hook
typedef IVoidHookChainClass<class CBasePlayer, bool> IReGameHook_CBasePlayer_GiveShield; typedef IHookChainClass<void, class CBasePlayer, bool> IReGameHook_CBasePlayer_GiveShield;
typedef IVoidHookChainRegistryClass<class CBasePlayer, bool> IReGameHookRegistry_CBasePlayer_GiveShield; typedef IHookChainRegistryClass<void, class CBasePlayer, bool> IReGameHookRegistry_CBasePlayer_GiveShield;
// CBasePlayer:SetClientUserInfoModel hook // CBasePlayer:SetClientUserInfoModel hook
typedef IVoidHookChainClass<class CBasePlayer, char *, char *> IReGameHook_CBasePlayer_SetClientUserInfoModel; typedef IHookChainClass<void, class CBasePlayer, char *, char *> IReGameHook_CBasePlayer_SetClientUserInfoModel;
typedef IVoidHookChainRegistryClass<class CBasePlayer, char *, char *> IReGameHookRegistry_CBasePlayer_SetClientUserInfoModel; typedef IHookChainRegistryClass<void, class CBasePlayer, char *, char *> IReGameHookRegistry_CBasePlayer_SetClientUserInfoModel;
// CBasePlayer:SetClientUserInfoName hook // CBasePlayer:SetClientUserInfoName hook
typedef IHookChainClass<bool, class CBasePlayer, char *, char *> IReGameHook_CBasePlayer_SetClientUserInfoName; typedef IHookChainClass<bool, class CBasePlayer, char *, char *> IReGameHook_CBasePlayer_SetClientUserInfoName;
@ -160,56 +161,56 @@ typedef IHookChainClass<bool, class CBasePlayer, ItemID, ItemRestType> IReGameHo
typedef IHookChainRegistryClass<bool, class CBasePlayer, ItemID, ItemRestType> IReGameHookRegistry_CBasePlayer_HasRestrictItem; typedef IHookChainRegistryClass<bool, class CBasePlayer, ItemID, ItemRestType> IReGameHookRegistry_CBasePlayer_HasRestrictItem;
// CBasePlayer::DropPlayerItem hook // CBasePlayer::DropPlayerItem hook
typedef IVoidHookChainClass<class CBasePlayer, const char *> IReGameHook_CBasePlayer_DropPlayerItem; typedef IHookChainClass<class CBaseEntity *, class CBasePlayer, const char *> IReGameHook_CBasePlayer_DropPlayerItem;
typedef IVoidHookChainRegistryClass<class CBasePlayer, const char *> IReGameHookRegistry_CBasePlayer_DropPlayerItem; typedef IHookChainRegistryClass<class CBaseEntity *, class CBasePlayer, const char *> IReGameHookRegistry_CBasePlayer_DropPlayerItem;
// CBasePlayer::DropShield hook // CBasePlayer::DropShield hook
typedef IVoidHookChainClass<class CBasePlayer, bool> IReGameHook_CBasePlayer_DropShield; typedef IHookChainClass<class CBaseEntity *, class CBasePlayer, bool> IReGameHook_CBasePlayer_DropShield;
typedef IVoidHookChainRegistryClass<class CBasePlayer, bool> IReGameHookRegistry_CBasePlayer_DropShield; typedef IHookChainRegistryClass<class CBaseEntity *, class CBasePlayer, bool> IReGameHookRegistry_CBasePlayer_DropShield;
// CBasePlayer::OnSpawnEquip hook // CBasePlayer::OnSpawnEquip hook
typedef IVoidHookChainClass<class CBasePlayer, bool, bool> IReGameHook_CBasePlayer_OnSpawnEquip; typedef IHookChainClass<void, class CBasePlayer, bool, bool> IReGameHook_CBasePlayer_OnSpawnEquip;
typedef IVoidHookChainRegistryClass<class CBasePlayer, bool, bool> IReGameHookRegistry_CBasePlayer_OnSpawnEquip; typedef IHookChainRegistryClass<void, class CBasePlayer, bool, bool> IReGameHookRegistry_CBasePlayer_OnSpawnEquip;
// CBasePlayer::Radio hook // CBasePlayer::Radio hook
typedef IVoidHookChainClass<class CBasePlayer, const char *, const char *, short, bool> IReGameHook_CBasePlayer_Radio; typedef IHookChainClass<void, class CBasePlayer, const char *, const char *, short, bool> IReGameHook_CBasePlayer_Radio;
typedef IVoidHookChainRegistryClass<class CBasePlayer, const char *, const char *, short, bool> IReGameHookRegistry_CBasePlayer_Radio; typedef IHookChainRegistryClass<void, class CBasePlayer, const char *, const char *, short, bool> IReGameHookRegistry_CBasePlayer_Radio;
// CBasePlayer::Disappear hook // CBasePlayer::Disappear hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_Disappear; typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_Disappear;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_Disappear; typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_Disappear;
// CBasePlayer::MakeVIP hook // CBasePlayer::MakeVIP hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_MakeVIP; typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_MakeVIP;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_MakeVIP; typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_MakeVIP;
// CBasePlayer::MakeBomber hook // CBasePlayer::MakeBomber hook
typedef IHookChainClass<bool, class CBasePlayer> IReGameHook_CBasePlayer_MakeBomber; typedef IHookChainClass<bool, class CBasePlayer> IReGameHook_CBasePlayer_MakeBomber;
typedef IHookChainRegistryClass<bool, class CBasePlayer> IReGameHookRegistry_CBasePlayer_MakeBomber; typedef IHookChainRegistryClass<bool, class CBasePlayer> IReGameHookRegistry_CBasePlayer_MakeBomber;
// CBasePlayer::StartObserver hook // CBasePlayer::StartObserver hook
typedef IVoidHookChainClass<class CBasePlayer, Vector &, Vector &> IReGameHook_CBasePlayer_StartObserver; typedef IHookChainClass<void, class CBasePlayer, Vector &, Vector &> IReGameHook_CBasePlayer_StartObserver;
typedef IVoidHookChainRegistryClass<class CBasePlayer, Vector &, Vector &> IReGameHookRegistry_CBasePlayer_StartObserver; typedef IHookChainRegistryClass<void, class CBasePlayer, Vector &, Vector &> IReGameHookRegistry_CBasePlayer_StartObserver;
// CBasePlayer::GetIntoGame hook // CBasePlayer::GetIntoGame hook
typedef IHookChainClass<bool, class CBasePlayer> IReGameHook_CBasePlayer_GetIntoGame; typedef IHookChainClass<bool, class CBasePlayer> IReGameHook_CBasePlayer_GetIntoGame;
typedef IHookChainRegistryClass<bool, class CBasePlayer> IReGameHookRegistry_CBasePlayer_GetIntoGame; typedef IHookChainRegistryClass<bool, class CBasePlayer> IReGameHookRegistry_CBasePlayer_GetIntoGame;
// CBaseAnimating::ResetSequenceInfo hook // CBaseAnimating::ResetSequenceInfo hook
typedef IVoidHookChainClass<class CBaseAnimating> IReGameHook_CBaseAnimating_ResetSequenceInfo; typedef IHookChainClass<void, class CBaseAnimating> IReGameHook_CBaseAnimating_ResetSequenceInfo;
typedef IVoidHookChainRegistryClass<class CBaseAnimating> IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo; typedef IHookChainRegistryClass<void, class CBaseAnimating> IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo;
// GetForceCamera hook // GetForceCamera hook
typedef IHookChain<int, class CBasePlayer *> IReGameHook_GetForceCamera; typedef IHookChain<int, class CBasePlayer *> IReGameHook_GetForceCamera;
typedef IHookChainRegistry<int, class CBasePlayer *> IReGameHookRegistry_GetForceCamera; typedef IHookChainRegistry<int, class CBasePlayer *> IReGameHookRegistry_GetForceCamera;
// PlayerBlind hook // PlayerBlind hook
typedef IVoidHookChain<class CBasePlayer *, struct entvars_s *, struct entvars_s *, float, float, int, Vector &> IReGameHook_PlayerBlind; typedef IHookChain<void, class CBasePlayer *, struct entvars_s *, struct entvars_s *, float, float, int, Vector &> IReGameHook_PlayerBlind;
typedef IVoidHookChainRegistry<class CBasePlayer *, struct entvars_s *, struct entvars_s *, float, float, int, Vector &> IReGameHookRegistry_PlayerBlind; typedef IHookChainRegistry<void, class CBasePlayer *, struct entvars_s *, struct entvars_s *, float, float, int, Vector &> IReGameHookRegistry_PlayerBlind;
// RadiusFlash_TraceLine hook // RadiusFlash_TraceLine hook
typedef IVoidHookChain<class CBasePlayer *, struct entvars_s *, struct entvars_s *, Vector &, Vector &, TraceResult *> IReGameHook_RadiusFlash_TraceLine; typedef IHookChain<void, class CBasePlayer *, struct entvars_s *, struct entvars_s *, Vector &, Vector &, TraceResult *> IReGameHook_RadiusFlash_TraceLine;
typedef IVoidHookChainRegistry<class CBasePlayer *, struct entvars_s *, struct entvars_s *, Vector &, Vector &, TraceResult *> IReGameHookRegistry_RadiusFlash_TraceLine; typedef IHookChainRegistry<void, class CBasePlayer *, struct entvars_s *, struct entvars_s *, Vector &, Vector &, TraceResult *> IReGameHookRegistry_RadiusFlash_TraceLine;
// RoundEnd hook // RoundEnd hook
typedef IHookChain<bool, int, ScenarioEventEndRound, float> IReGameHook_RoundEnd; typedef IHookChain<bool, int, ScenarioEventEndRound, float> IReGameHook_RoundEnd;
@ -220,32 +221,32 @@ typedef IHookChain<class CGameRules *> IReGameHook_InstallGameRules;
typedef IHookChainRegistry<class CGameRules *> IReGameHookRegistry_InstallGameRules; typedef IHookChainRegistry<class CGameRules *> IReGameHookRegistry_InstallGameRules;
// PM_Init hook // PM_Init hook
typedef IVoidHookChain<struct playermove_s *> IReGameHook_PM_Init; typedef IHookChain<void, struct playermove_s *> IReGameHook_PM_Init;
typedef IVoidHookChainRegistry<struct playermove_s *> IReGameHookRegistry_PM_Init; typedef IHookChainRegistry<void, struct playermove_s *> IReGameHookRegistry_PM_Init;
// PM_Move hook // PM_Move hook
typedef IVoidHookChain<struct playermove_s *, int> IReGameHook_PM_Move; typedef IHookChain<void, struct playermove_s *, int> IReGameHook_PM_Move;
typedef IVoidHookChainRegistry<struct playermove_s *, int> IReGameHookRegistry_PM_Move; typedef IHookChainRegistry<void, struct playermove_s *, int> IReGameHookRegistry_PM_Move;
// PM_AirMove hook // PM_AirMove hook
typedef IVoidHookChain<int> IReGameHook_PM_AirMove; typedef IHookChain<void, int> IReGameHook_PM_AirMove;
typedef IVoidHookChainRegistry<int> IReGameHookRegistry_PM_AirMove; typedef IHookChainRegistry<void, int> IReGameHookRegistry_PM_AirMove;
// HandleMenu_ChooseAppearance hook // HandleMenu_ChooseAppearance hook
typedef IVoidHookChain<class CBasePlayer *, int> IReGameHook_HandleMenu_ChooseAppearance; typedef IHookChain<void, class CBasePlayer *, int> IReGameHook_HandleMenu_ChooseAppearance;
typedef IVoidHookChainRegistry<class CBasePlayer *, int> IReGameHookRegistry_HandleMenu_ChooseAppearance; typedef IHookChainRegistry<void, class CBasePlayer *, int> IReGameHookRegistry_HandleMenu_ChooseAppearance;
// HandleMenu_ChooseTeam hook // HandleMenu_ChooseTeam hook
typedef IHookChain<BOOL, class CBasePlayer *, int> IReGameHook_HandleMenu_ChooseTeam; typedef IHookChain<BOOL, class CBasePlayer *, int> IReGameHook_HandleMenu_ChooseTeam;
typedef IHookChainRegistry<BOOL, class CBasePlayer *, int> IReGameHookRegistry_HandleMenu_ChooseTeam; typedef IHookChainRegistry<BOOL, class CBasePlayer *, int> IReGameHookRegistry_HandleMenu_ChooseTeam;
// ShowMenu hook // ShowMenu hook
typedef IVoidHookChain<class CBasePlayer *, int, int, BOOL, char *> IReGameHook_ShowMenu; typedef IHookChain<void, class CBasePlayer *, int, int, BOOL, char *> IReGameHook_ShowMenu;
typedef IVoidHookChainRegistry<class CBasePlayer *, int, int, BOOL, char *> IReGameHookRegistry_ShowMenu; typedef IHookChainRegistry<void, class CBasePlayer *, int, int, BOOL, char *> IReGameHookRegistry_ShowMenu;
// ShowVGUIMenu hook // ShowVGUIMenu hook
typedef IVoidHookChain<class CBasePlayer *, int, int, char *> IReGameHook_ShowVGUIMenu; typedef IHookChain<void, class CBasePlayer *, int, int, char *> IReGameHook_ShowVGUIMenu;
typedef IVoidHookChainRegistry<class CBasePlayer *, int, int, char *> IReGameHookRegistry_ShowVGUIMenu; typedef IHookChainRegistry<void, class CBasePlayer *, int, int, char *> IReGameHookRegistry_ShowVGUIMenu;
// BuyGunAmmo hook // BuyGunAmmo hook
typedef IHookChain<bool, class CBasePlayer *, class CBasePlayerItem *, bool> IReGameHook_BuyGunAmmo; typedef IHookChain<bool, class CBasePlayer *, class CBasePlayerItem *, bool> IReGameHook_BuyGunAmmo;
@ -256,8 +257,8 @@ typedef IHookChain<class CBaseEntity *, class CBasePlayer *, WeaponIdType> IReGa
typedef IHookChainRegistry<class CBaseEntity *, class CBasePlayer *, WeaponIdType> IReGameHookRegistry_BuyWeaponByWeaponID; typedef IHookChainRegistry<class CBaseEntity *, class CBasePlayer *, WeaponIdType> IReGameHookRegistry_BuyWeaponByWeaponID;
// InternalCommand hook // InternalCommand hook
typedef IVoidHookChain<edict_t *, const char *, const char *> IReGameHook_InternalCommand; typedef IHookChain<void, edict_t *, const char *, const char *> IReGameHook_InternalCommand;
typedef IVoidHookChainRegistry<edict_t *, const char *, const char *> IReGameHookRegistry_InternalCommand; typedef IHookChainRegistry<void, edict_t *, const char *, const char *> IReGameHookRegistry_InternalCommand;
// CHalfLifeMultiplay::FShouldSwitchWeapon hook // CHalfLifeMultiplay::FShouldSwitchWeapon hook
typedef IHookChain<BOOL, class CBasePlayer *, class CBasePlayerItem *> IReGameHook_CSGameRules_FShouldSwitchWeapon; typedef IHookChain<BOOL, class CBasePlayer *, class CBasePlayerItem *> IReGameHook_CSGameRules_FShouldSwitchWeapon;
@ -276,8 +277,8 @@ typedef IHookChain<BOOL, class CBasePlayer *, CBaseEntity *> IReGameHook_CSGameR
typedef IHookChainRegistry<BOOL, class CBasePlayer *, CBaseEntity *> IReGameHookRegistry_CSGameRules_FPlayerCanTakeDamage; typedef IHookChainRegistry<BOOL, class CBasePlayer *, CBaseEntity *> IReGameHookRegistry_CSGameRules_FPlayerCanTakeDamage;
// CHalfLifeMultiplay::PlayerSpawn hook // CHalfLifeMultiplay::PlayerSpawn hook
typedef IVoidHookChain<class CBasePlayer *> IReGameHook_CSGameRules_PlayerSpawn; typedef IHookChain<void, class CBasePlayer *> IReGameHook_CSGameRules_PlayerSpawn;
typedef IVoidHookChainRegistry<class CBasePlayer *> IReGameHookRegistry_CSGameRules_PlayerSpawn; typedef IHookChainRegistry<void, class CBasePlayer *> IReGameHookRegistry_CSGameRules_PlayerSpawn;
// CHalfLifeMultiplay::FPlayerCanRespawn hook // CHalfLifeMultiplay::FPlayerCanRespawn hook
typedef IHookChain<BOOL, class CBasePlayer *> IReGameHook_CSGameRules_FPlayerCanRespawn; typedef IHookChain<BOOL, class CBasePlayer *> IReGameHook_CSGameRules_FPlayerCanRespawn;
@ -288,16 +289,16 @@ typedef IHookChain<struct edict_s *, class CBasePlayer *> IReGameHook_CSGameRule
typedef IHookChainRegistry<struct edict_s *, class CBasePlayer *> IReGameHookRegistry_CSGameRules_GetPlayerSpawnSpot; typedef IHookChainRegistry<struct edict_s *, class CBasePlayer *> IReGameHookRegistry_CSGameRules_GetPlayerSpawnSpot;
// CHalfLifeMultiplay::ClientUserInfoChanged hook // CHalfLifeMultiplay::ClientUserInfoChanged hook
typedef IVoidHookChain<class CBasePlayer *, char *> IReGameHook_CSGameRules_ClientUserInfoChanged; typedef IHookChain<void, class CBasePlayer *, char *> IReGameHook_CSGameRules_ClientUserInfoChanged;
typedef IVoidHookChainRegistry<class CBasePlayer *, char *> IReGameHookRegistry_CSGameRules_ClientUserInfoChanged; typedef IHookChainRegistry<void, class CBasePlayer *, char *> IReGameHookRegistry_CSGameRules_ClientUserInfoChanged;
// CHalfLifeMultiplay::PlayerKilled hook // CHalfLifeMultiplay::PlayerKilled hook
typedef IVoidHookChain<class CBasePlayer *, struct entvars_s *, struct entvars_s *> IReGameHook_CSGameRules_PlayerKilled; typedef IHookChain<void, class CBasePlayer *, struct entvars_s *, struct entvars_s *> IReGameHook_CSGameRules_PlayerKilled;
typedef IVoidHookChainRegistry<class CBasePlayer *, struct entvars_s *, struct entvars_s *> IReGameHookRegistry_CSGameRules_PlayerKilled; typedef IHookChainRegistry<void, class CBasePlayer *, struct entvars_s *, struct entvars_s *> IReGameHookRegistry_CSGameRules_PlayerKilled;
// CHalfLifeMultiplay::DeathNotice hook // CHalfLifeMultiplay::DeathNotice hook
typedef IVoidHookChain<class CBasePlayer *, struct entvars_s *, struct entvars_s *> IReGameHook_CSGameRules_DeathNotice; typedef IHookChain<void, class CBasePlayer *, struct entvars_s *, struct entvars_s *> IReGameHook_CSGameRules_DeathNotice;
typedef IVoidHookChainRegistry<class CBasePlayer *, struct entvars_s *, struct entvars_s *> IReGameHookRegistry_CSGameRules_DeathNotice; typedef IHookChainRegistry<void, class CBasePlayer *, struct entvars_s *, struct entvars_s *> IReGameHookRegistry_CSGameRules_DeathNotice;
// CHalfLifeMultiplay::CanHavePlayerItem hook // CHalfLifeMultiplay::CanHavePlayerItem hook
typedef IHookChain<BOOL, class CBasePlayer *, class CBasePlayerItem *> IReGameHook_CSGameRules_CanHavePlayerItem; typedef IHookChain<BOOL, class CBasePlayer *, class CBasePlayerItem *> IReGameHook_CSGameRules_CanHavePlayerItem;
@ -308,52 +309,128 @@ typedef IHookChain<int, class CBasePlayer *> IReGameHook_CSGameRules_DeadPlayerW
typedef IHookChainRegistry<int, class CBasePlayer *> IReGameHookRegistry_CSGameRules_DeadPlayerWeapons; typedef IHookChainRegistry<int, class CBasePlayer *> IReGameHookRegistry_CSGameRules_DeadPlayerWeapons;
// CHalfLifeMultiplay::ServerDeactivate hook // CHalfLifeMultiplay::ServerDeactivate hook
typedef IVoidHookChain<> IReGameHook_CSGameRules_ServerDeactivate; typedef IHookChain<void> IReGameHook_CSGameRules_ServerDeactivate;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_ServerDeactivate; typedef IHookChainRegistry<void> IReGameHookRegistry_CSGameRules_ServerDeactivate;
// CHalfLifeMultiplay::CheckMapConditions hook // CHalfLifeMultiplay::CheckMapConditions hook
typedef IVoidHookChain<> IReGameHook_CSGameRules_CheckMapConditions; typedef IHookChain<void> IReGameHook_CSGameRules_CheckMapConditions;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_CheckMapConditions; typedef IHookChainRegistry<void> IReGameHookRegistry_CSGameRules_CheckMapConditions;
// CHalfLifeMultiplay::CleanUpMap hook // CHalfLifeMultiplay::CleanUpMap hook
typedef IVoidHookChain<> IReGameHook_CSGameRules_CleanUpMap; typedef IHookChain<void> IReGameHook_CSGameRules_CleanUpMap;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_CleanUpMap; typedef IHookChainRegistry<void> IReGameHookRegistry_CSGameRules_CleanUpMap;
// CHalfLifeMultiplay::RestartRound hook // CHalfLifeMultiplay::RestartRound hook
typedef IVoidHookChain<> IReGameHook_CSGameRules_RestartRound; typedef IHookChain<void> IReGameHook_CSGameRules_RestartRound;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_RestartRound; typedef IHookChainRegistry<void> IReGameHookRegistry_CSGameRules_RestartRound;
// CHalfLifeMultiplay::CheckWinConditions hook // CHalfLifeMultiplay::CheckWinConditions hook
typedef IVoidHookChain<> IReGameHook_CSGameRules_CheckWinConditions; typedef IHookChain<void> IReGameHook_CSGameRules_CheckWinConditions;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_CheckWinConditions; typedef IHookChainRegistry<void> IReGameHookRegistry_CSGameRules_CheckWinConditions;
// CHalfLifeMultiplay::RemoveGuns hook // CHalfLifeMultiplay::RemoveGuns hook
typedef IVoidHookChain<> IReGameHook_CSGameRules_RemoveGuns; typedef IHookChain<void> IReGameHook_CSGameRules_RemoveGuns;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_RemoveGuns; typedef IHookChainRegistry<void> IReGameHookRegistry_CSGameRules_RemoveGuns;
// CHalfLifeMultiplay::GiveC4 hook // CHalfLifeMultiplay::GiveC4 hook
typedef IVoidHookChain<> IReGameHook_CSGameRules_GiveC4; typedef IHookChain<void> IReGameHook_CSGameRules_GiveC4;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_GiveC4; typedef IHookChainRegistry<void> IReGameHookRegistry_CSGameRules_GiveC4;
// CHalfLifeMultiplay::ChangeLevel hook // CHalfLifeMultiplay::ChangeLevel hook
typedef IVoidHookChain<> IReGameHook_CSGameRules_ChangeLevel; typedef IHookChain<void> IReGameHook_CSGameRules_ChangeLevel;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_ChangeLevel; typedef IHookChainRegistry<void> IReGameHookRegistry_CSGameRules_ChangeLevel;
// CHalfLifeMultiplay::GoToIntermission hook // CHalfLifeMultiplay::GoToIntermission hook
typedef IVoidHookChain<> IReGameHook_CSGameRules_GoToIntermission; typedef IHookChain<void> IReGameHook_CSGameRules_GoToIntermission;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_GoToIntermission; typedef IHookChainRegistry<void> IReGameHookRegistry_CSGameRules_GoToIntermission;
// CHalfLifeMultiplay::BalanceTeams hook // CHalfLifeMultiplay::BalanceTeams hook
typedef IVoidHookChain<> IReGameHook_CSGameRules_BalanceTeams; typedef IHookChain<void> IReGameHook_CSGameRules_BalanceTeams;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_BalanceTeams; typedef IHookChainRegistry<void> IReGameHookRegistry_CSGameRules_BalanceTeams;
// CHalfLifeMultiplay::OnRoundFreezeEnd hook // CHalfLifeMultiplay::OnRoundFreezeEnd hook
typedef IVoidHookChain<> IReGameHook_CSGameRules_OnRoundFreezeEnd; typedef IHookChain<void> IReGameHook_CSGameRules_OnRoundFreezeEnd;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_OnRoundFreezeEnd; typedef IHookChainRegistry<void> IReGameHookRegistry_CSGameRules_OnRoundFreezeEnd;
// CSGameRules::CanPlayerHearPlayer hook
typedef IHookChain<bool, class CBasePlayer *, class CBasePlayer *> IReGameHook_CSGameRules_CanPlayerHearPlayer;
typedef IHookChainRegistry<bool, class CBasePlayer *, class CBasePlayer *> IReGameHookRegistry_CSGameRules_CanPlayerHearPlayer;
// PM_UpdateStepSound hook // PM_UpdateStepSound hook
typedef IVoidHookChain<> IReGameHook_PM_UpdateStepSound; typedef IHookChain<void> IReGameHook_PM_UpdateStepSound;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_PM_UpdateStepSound; typedef IHookChainRegistry<void> IReGameHookRegistry_PM_UpdateStepSound;
// CBasePlayer::StartDeathCam hook
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_StartDeathCam;
typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_StartDeathCam;
// CBasePlayer::SwitchTeam hook
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_SwitchTeam;
typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_SwitchTeam;
// CBasePlayer::CanSwitchTeam hook
typedef IHookChainClass<bool, class CBasePlayer, TeamName> IReGameHook_CBasePlayer_CanSwitchTeam;
typedef IHookChainRegistryClass<bool, class CBasePlayer, TeamName> IReGameHookRegistry_CBasePlayer_CanSwitchTeam;
// CBasePlayer::ThrowGrenade hook
typedef IHookChainClass<class CGrenade *, class CBasePlayer, class CBasePlayerWeapon *, Vector &, Vector &, float, unsigned short> IReGameHook_CBasePlayer_ThrowGrenade;
typedef IHookChainRegistryClass<class CGrenade *, class CBasePlayer, class CBasePlayerWeapon *, Vector &, Vector &, float, unsigned short> IReGameHookRegistry_CBasePlayer_ThrowGrenade;
// CWeaponBox::SetModel hook
typedef IHookChainClass<void, class CWeaponBox, const char *> IReGameHook_CWeaponBox_SetModel;
typedef IHookChainRegistryClass<void, class CWeaponBox, const char *> IReGameHookRegistry_CWeaponBox_SetModel;
// CGrenade::DefuseBombStart hook
typedef IHookChainClass<void, class CGrenade, class CBasePlayer *> IReGameHook_CGrenade_DefuseBombStart;
typedef IHookChainRegistryClass<void, class CGrenade, class CBasePlayer *> IReGameHookRegistry_CGrenade_DefuseBombStart;
// CGrenade::DefuseBombEnd hook
typedef IHookChainClass<void, class CGrenade, class CBasePlayer *, bool> IReGameHook_CGrenade_DefuseBombEnd;
typedef IHookChainRegistryClass<void, class CGrenade, class CBasePlayer *, bool> IReGameHookRegistry_CGrenade_DefuseBombEnd;
// CGrenade::ExplodeHeGrenade hook
typedef IHookChainClass<void, class CGrenade, TraceResult *, int> IReGameHook_CGrenade_ExplodeHeGrenade;
typedef IHookChainRegistryClass<void, class CGrenade, TraceResult *, int> IReGameHookRegistry_CGrenade_ExplodeHeGrenade;
// CGrenade::ExplodeFlashbang hook
typedef IHookChainClass<void, class CGrenade, TraceResult *, int> IReGameHook_CGrenade_ExplodeFlashbang;
typedef IHookChainRegistryClass<void, class CGrenade, TraceResult *, int> IReGameHookRegistry_CGrenade_ExplodeFlashbang;
// CGrenade::ExplodeSmokeGrenade hook
typedef IHookChainClass<void, class CGrenade> IReGameHook_CGrenade_ExplodeSmokeGrenade;
typedef IHookChainRegistryClass<void, class CGrenade> IReGameHookRegistry_CGrenade_ExplodeSmokeGrenade;
// CGrenade::ExplodeBomb hook
typedef IHookChainClass<void, class CGrenade, TraceResult *, int> IReGameHook_CGrenade_ExplodeBomb;
typedef IHookChainRegistryClass<void, class CGrenade, TraceResult *, int> IReGameHookRegistry_CGrenade_ExplodeBomb;
// ThrowHeGrenade hook
typedef IHookChain<class CGrenade *, entvars_t *, Vector &, Vector &, float, int, unsigned short> IReGameHook_ThrowHeGrenade;
typedef IHookChainRegistry<class CGrenade *, entvars_t *, Vector &, Vector &, float, int, unsigned short> IReGameHookRegistry_ThrowHeGrenade;
// ThrowFlashbang hook
typedef IHookChain<class CGrenade *, entvars_t *, Vector &, Vector &, float> IReGameHook_ThrowFlashbang;
typedef IHookChainRegistry<class CGrenade *, entvars_t *, Vector &, Vector &, float> IReGameHookRegistry_ThrowFlashbang;
// ThrowSmokeGrenade hook
typedef IHookChain<class CGrenade *, entvars_t *, Vector &, Vector &, float, unsigned short> IReGameHook_ThrowSmokeGrenade;
typedef IHookChainRegistry<class CGrenade *, entvars_t *, Vector &, Vector &, float, unsigned short> IReGameHookRegistry_ThrowSmokeGrenade;
// PlantBomb hook
typedef IHookChain<class CGrenade *, entvars_t *, Vector &, Vector &> IReGameHook_PlantBomb;
typedef IHookChainRegistry<class CGrenade *, entvars_t *, Vector &, Vector &> IReGameHookRegistry_PlantBomb;
// CBasePlayer::SetSpawnProtection hook
typedef IHookChainClass<void, class CBasePlayer, float> IReGameHook_CBasePlayer_SetSpawnProtection;
typedef IHookChainRegistryClass<void, class CBasePlayer, float> IReGameHookRegistry_CBasePlayer_SetSpawnProtection;
// CBasePlayer::RemoveSpawnProtection hook
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_RemoveSpawnProtection;
typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_RemoveSpawnProtection;
// IsPenetrableEntity hook
typedef IHookChain<bool, Vector &, Vector &, entvars_t *, edict_t *> IReGameHook_IsPenetrableEntity;
typedef IHookChainRegistry<bool, Vector &, Vector &, entvars_t *, edict_t *> IReGameHookRegistry_IsPenetrableEntity;
class IReGameHookchains { class IReGameHookchains {
public: public:
@ -444,6 +521,25 @@ public:
virtual IReGameHookRegistry_CSGameRules_BalanceTeams *CSGameRules_BalanceTeams() = 0; virtual IReGameHookRegistry_CSGameRules_BalanceTeams *CSGameRules_BalanceTeams() = 0;
virtual IReGameHookRegistry_CSGameRules_OnRoundFreezeEnd *CSGameRules_OnRoundFreezeEnd() = 0; virtual IReGameHookRegistry_CSGameRules_OnRoundFreezeEnd *CSGameRules_OnRoundFreezeEnd() = 0;
virtual IReGameHookRegistry_PM_UpdateStepSound *PM_UpdateStepSound() = 0; virtual IReGameHookRegistry_PM_UpdateStepSound *PM_UpdateStepSound() = 0;
virtual IReGameHookRegistry_CBasePlayer_StartDeathCam *CBasePlayer_StartDeathCam() = 0;
virtual IReGameHookRegistry_CBasePlayer_SwitchTeam *CBasePlayer_SwitchTeam() = 0;
virtual IReGameHookRegistry_CBasePlayer_CanSwitchTeam *CBasePlayer_CanSwitchTeam() = 0;
virtual IReGameHookRegistry_CBasePlayer_ThrowGrenade *CBasePlayer_ThrowGrenade() = 0;
virtual IReGameHookRegistry_CSGameRules_CanPlayerHearPlayer *CSGameRules_CanPlayerHearPlayer() = 0;
virtual IReGameHookRegistry_CWeaponBox_SetModel *CWeaponBox_SetModel() = 0;
virtual IReGameHookRegistry_CGrenade_DefuseBombStart *CGrenade_DefuseBombStart() = 0;
virtual IReGameHookRegistry_CGrenade_DefuseBombEnd *CGrenade_DefuseBombEnd() = 0;
virtual IReGameHookRegistry_CGrenade_ExplodeHeGrenade *CGrenade_ExplodeHeGrenade() = 0;
virtual IReGameHookRegistry_CGrenade_ExplodeFlashbang *CGrenade_ExplodeFlashbang() = 0;
virtual IReGameHookRegistry_CGrenade_ExplodeSmokeGrenade *CGrenade_ExplodeSmokeGrenade() = 0;
virtual IReGameHookRegistry_CGrenade_ExplodeBomb *CGrenade_ExplodeBomb() = 0;
virtual IReGameHookRegistry_ThrowHeGrenade *ThrowHeGrenade() = 0;
virtual IReGameHookRegistry_ThrowFlashbang *ThrowFlashbang() = 0;
virtual IReGameHookRegistry_ThrowSmokeGrenade *ThrowSmokeGrenade() = 0;
virtual IReGameHookRegistry_PlantBomb *PlantBomb() = 0;
virtual IReGameHookRegistry_CBasePlayer_RemoveSpawnProtection *CBasePlayer_RemoveSpawnProtection() = 0;
virtual IReGameHookRegistry_CBasePlayer_SetSpawnProtection *CBasePlayer_SetSpawnProtection() = 0;
virtual IReGameHookRegistry_IsPenetrableEntity *IsPenetrableEntity() = 0;
}; };
struct ReGameFuncs_t { struct ReGameFuncs_t {
@ -475,8 +571,10 @@ public:
virtual struct playermove_s *GetPlayerMove() = 0; virtual struct playermove_s *GetPlayerMove() = 0;
virtual struct WeaponSlotInfo *GetWeaponSlot(WeaponIdType weaponID) = 0; virtual struct WeaponSlotInfo *GetWeaponSlot(WeaponIdType weaponID) = 0;
virtual struct WeaponSlotInfo *GetWeaponSlot(const char *weaponName) = 0; virtual struct WeaponSlotInfo *GetWeaponSlot(const char *weaponName) = 0;
virtual struct ItemInfo* GetItemInfo(WeaponIdType weaponID) = 0; virtual ItemInfo *GetItemInfo(WeaponIdType weaponID) = 0;
virtual struct AmmoInfo *GetAmmoInfo(AmmoType ammoID) = 0; virtual struct AmmoInfo *GetAmmoInfo(AmmoType ammoID) = 0;
virtual struct AmmoInfoStruct *GetAmmoInfoEx(AmmoType ammoID) = 0;
virtual struct AmmoInfoStruct *GetAmmoInfoEx(const char *ammoName) = 0;
}; };
#define VRE_GAMEDLL_API_VERSION "VRE_GAMEDLL_API_VERSION001" #define VRE_GAMEDLL_API_VERSION "VRE_GAMEDLL_API_VERSION001"

View File

@ -0,0 +1,47 @@
/*
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#pragma once
class IObjectContainer {
public:
virtual ~IObjectContainer() {}
virtual void Init() = 0;
virtual bool Add(void *newObject) = 0;
virtual bool Remove(void *object) = 0;
virtual void Clear(bool freeElementsMemory) = 0;
virtual void *GetFirst() = 0;
virtual void *GetNext() = 0;
virtual int CountElements() = 0;
virtual bool Contains(void *object) = 0;
virtual bool IsEmpty() = 0;
};

View File

@ -0,0 +1,65 @@
/*
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#pragma once
#include "IObjectContainer.h"
class ObjectList: public IObjectContainer {
public:
EXT_FUNC void Init();
EXT_FUNC bool Add(void *newObject);
EXT_FUNC void *GetFirst();
EXT_FUNC void *GetNext();
ObjectList();
virtual ~ObjectList();
EXT_FUNC void Clear(bool freeElementsMemory = false);
EXT_FUNC int CountElements();
void *RemoveTail();
void *RemoveHead();
bool AddTail(void *newObject);
bool AddHead(void *newObject);
EXT_FUNC bool Remove(void *object);
EXT_FUNC bool Contains(void *object);
EXT_FUNC bool IsEmpty();
typedef struct element_s {
struct element_s *prev; // pointer to the last element or NULL
struct element_s *next; // pointer to the next elemnet or NULL
void *object; // the element's object
} element_t;
protected:
element_t *m_head; // first element in list
element_t *m_tail; // last element in list
element_t *m_current; // current element in list
int m_number;
};

View File

@ -27,11 +27,13 @@
*/ */
#pragma once #pragma once
#include "archtypes.h"
typedef void(*xcommand_t)(void); typedef void(*xcommand_t)(void);
typedef struct cmd_function_s typedef struct cmd_function_s
{ {
struct cmd_function_s *next; struct cmd_function_s *next;
char *name; const char *name;
xcommand_t function; xcommand_t function;
int flags; int flags;
} cmd_function_t; } cmd_function_t;

View File

@ -0,0 +1,48 @@
/*
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#pragma once
const int MAX_EXTENSION_DLL = 50;
typedef struct functiontable_s
{
uint32 pFunction;
char *pFunctionName;
} functiontable_t;
typedef struct extensiondll_s
{
void *lDLLHandle;
functiontable_t *functionTable;
int functionCount;
} extensiondll_t;
typedef void(*ENTITYINIT)(struct entvars_s *);
typedef void(*DISPATCHFUNCTION)(struct entvars_s *, void *);
typedef void(*FIELDIOFUNCTION)(SAVERESTOREDATA *, const char *, void *, TYPEDESCRIPTION *, int);

View File

@ -27,15 +27,25 @@
*/ */
#pragma once #pragma once
#if defined(WIN32)
#define FORCE_STACK_ALIGN
#else
#define FORCE_STACK_ALIGN __attribute__((force_align_arg_pointer))
#endif
#define EXT_FUNC FORCE_STACK_ALIGN
#include <engine_strucs.h> #include <engine_strucs.h>
#include <com_model.h> #include <com_model.h>
#include "cmd_rehlds.h" #include "cmd_rehlds.h"
#include "ObjectList.h"
#include "pr_dlls.h"
#include "rehlds_interfaces.h" #include "rehlds_interfaces.h"
#include "FlightRecorder.h" #include "FlightRecorder.h"
#include "../common/hookchains.h" #include "../common/hookchains.h"
#define REHLDS_API_VERSION_MAJOR 3 #define REHLDS_API_VERSION_MAJOR 3
#define REHLDS_API_VERSION_MINOR 0 #define REHLDS_API_VERSION_MINOR 4
//Steam_NotifyClientConnect hook //Steam_NotifyClientConnect hook
typedef IHookChain<qboolean, IGameClient*, const void*, unsigned int> IRehldsHook_Steam_NotifyClientConnect; typedef IHookChain<qboolean, IGameClient*, const void*, unsigned int> IRehldsHook_Steam_NotifyClientConnect;
@ -189,6 +199,10 @@ typedef IHookChainRegistry<int, enum sv_delta_s, IGameClient *, struct packet_en
typedef IHookChain<bool, edict_t *, IGameClient *, int, const char*, float, float, int, int, int, const float*> IRehldsHook_SV_EmitSound2; typedef IHookChain<bool, edict_t *, IGameClient *, int, const char*, float, float, int, int, int, const float*> IRehldsHook_SV_EmitSound2;
typedef IHookChainRegistry<bool, edict_t *, IGameClient *, int, const char*, float, float, int, int, int, const float*> IRehldsHookRegistry_SV_EmitSound2; typedef IHookChainRegistry<bool, edict_t *, IGameClient *, int, const char*, float, float, int, int, int, const float*> IRehldsHookRegistry_SV_EmitSound2;
//CreateFakeClient hook
typedef IHookChain<edict_t *, const char *> IRehldsHook_CreateFakeClient;
typedef IHookChainRegistry<edict_t *, const char *> IRehldsHookRegistry_CreateFakeClient;
class IRehldsHookchains { class IRehldsHookchains {
public: public:
virtual ~IRehldsHookchains() { } virtual ~IRehldsHookchains() { }
@ -231,6 +245,7 @@ public:
virtual IRehldsHookRegistry_SV_Spawn_f* SV_Spawn_f() = 0; virtual IRehldsHookRegistry_SV_Spawn_f* SV_Spawn_f() = 0;
virtual IRehldsHookRegistry_SV_CreatePacketEntities* SV_CreatePacketEntities() = 0; virtual IRehldsHookRegistry_SV_CreatePacketEntities* SV_CreatePacketEntities() = 0;
virtual IRehldsHookRegistry_SV_EmitSound2* SV_EmitSound2() = 0; virtual IRehldsHookRegistry_SV_EmitSound2* SV_EmitSound2() = 0;
virtual IRehldsHookRegistry_CreateFakeClient* CreateFakeClient() = 0;
}; };
struct RehldsFuncs_t { struct RehldsFuncs_t {
@ -267,7 +282,7 @@ struct RehldsFuncs_t {
cvar_t*(*GetCvarVars)(); cvar_t*(*GetCvarVars)();
int (*SV_GetChallenge)(const netadr_t& adr); int (*SV_GetChallenge)(const netadr_t& adr);
void (*SV_AddResource)(resourcetype_t type, const char *name, int size, unsigned char flags, int index); void (*SV_AddResource)(resourcetype_t type, const char *name, int size, unsigned char flags, int index);
int(*MSG_ReadShort)(void); int(*MSG_ReadShort)();
int(*MSG_ReadBuf)(int iSize, void *pbuf); int(*MSG_ReadBuf)(int iSize, void *pbuf);
void(*MSG_WriteBuf)(sizebuf_t *sb, int iSize, void *buf); void(*MSG_WriteBuf)(sizebuf_t *sb, int iSize, void *buf);
void(*MSG_WriteByte)(sizebuf_t *sb, int c); void(*MSG_WriteByte)(sizebuf_t *sb, int c);
@ -282,6 +297,13 @@ struct RehldsFuncs_t {
bool(*SV_EmitSound2)(edict_t *entity, IGameClient *receiver, int channel, const char *sample, float volume, float attenuation, int flags, int pitch, int emitFlags, const float *pOrigin); bool(*SV_EmitSound2)(edict_t *entity, IGameClient *receiver, int channel, const char *sample, float volume, float attenuation, int flags, int pitch, int emitFlags, const float *pOrigin);
void(*SV_UpdateUserInfo)(IGameClient *pGameClient); void(*SV_UpdateUserInfo)(IGameClient *pGameClient);
bool(*StripUnprintableAndSpace)(char *pch); bool(*StripUnprintableAndSpace)(char *pch);
void(*Cmd_RemoveCmd)(const char *cmd_name);
void(*GetCommandMatches)(const char *string, ObjectList *pMatchList);
bool(*AddExtDll)(void *hModule);
void(*AddCvarListener)(const char *var_name, cvar_callback_t func);
void(*RemoveExtDll)(void *hModule);
void(*RemoveCvarListener)(const char *var_name, cvar_callback_t func);
ENTITYINIT(*GetEntityInit)(char *pszClassName);
}; };
class IRehldsApi { class IRehldsApi {

View File

@ -81,6 +81,7 @@ public:
virtual IGameClient* GetClient(int id) = 0; virtual IGameClient* GetClient(int id) = 0;
virtual client_t* GetClient_t(int id) = 0; virtual client_t* GetClient_t(int id) = 0;
virtual int GetIndexOfClient_t(client_t* client) = 0; virtual int GetIndexOfClient_t(client_t* client) = 0;
virtual int GetMaxClientsLimit() = 0;
}; };
class IRehldsServerData { class IRehldsServerData {

View File

@ -7,15 +7,15 @@ IReGameHookchains * ReGameHookchains;
bool RegamedllApi_Init() bool RegamedllApi_Init()
{ {
auto library = GET_GAME_INFO(PLID, GINFO_DLL_FULLPATH); const auto library = GET_GAME_INFO(PLID, GINFO_DLL_FULLPATH);
if (!library || !GET_IFACE<IReGameApi>(library, ReGameApi, VRE_GAMEDLL_API_VERSION, false) || !ReGameApi) if (!library || !GET_IFACE<IReGameApi>(library, ReGameApi, VRE_GAMEDLL_API_VERSION, false) || !ReGameApi)
{ {
return false; return false;
} }
auto majorVersion = ReGameApi->GetMajorVersion(); const auto majorVersion = ReGameApi->GetMajorVersion();
auto minorVersion = ReGameApi->GetMinorVersion(); const auto minorVersion = ReGameApi->GetMinorVersion();
if (majorVersion != REGAMEDLL_API_VERSION_MAJOR || minorVersion < REGAMEDLL_API_VERSION_MINOR) if (majorVersion != REGAMEDLL_API_VERSION_MAJOR || minorVersion < REGAMEDLL_API_VERSION_MINOR)
{ {

View File

@ -15,9 +15,9 @@ bool RehldsApi_Init()
} }
#if defined(PLATFORM_WINDOWS) #if defined(PLATFORM_WINDOWS)
auto library = "swds"; const auto library = "swds";
#elif defined(PLATFORM_POSIX) #elif defined(PLATFORM_POSIX)
auto library = "engine_i486"; const auto library = "engine_i486";
#endif #endif
if (!GET_IFACE<IRehldsApi>(library, RehldsApi, VREHLDS_HLDS_API_VERSION) || !RehldsApi) if (!GET_IFACE<IRehldsApi>(library, RehldsApi, VREHLDS_HLDS_API_VERSION) || !RehldsApi)
@ -25,8 +25,8 @@ bool RehldsApi_Init()
return false; return false;
} }
auto majorVersion = RehldsApi->GetMajorVersion(); const auto majorVersion = RehldsApi->GetMajorVersion();
auto minorVersion = RehldsApi->GetMinorVersion(); const auto minorVersion = RehldsApi->GetMinorVersion();
if (majorVersion != REHLDS_API_VERSION_MAJOR || minorVersion < REHLDS_API_VERSION_MINOR) if (majorVersion != REHLDS_API_VERSION_MAJOR || minorVersion < REHLDS_API_VERSION_MINOR)
{ {