mirror of
https://github.com/rehlds/rehlds.git
synced 2025-01-01 01:25:38 +03:00
Added Cvar_DirectSet hookchain
This commit is contained in:
parent
e082b8e12c
commit
a43c452428
@ -186,7 +186,7 @@ NOXREF const char *Cvar_CompleteVariable(const char *search, int forward)
|
||||
}
|
||||
|
||||
/* <18805> ../engine/cvar.c:198 */
|
||||
void Cvar_DirectSet(struct cvar_s *var, const char *value)
|
||||
void EXT_FUNC Cvar_DirectSet_internal(struct cvar_s *var, const char *value)
|
||||
{
|
||||
if (!var || !value)
|
||||
{
|
||||
@ -310,6 +310,11 @@ void Cvar_DirectSet(struct cvar_s *var, const char *value)
|
||||
var->value = (float)Q_atof(var->string);
|
||||
}
|
||||
|
||||
void Cvar_DirectSet(struct cvar_s *var, const char *value)
|
||||
{
|
||||
g_RehldsHookchains.m_Cvar_DirectSet.callChain(Cvar_DirectSet_internal, var, value);
|
||||
}
|
||||
|
||||
/* <188e9> ../engine/cvar.c:347 */
|
||||
void Cvar_Set(const char *var_name, const char *value)
|
||||
{
|
||||
|
@ -35,7 +35,7 @@
|
||||
#include "model.h"
|
||||
|
||||
#define REHLDS_API_VERSION_MAJOR 2
|
||||
#define REHLDS_API_VERSION_MINOR 8
|
||||
#define REHLDS_API_VERSION_MINOR 9
|
||||
|
||||
//Steam_NotifyClientConnect hook
|
||||
typedef IHookChain<qboolean, IGameClient*, const void*, unsigned int> IRehldsHook_Steam_NotifyClientConnect;
|
||||
@ -169,6 +169,10 @@ typedef IHookChainRegistry<int> IRehldsHookRegistry_SV_TransferConsistencyInfo;
|
||||
typedef IHookChain<bool, uint64, const char *, uint32> IRehldsHook_Steam_GSBUpdateUserData;
|
||||
typedef IHookChainRegistry<bool, uint64, const char *, uint32> IRehldsHookRegistry_Steam_GSBUpdateUserData;
|
||||
|
||||
//Cvar_DirectSet hook
|
||||
typedef IVoidHookChain<struct cvar_s *, const char *> IRehldsHook_Cvar_DirectSet;
|
||||
typedef IVoidHookChainRegistry<struct cvar_s *, const char *> IRehldsHookRegistry_Cvar_DirectSet;
|
||||
|
||||
class IRehldsHookchains {
|
||||
public:
|
||||
virtual ~IRehldsHookchains() { }
|
||||
@ -206,6 +210,7 @@ public:
|
||||
virtual IRehldsHookRegistry_Steam_GSGetSteamID* Steam_GSGetSteamID() = 0;
|
||||
virtual IRehldsHookRegistry_SV_TransferConsistencyInfo* SV_TransferConsistencyInfo() = 0;
|
||||
virtual IRehldsHookRegistry_Steam_GSBUpdateUserData* Steam_GSBUpdateUserData() = 0;
|
||||
virtual IRehldsHookRegistry_Cvar_DirectSet* Cvar_DirectSet() = 0;
|
||||
};
|
||||
|
||||
struct RehldsFuncs_t {
|
||||
@ -251,7 +256,7 @@ struct RehldsFuncs_t {
|
||||
void*(*GetPluginApi)(const char *name);
|
||||
void(*RegisterPluginApi)(const char *name, void *impl);
|
||||
qboolean(*SV_FileInConsistencyList)(const char *filename, struct consistency_s **ppconsist);
|
||||
qboolean(*Steam_NotifyClientConnect_api)(IGameClient *cl, const void *pvSteam2Key, unsigned int ucbSteam2Key);
|
||||
qboolean(*Steam_NotifyClientConnect)(IGameClient *cl, const void *pvSteam2Key, unsigned int ucbSteam2Key);
|
||||
void(*Steam_NotifyClientDisconnect)(IGameClient* cl);
|
||||
};
|
||||
|
||||
|
@ -360,6 +360,10 @@ IRehldsHookRegistry_Steam_GSBUpdateUserData* CRehldsHookchains::Steam_GSBUpdateU
|
||||
return &m_Steam_GSBUpdateUserData;
|
||||
}
|
||||
|
||||
IRehldsHookRegistry_Cvar_DirectSet* CRehldsHookchains::Cvar_DirectSet() {
|
||||
return &m_Cvar_DirectSet;
|
||||
}
|
||||
|
||||
int EXT_FUNC CRehldsApi::GetMajorVersion()
|
||||
{
|
||||
return REHLDS_API_VERSION_MAJOR;
|
||||
|
@ -163,6 +163,10 @@ typedef IHookChainRegistryImpl<int> CRehldsHookRegistry_SV_TransferConsistencyIn
|
||||
typedef IHookChainImpl<bool, uint64, const char *, uint32> CRehldsHook_Steam_GSBUpdateUserData;
|
||||
typedef IHookChainRegistryImpl<bool, uint64, const char *, uint32> CRehldsHookRegistry_Steam_GSBUpdateUserData;
|
||||
|
||||
//Cvar_DirectSet hook
|
||||
typedef IVoidHookChainImpl<struct cvar_s *, const char *> CRehldsHook_Cvar_DirectSet;
|
||||
typedef IVoidHookChainRegistryImpl<struct cvar_s *, const char *> CRehldsHookRegistry_Cvar_DirectSet;
|
||||
|
||||
class CRehldsHookchains : public IRehldsHookchains {
|
||||
public:
|
||||
CRehldsHookRegistry_Steam_NotifyClientConnect m_Steam_NotifyClientConnect;
|
||||
@ -198,6 +202,7 @@ public:
|
||||
CRehldsHookRegistry_Steam_GSGetSteamID m_Steam_GSGetSteamID;
|
||||
CRehldsHookRegistry_SV_TransferConsistencyInfo m_SV_TransferConsistencyInfo;
|
||||
CRehldsHookRegistry_Steam_GSBUpdateUserData m_Steam_GSBUpdateUserData;
|
||||
CRehldsHookRegistry_Cvar_DirectSet m_Cvar_DirectSet;
|
||||
|
||||
public:
|
||||
virtual IRehldsHookRegistry_Steam_NotifyClientConnect* Steam_NotifyClientConnect();
|
||||
@ -233,6 +238,7 @@ public:
|
||||
virtual IRehldsHookRegistry_Steam_GSGetSteamID* Steam_GSGetSteamID();
|
||||
virtual IRehldsHookRegistry_SV_TransferConsistencyInfo* SV_TransferConsistencyInfo();
|
||||
virtual IRehldsHookRegistry_Steam_GSBUpdateUserData* Steam_GSBUpdateUserData();
|
||||
virtual IRehldsHookRegistry_Cvar_DirectSet* Cvar_DirectSet();
|
||||
};
|
||||
|
||||
extern CRehldsHookchains g_RehldsHookchains;
|
||||
|
Loading…
Reference in New Issue
Block a user