mirror of
https://github.com/rehlds/ReFreeLook.git
synced 2025-01-26 13:07:55 +03:00
Update for regamedll sdk
This commit is contained in:
parent
11401e285b
commit
1733dde18e
29
Makefile
29
Makefile
@ -1,25 +1,44 @@
|
|||||||
NAME = refreelook
|
NAME = refreelook
|
||||||
COMPILER = clang
|
#COMPILER = clang
|
||||||
|
COMPILER = /opt/intel/bin/icpc
|
||||||
CSSDK = include/cssdk
|
CSSDK = include/cssdk
|
||||||
|
|
||||||
OBJECTS = src/main.cpp src/meta_api.cpp src/h_export.cpp src/amxxmodule.cpp src/mod_regamedll_api.cpp\
|
OBJECTS = src/main.cpp src/meta_api.cpp src/h_export.cpp src/amxxmodule.cpp src/mod_regamedll_api.cpp\
|
||||||
src/sdk_util.cpp $(CSSDK)/public/interface.cpp\
|
src/sdk_util.cpp $(CSSDK)/public/interface.cpp\
|
||||||
|
|
||||||
LINK = -lm -ldl -static-libgcc -Wno-return-type-c-linkage -fPIC
|
LINK = -lm -ldl -static-libgcc
|
||||||
|
|
||||||
|
ifeq "$(COMPILER)" "clang"
|
||||||
|
LINK += -Wno-return-type-c-linkage -fPIC
|
||||||
|
else
|
||||||
|
LINK += -static-intel -no-intel-extensions
|
||||||
|
endif
|
||||||
|
|
||||||
METAMOD = include/metamod
|
METAMOD = include/metamod
|
||||||
|
|
||||||
OPT_FLAGS = -O3 -msse3 -funroll-loops -fomit-frame-pointer -fno-stack-protector -g -fwritable-strings -Wreturn-type-c-linkage
|
OPT_FLAGS = -O3 -msse3 -funroll-loops -fomit-frame-pointer -fno-stack-protector -g
|
||||||
|
ifeq "$(COMPILER)" "clang"
|
||||||
|
OPT_FLAGS += -fwritable-strings -Wreturn-type-c-linkage
|
||||||
|
else
|
||||||
|
OPT_FLAGS += -no-prec-div
|
||||||
|
endif
|
||||||
|
|
||||||
INCLUDE = -I. -Isrc -I$(CSSDK)/common -I$(CSSDK)//dlls -I$(CSSDK)/engine -I$(CSSDK)/pm_shared -I$(CSSDK)/public -I$(METAMOD) -I$(CSSDK)/game_shared
|
INCLUDE = -I. -Isrc -I$(CSSDK)/common -I$(CSSDK)//dlls -I$(CSSDK)/engine -I$(CSSDK)/pm_shared -I$(CSSDK)/public -I$(METAMOD) -I$(CSSDK)/game_shared
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BIN_DIR = Release
|
BIN_DIR = Release
|
||||||
CFLAGS = $(OPT_FLAGS)
|
CFLAGS = $(OPT_FLAGS)
|
||||||
|
|
||||||
CFLAGS += -g0 -fvisibility=hidden -DNOMINMAX -fvisibility-inlines-hidden\
|
CFLAGS += -g0 -fvisibility=hidden -DNOMINMAX -fvisibility-inlines-hidden\
|
||||||
-DNDEBUG -Dlinux -D__linux__ -std=c++11 -shared -fasm-blocks\
|
-DNDEBUG -Dlinux -D__linux__ -std=c++11 -shared -fasm-blocks\
|
||||||
-fno-rtti -D_bswap16=__builtin_bswap16 -D_bswap=bswap\
|
-fno-rtti -D_vsnprintf=vsnprintf
|
||||||
-D_bswap64=__builtin_bswap64 -D_vsnprintf=vsnprintf
|
|
||||||
|
ifeq "$(COMPILER)" "clang"
|
||||||
|
CFLAGS += -D_bswap16=__builtin_bswap16 -D_bswap=bswap -D_bswap64=__builtin_bswap64
|
||||||
|
else
|
||||||
|
CFLAGS += -Qoption,cpp,--treat_func_as_string_literal_cpp
|
||||||
|
endif
|
||||||
|
|
||||||
OBJ_LINUX := $(OBJECTS:%.c=$(BIN_DIR)/%.o)
|
OBJ_LINUX := $(OBJECTS:%.c=$(BIN_DIR)/%.o)
|
||||||
|
|
||||||
|
@ -37,6 +37,16 @@ public:
|
|||||||
virtual t_ret callOriginal(t_args... args) = 0;
|
virtual t_ret callOriginal(t_args... args) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<typename t_ret, typename t_class, typename ...t_args>
|
||||||
|
class IHookChainClass {
|
||||||
|
protected:
|
||||||
|
virtual ~IHookChainClass() {}
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual t_ret callNext(t_class *, t_args... args) = 0;
|
||||||
|
virtual t_ret callOriginal(t_class *, t_args... args) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
template<typename ...t_args>
|
template<typename ...t_args>
|
||||||
class IVoidHookChain
|
class IVoidHookChain
|
||||||
{
|
{
|
||||||
@ -48,6 +58,17 @@ public:
|
|||||||
virtual void callOriginal(t_args... args) = 0;
|
virtual void callOriginal(t_args... args) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<typename t_class, typename ...t_args>
|
||||||
|
class IVoidHookChainClass
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
virtual ~IVoidHookChainClass() {}
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual void callNext(t_class *, t_args... args) = 0;
|
||||||
|
virtual void callOriginal(t_class *, t_args... args) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
// Hook chain registry(for hooks [un]registration)
|
// Hook chain registry(for hooks [un]registration)
|
||||||
template<typename t_ret, typename ...t_args>
|
template<typename t_ret, typename ...t_args>
|
||||||
class IHookChainRegistry {
|
class IHookChainRegistry {
|
||||||
@ -62,7 +83,7 @@ public:
|
|||||||
template<typename t_ret, typename t_class, typename ...t_args>
|
template<typename t_ret, typename t_class, typename ...t_args>
|
||||||
class IHookChainRegistryClass {
|
class IHookChainRegistryClass {
|
||||||
public:
|
public:
|
||||||
typedef t_ret(*hookfunc_t)(IHookChain<t_ret, t_args...>*, t_class *, t_args...);
|
typedef t_ret(*hookfunc_t)(IHookChainClass<t_ret, t_class, t_args...>*, t_class *, t_args...);
|
||||||
|
|
||||||
virtual void registerHook(hookfunc_t hook) = 0;
|
virtual void registerHook(hookfunc_t hook) = 0;
|
||||||
virtual void unregisterHook(hookfunc_t hook) = 0;
|
virtual void unregisterHook(hookfunc_t hook) = 0;
|
||||||
@ -82,7 +103,7 @@ public:
|
|||||||
template<typename t_class, typename ...t_args>
|
template<typename t_class, typename ...t_args>
|
||||||
class IVoidHookChainRegistryClass {
|
class IVoidHookChainRegistryClass {
|
||||||
public:
|
public:
|
||||||
typedef void(*hookfunc_t)(IVoidHookChain<t_args...>*, t_class *, t_args...);
|
typedef void(*hookfunc_t)(IVoidHookChainClass<t_class, t_args...>*, t_class *, t_args...);
|
||||||
|
|
||||||
virtual void registerHook(hookfunc_t hook) = 0;
|
virtual void registerHook(hookfunc_t hook) = 0;
|
||||||
virtual void unregisterHook(hookfunc_t hook) = 0;
|
virtual void unregisterHook(hookfunc_t hook) = 0;
|
||||||
|
@ -33,135 +33,134 @@
|
|||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "gamerules.h"
|
#include "gamerules.h"
|
||||||
|
|
||||||
#define REGAMEDLL_API_VERSION_MAJOR 2
|
#define REGAMEDLL_API_VERSION_MAJOR 3
|
||||||
#define REGAMEDLL_API_VERSION_MINOR 1
|
#define REGAMEDLL_API_VERSION_MINOR 1
|
||||||
|
|
||||||
// CBasePlayer::Spawn hook
|
// CBasePlayer::Spawn hook
|
||||||
typedef IVoidHookChain<> IReGameHook_CBasePlayer_Spawn;
|
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_Spawn;
|
||||||
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_Spawn;
|
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_Spawn;
|
||||||
|
|
||||||
// CBasePlayer::Precache hook
|
// CBasePlayer::Precache hook
|
||||||
typedef IVoidHookChain<> IReGameHook_CBasePlayer_Precache;
|
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_Precache;
|
||||||
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_Precache;
|
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_Precache;
|
||||||
|
|
||||||
// CBasePlayer::ObjectCaps hook
|
// CBasePlayer::ObjectCaps hook
|
||||||
typedef IHookChain<int> IReGameHook_CBasePlayer_ObjectCaps;
|
typedef IHookChainClass<int, class CBasePlayer> IReGameHook_CBasePlayer_ObjectCaps;
|
||||||
typedef IHookChainRegistryClass<int, class CBasePlayer> IReGameHookRegistry_CBasePlayer_ObjectCaps;
|
typedef IHookChainRegistryClass<int, class CBasePlayer> IReGameHookRegistry_CBasePlayer_ObjectCaps;
|
||||||
|
|
||||||
// CBasePlayer::Classify hook
|
// CBasePlayer::Classify hook
|
||||||
typedef IHookChain<int> IReGameHook_CBasePlayer_Classify;
|
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 IVoidHookChain<struct entvars_s *, float, Vector &, struct TraceResult *, int> IReGameHook_CBasePlayer_TraceAttack;
|
typedef IVoidHookChainClass<class CBasePlayer, struct entvars_s *, float, Vector &, struct TraceResult *, int> IReGameHook_CBasePlayer_TraceAttack;
|
||||||
typedef IVoidHookChainRegistryClass<class CBasePlayer, struct entvars_s *, float, Vector &, struct TraceResult *, int> IReGameHookRegistry_CBasePlayer_TraceAttack;
|
typedef IVoidHookChainRegistryClass<class CBasePlayer, struct entvars_s *, float, Vector &, struct TraceResult *, int> IReGameHookRegistry_CBasePlayer_TraceAttack;
|
||||||
|
|
||||||
// CBasePlayer::TakeDamage hook
|
// CBasePlayer::TakeDamage hook
|
||||||
typedef IHookChain<int, struct entvars_s *, struct entvars_s *, float&, int> IReGameHook_CBasePlayer_TakeDamage;
|
typedef IHookChainClass<int, class CBasePlayer, struct entvars_s *, struct entvars_s *, float&, int> IReGameHook_CBasePlayer_TakeDamage;
|
||||||
typedef IHookChainRegistryClass<int, class CBasePlayer, struct entvars_s *, struct entvars_s *, float&, int> IReGameHookRegistry_CBasePlayer_TakeDamage;
|
typedef IHookChainRegistryClass<int, class CBasePlayer, struct entvars_s *, struct entvars_s *, float&, int> IReGameHookRegistry_CBasePlayer_TakeDamage;
|
||||||
|
|
||||||
// CBasePlayer::TakeHealth hook
|
// CBasePlayer::TakeHealth hook
|
||||||
typedef IHookChain<int, float, int> IReGameHook_CBasePlayer_TakeHealth;
|
typedef IHookChainClass<int, class CBasePlayer, float, int> IReGameHook_CBasePlayer_TakeHealth;
|
||||||
typedef IHookChainRegistryClass<int, class CBasePlayer, float, int> IReGameHookRegistry_CBasePlayer_TakeHealth;
|
typedef IHookChainRegistryClass<int, class CBasePlayer, float, int> IReGameHookRegistry_CBasePlayer_TakeHealth;
|
||||||
|
|
||||||
// CBasePlayer::Killed hook
|
// CBasePlayer::Killed hook
|
||||||
typedef IVoidHookChain<struct entvars_s *, int> IReGameHook_CBasePlayer_Killed;
|
typedef IVoidHookChainClass<class CBasePlayer, struct entvars_s *, int> IReGameHook_CBasePlayer_Killed;
|
||||||
typedef IVoidHookChainRegistryClass<class CBasePlayer, struct entvars_s *, int> IReGameHookRegistry_CBasePlayer_Killed;
|
typedef IVoidHookChainRegistryClass<class CBasePlayer, struct entvars_s *, int> IReGameHookRegistry_CBasePlayer_Killed;
|
||||||
|
|
||||||
// CBasePlayer::AddPoints hook
|
// CBasePlayer::AddPoints hook
|
||||||
typedef IVoidHookChain<int, BOOL> IReGameHook_CBasePlayer_AddPoints;
|
typedef IVoidHookChainClass<class CBasePlayer, int, BOOL> IReGameHook_CBasePlayer_AddPoints;
|
||||||
typedef IVoidHookChainRegistryClass<class CBasePlayer, int, BOOL> IReGameHookRegistry_CBasePlayer_AddPoints;
|
typedef IVoidHookChainRegistryClass<class CBasePlayer, int, BOOL> IReGameHookRegistry_CBasePlayer_AddPoints;
|
||||||
|
|
||||||
// CBasePlayer::AddPointsToTeam hook
|
// CBasePlayer::AddPointsToTeam hook
|
||||||
typedef IVoidHookChain<int, BOOL> IReGameHook_CBasePlayer_AddPointsToTeam;
|
typedef IVoidHookChainClass<class CBasePlayer, int, BOOL> IReGameHook_CBasePlayer_AddPointsToTeam;
|
||||||
typedef IVoidHookChainRegistryClass<class CBasePlayer, int, BOOL> IReGameHookRegistry_CBasePlayer_AddPointsToTeam;
|
typedef IVoidHookChainRegistryClass<class CBasePlayer, int, BOOL> IReGameHookRegistry_CBasePlayer_AddPointsToTeam;
|
||||||
|
|
||||||
// CBasePlayer::AddPlayerItem hook
|
// CBasePlayer::AddPlayerItem hook
|
||||||
typedef IHookChain<BOOL, class CBasePlayerItem *> IReGameHook_CBasePlayer_AddPlayerItem;
|
typedef IHookChainClass<BOOL, class CBasePlayer, class CBasePlayerItem *> IReGameHook_CBasePlayer_AddPlayerItem;
|
||||||
typedef IHookChainRegistryClass<BOOL, class CBasePlayer, class CBasePlayerItem *> IReGameHookRegistry_CBasePlayer_AddPlayerItem;
|
typedef IHookChainRegistryClass<BOOL, class CBasePlayer, class CBasePlayerItem *> IReGameHookRegistry_CBasePlayer_AddPlayerItem;
|
||||||
|
|
||||||
// CBasePlayer::RemovePlayerItem hook
|
// CBasePlayer::RemovePlayerItem hook
|
||||||
typedef IHookChain<BOOL, class CBasePlayerItem *> IReGameHook_CBasePlayer_RemovePlayerItem;
|
typedef IHookChainClass<BOOL, class CBasePlayer, class CBasePlayerItem *> IReGameHook_CBasePlayer_RemovePlayerItem;
|
||||||
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 IHookChain<int, int , char *, int> IReGameHook_CBasePlayer_GiveAmmo;
|
typedef IHookChainClass<int, class CBasePlayer, int , char *, int> IReGameHook_CBasePlayer_GiveAmmo;
|
||||||
typedef IHookChainRegistryClass<int, class CBasePlayer, int , char *, int> IReGameHookRegistry_CBasePlayer_GiveAmmo;
|
typedef IHookChainRegistryClass<int, class CBasePlayer, int , char *, int> IReGameHookRegistry_CBasePlayer_GiveAmmo;
|
||||||
|
|
||||||
// CBasePlayer::ResetMaxSpeed hook
|
// CBasePlayer::ResetMaxSpeed hook
|
||||||
typedef IVoidHookChain<> IReGameHook_CBasePlayer_ResetMaxSpeed;
|
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_ResetMaxSpeed;
|
||||||
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_ResetMaxSpeed;
|
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_ResetMaxSpeed;
|
||||||
|
|
||||||
// CBasePlayer::Jump hook
|
// CBasePlayer::Jump hook
|
||||||
typedef IVoidHookChain<> IReGameHook_CBasePlayer_Jump;
|
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_Jump;
|
||||||
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_Jump;
|
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_Jump;
|
||||||
|
|
||||||
// CBasePlayer::Duck hook
|
// CBasePlayer::Duck hook
|
||||||
typedef IVoidHookChain<> IReGameHook_CBasePlayer_Duck;
|
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_Duck;
|
||||||
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_Duck;
|
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_Duck;
|
||||||
|
|
||||||
// CBasePlayer::PreThink hook
|
// CBasePlayer::PreThink hook
|
||||||
typedef IVoidHookChain<> IReGameHook_CBasePlayer_PreThink;
|
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_PreThink;
|
||||||
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_PreThink;
|
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_PreThink;
|
||||||
|
|
||||||
// CBasePlayer::PostThink hook
|
// CBasePlayer::PostThink hook
|
||||||
typedef IVoidHookChain<> IReGameHook_CBasePlayer_PostThink;
|
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_PostThink;
|
||||||
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_PostThink;
|
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_PostThink;
|
||||||
|
|
||||||
// CBasePlayer::UpdateClientData hook
|
// CBasePlayer::UpdateClientData hook
|
||||||
typedef IVoidHookChain<> IReGameHook_CBasePlayer_UpdateClientData;
|
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_UpdateClientData;
|
||||||
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_UpdateClientData;
|
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_UpdateClientData;
|
||||||
|
|
||||||
// CBasePlayer::ImpulseCommands hook
|
// CBasePlayer::ImpulseCommands hook
|
||||||
typedef IVoidHookChain<> IReGameHook_CBasePlayer_ImpulseCommands;
|
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_ImpulseCommands;
|
||||||
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_ImpulseCommands;
|
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_ImpulseCommands;
|
||||||
|
|
||||||
// CBasePlayer::RoundRespawn hook
|
// CBasePlayer::RoundRespawn hook
|
||||||
typedef IVoidHookChain<> IReGameHook_CBasePlayer_RoundRespawn;
|
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_RoundRespawn;
|
||||||
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_RoundRespawn;
|
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_RoundRespawn;
|
||||||
|
|
||||||
// CBasePlayer::Blind hook
|
// CBasePlayer::Blind hook
|
||||||
typedef IVoidHookChain<float, float, float, int> IReGameHook_CBasePlayer_Blind;
|
typedef IVoidHookChainClass<class CBasePlayer, float, float, float, int> IReGameHook_CBasePlayer_Blind;
|
||||||
typedef IVoidHookChainRegistryClass<class CBasePlayer, float, float, float, int> IReGameHookRegistry_CBasePlayer_Blind;
|
typedef IVoidHookChainRegistryClass<class CBasePlayer, float, float, float, int> IReGameHookRegistry_CBasePlayer_Blind;
|
||||||
|
|
||||||
|
|
||||||
// CBasePlayer::Observer_IsValidTarget hook
|
// CBasePlayer::Observer_IsValidTarget hook
|
||||||
typedef IHookChain<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 IVoidHookChain<PLAYER_ANIM> IReGameHook_CBasePlayer_SetAnimation;
|
typedef IVoidHookChainClass<class CBasePlayer, PLAYER_ANIM> IReGameHook_CBasePlayer_SetAnimation;
|
||||||
typedef IVoidHookChainRegistryClass<class CBasePlayer, PLAYER_ANIM> IReGameHookRegistry_CBasePlayer_SetAnimation;
|
typedef IVoidHookChainRegistryClass<class CBasePlayer, PLAYER_ANIM> IReGameHookRegistry_CBasePlayer_SetAnimation;
|
||||||
|
|
||||||
// CBasePlayer::GiveDefaultItems hook
|
// CBasePlayer::GiveDefaultItems hook
|
||||||
typedef IVoidHookChain<> IReGameHook_CBasePlayer_GiveDefaultItems;
|
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_GiveDefaultItems;
|
||||||
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_GiveDefaultItems;
|
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_GiveDefaultItems;
|
||||||
|
|
||||||
// CBasePlayer::GiveNamedItem hook
|
// CBasePlayer::GiveNamedItem hook
|
||||||
typedef IVoidHookChain<const char *> IReGameHook_CBasePlayer_GiveNamedItem;
|
typedef IVoidHookChainClass<class CBasePlayer, const char *> IReGameHook_CBasePlayer_GiveNamedItem;
|
||||||
typedef IVoidHookChainRegistryClass<class CBasePlayer, const char *> IReGameHookRegistry_CBasePlayer_GiveNamedItem;
|
typedef IVoidHookChainRegistryClass<class CBasePlayer, const char *> IReGameHookRegistry_CBasePlayer_GiveNamedItem;
|
||||||
|
|
||||||
// CBasePlayer::AddAccount hook
|
// CBasePlayer::AddAccount hook
|
||||||
typedef IVoidHookChain<int, RewardType, bool> IReGameHook_CBasePlayer_AddAccount;
|
typedef IVoidHookChainClass<class CBasePlayer, int, RewardType, bool> IReGameHook_CBasePlayer_AddAccount;
|
||||||
typedef IVoidHookChainRegistryClass<class CBasePlayer, int, RewardType, bool> IReGameHookRegistry_CBasePlayer_AddAccount;
|
typedef IVoidHookChainRegistryClass<class CBasePlayer, int, RewardType, bool> IReGameHookRegistry_CBasePlayer_AddAccount;
|
||||||
|
|
||||||
// CBasePlayer::GiveShield hook
|
// CBasePlayer::GiveShield hook
|
||||||
typedef IVoidHookChain<bool> IReGameHook_CBasePlayer_GiveShield;
|
typedef IVoidHookChainClass<class CBasePlayer, bool> IReGameHook_CBasePlayer_GiveShield;
|
||||||
typedef IVoidHookChainRegistryClass<class CBasePlayer, bool> IReGameHookRegistry_CBasePlayer_GiveShield;
|
typedef IVoidHookChainRegistryClass<class CBasePlayer, bool> IReGameHookRegistry_CBasePlayer_GiveShield;
|
||||||
|
|
||||||
// CBasePlayer:SetClientUserInfoModel hook
|
// CBasePlayer:SetClientUserInfoModel hook
|
||||||
typedef IVoidHookChain<char *, char *> IReGameHook_CBasePlayer_SetClientUserInfoModel;
|
typedef IVoidHookChainClass<class CBasePlayer, char *, char *> IReGameHook_CBasePlayer_SetClientUserInfoModel;
|
||||||
typedef IVoidHookChainRegistryClass<class CBasePlayer, char *, char *> IReGameHookRegistry_CBasePlayer_SetClientUserInfoModel;
|
typedef IVoidHookChainRegistryClass<class CBasePlayer, char *, char *> IReGameHookRegistry_CBasePlayer_SetClientUserInfoModel;
|
||||||
|
|
||||||
|
// CBasePlayer:SetClientUserInfoName hook
|
||||||
|
typedef IVoidHookChainClass<class CBasePlayer, char *, char *> IReGameHook_CBasePlayer_SetClientUserInfoName;
|
||||||
|
typedef IVoidHookChainRegistryClass<class CBasePlayer, char *, char *> IReGameHookRegistry_CBasePlayer_SetClientUserInfoName;
|
||||||
|
|
||||||
// CBaseAnimating::ResetSequenceInfo hook
|
// CBaseAnimating::ResetSequenceInfo hook
|
||||||
typedef IVoidHookChain<> IReGameHook_CBaseAnimating_ResetSequenceInfo;
|
typedef IVoidHookChainClass<class CBaseAnimating> IReGameHook_CBaseAnimating_ResetSequenceInfo;
|
||||||
typedef IVoidHookChainRegistryClass<class CBaseAnimating> IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo;
|
typedef IVoidHookChainRegistryClass<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;
|
||||||
@ -336,6 +335,7 @@ public:
|
|||||||
virtual IReGameHookRegistry_CBasePlayer_AddAccount* CBasePlayer_AddAccount() = 0;
|
virtual IReGameHookRegistry_CBasePlayer_AddAccount* CBasePlayer_AddAccount() = 0;
|
||||||
virtual IReGameHookRegistry_CBasePlayer_GiveShield* CBasePlayer_GiveShield() = 0;
|
virtual IReGameHookRegistry_CBasePlayer_GiveShield* CBasePlayer_GiveShield() = 0;
|
||||||
virtual IReGameHookRegistry_CBasePlayer_SetClientUserInfoModel* CBasePlayer_SetClientUserInfoModel() = 0;
|
virtual IReGameHookRegistry_CBasePlayer_SetClientUserInfoModel* CBasePlayer_SetClientUserInfoModel() = 0;
|
||||||
|
virtual IReGameHookRegistry_CBasePlayer_SetClientUserInfoName* CBasePlayer_SetClientUserInfoName() = 0;
|
||||||
virtual IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo* CBaseAnimating_ResetSequenceInfo() = 0;
|
virtual IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo* CBaseAnimating_ResetSequenceInfo() = 0;
|
||||||
|
|
||||||
virtual IReGameHookRegistry_GetForceCamera* GetForceCamera() = 0;
|
virtual IReGameHookRegistry_GetForceCamera* GetForceCamera() = 0;
|
||||||
@ -374,27 +374,22 @@ public:
|
|||||||
virtual IReGameHookRegistry_CSGameRules_ChangeLevel* CSGameRules_ChangeLevel() = 0;
|
virtual IReGameHookRegistry_CSGameRules_ChangeLevel* CSGameRules_ChangeLevel() = 0;
|
||||||
virtual IReGameHookRegistry_CSGameRules_GoToIntermission* CSGameRules_GoToIntermission() = 0;
|
virtual IReGameHookRegistry_CSGameRules_GoToIntermission* CSGameRules_GoToIntermission() = 0;
|
||||||
virtual IReGameHookRegistry_CSGameRules_BalanceTeams* CSGameRules_BalanceTeams() = 0;
|
virtual IReGameHookRegistry_CSGameRules_BalanceTeams* CSGameRules_BalanceTeams() = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ReGameFuncs_t {
|
struct ReGameFuncs_t {
|
||||||
class CBasePlayer *(*UTIL_PlayerByIndex)(int playerIndex);
|
class CBasePlayer *(*UTIL_PlayerByIndex)(int playerIndex);
|
||||||
struct edict_s *(*CREATE_NAMED_ENTITY2)(string_t iClass);
|
struct edict_s *(*CREATE_NAMED_ENTITY2)(string_t iClass);
|
||||||
|
|
||||||
void (*ChangeString)(char *&dest, const char *source);
|
void (*ChangeString)(char *&dest, const char *source);
|
||||||
|
|
||||||
void (*RadiusDamage)(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, float flRadius, int iClassIgnore, int bitsDamageType);
|
void (*RadiusDamage)(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, float flRadius, int iClassIgnore, int bitsDamageType);
|
||||||
void (*ClearMultiDamage)();
|
void (*ClearMultiDamage)();
|
||||||
void (*ApplyMultiDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker);
|
void (*ApplyMultiDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker);
|
||||||
void (*AddMultiDamage)(entvars_t *pevInflictor, CBaseEntity *pEntity, float flDamage, int bitsDamageType);
|
void (*AddMultiDamage)(entvars_t *pevInflictor, CBaseEntity *pEntity, float flDamage, int bitsDamageType);
|
||||||
|
|
||||||
void (*EndRoundMessage)(const char *sentence, int event);
|
|
||||||
class CBaseEntity *(*UTIL_FindEntityByString)(class CBaseEntity *pStartEntity, const char *szKeyword, const char *szValue);
|
class CBaseEntity *(*UTIL_FindEntityByString)(class CBaseEntity *pStartEntity, const char *szKeyword, const char *szValue);
|
||||||
};
|
};
|
||||||
|
|
||||||
class IReGameApi {
|
class IReGameApi {
|
||||||
public:
|
public:
|
||||||
virtual ~IReGameApi() { }
|
virtual ~IReGameApi() {}
|
||||||
|
|
||||||
virtual int GetMajorVersion() = 0;
|
virtual int GetMajorVersion() = 0;
|
||||||
virtual int GetMinorVersion() = 0;
|
virtual int GetMinorVersion() = 0;
|
||||||
@ -407,7 +402,6 @@ 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;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define VRE_GAMEDLL_API_VERSION "VRE_GAMEDLL_API_VERSION001"
|
#define VRE_GAMEDLL_API_VERSION "VRE_GAMEDLL_API_VERSION001"
|
||||||
|
@ -49,10 +49,12 @@ class CCSMonster: public CCSToggle {};
|
|||||||
class CCSWeaponBox: public CCSEntity {};
|
class CCSWeaponBox: public CCSEntity {};
|
||||||
class CCSArmoury: public CCSEntity {};
|
class CCSArmoury: public CCSEntity {};
|
||||||
|
|
||||||
#pragma warning(disable:4351) // new behavior: elements of array 'CCSPlayer::m_szModel' will be default initialized
|
|
||||||
class CCSPlayer: public CCSMonster {
|
class CCSPlayer: public CCSMonster {
|
||||||
public:
|
public:
|
||||||
CCSPlayer() : m_szModel() {}
|
CCSPlayer()
|
||||||
|
{
|
||||||
|
m_szModel[0] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
virtual bool IsConnected() const;
|
virtual bool IsConnected() const;
|
||||||
virtual void SetAnimation(PLAYER_ANIM playerAnim);
|
virtual void SetAnimation(PLAYER_ANIM playerAnim);
|
||||||
@ -65,9 +67,22 @@ public:
|
|||||||
virtual void DropPlayerItem(const char *pszItemName);
|
virtual void DropPlayerItem(const char *pszItemName);
|
||||||
virtual void RemoveShield();
|
virtual void RemoveShield();
|
||||||
virtual void RemoveAllItems(bool bRemoveSuit);
|
virtual void RemoveAllItems(bool bRemoveSuit);
|
||||||
|
virtual bool RemovePlayerItem(const char* pszItemName);
|
||||||
virtual void SetPlayerModel(bool bHasC4);
|
virtual void SetPlayerModel(bool bHasC4);
|
||||||
virtual void SetPlayerModelEx(const char *modelName);
|
virtual void SetPlayerModelEx(const char *modelName);
|
||||||
virtual void SetNewPlayerModel(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();
|
||||||
|
|
||||||
CBasePlayer *BasePlayer() const;
|
CBasePlayer *BasePlayer() const;
|
||||||
public:
|
public:
|
||||||
|
@ -16,7 +16,7 @@ inline bool ShouldRunCode()
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline bool canFreeLook(const int nIndex) {
|
inline bool canFreeLook(const int nIndex) {
|
||||||
return (UTIL_ReadFlags(pcv_admin_access_flags->string) & g_amxxapi.GetPlayerFlags(nIndex));
|
return (UTIL_ReadFlags(pcv_admin_access_flags->string) & g_amxxapi.GetPlayerFlags(nIndex)) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetForceCamera(IReGameHook_GetForceCamera *chain, CBasePlayer *pObserver)
|
int GetForceCamera(IReGameHook_GetForceCamera *chain, CBasePlayer *pObserver)
|
||||||
@ -34,7 +34,7 @@ CBasePlayer *CBasePlayer_Observer_IsValidTarget(IReGameHook_CBasePlayer_Observer
|
|||||||
{
|
{
|
||||||
if (ShouldRunCode()) {
|
if (ShouldRunCode()) {
|
||||||
// go next hook and call the original in the end
|
// go next hook and call the original in the end
|
||||||
return chain->callNext(iPlayerIndex, bSameTeam);
|
return chain->callNext(pthis, iPlayerIndex, bSameTeam);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iPlayerIndex > gpGlobals->maxClients || iPlayerIndex < 1)
|
if (iPlayerIndex > gpGlobals->maxClients || iPlayerIndex < 1)
|
||||||
|
@ -8,7 +8,7 @@ plugin_info_t Plugin_info =
|
|||||||
{
|
{
|
||||||
META_INTERFACE_VERSION, // ifvers
|
META_INTERFACE_VERSION, // ifvers
|
||||||
"ReFreeLook", // name
|
"ReFreeLook", // name
|
||||||
"1.6", // version
|
"1.7", // version
|
||||||
__DATE__, // date
|
__DATE__, // date
|
||||||
"s1lent", // author
|
"s1lent", // author
|
||||||
"http://www.dedicated-server.ru", // url
|
"http://www.dedicated-server.ru", // url
|
||||||
|
Loading…
x
Reference in New Issue
Block a user