diff --git a/rehlds/engine/sv_user.cpp b/rehlds/engine/sv_user.cpp index 2273587..0c5afc7 100644 --- a/rehlds/engine/sv_user.cpp +++ b/rehlds/engine/sv_user.cpp @@ -247,7 +247,7 @@ void SV_ParseConsistencyResponse(client_t *pSenderClient) } /* ../engine/sv_user.c:267 */ -qboolean SV_FileInConsistencyList(const char *filename, consistency_t **ppconsist) +qboolean EXT_FUNC SV_FileInConsistencyList(const char *filename, consistency_t **ppconsist) { for (int i = 0; i < ARRAYSIZE(g_psv.consistency_list); i++) { @@ -267,6 +267,11 @@ qboolean SV_FileInConsistencyList(const char *filename, consistency_t **ppconsis /* ../engine/sv_user.c:298 */ int SV_TransferConsistencyInfo(void) +{ + return g_RehldsHookchains.m_SV_TransferConsistencyInfo.callChain(SV_TransferConsistencyInfo_internal); +} + +int EXT_FUNC SV_TransferConsistencyInfo_internal(void) { consistency_t *pc; diff --git a/rehlds/engine/sv_user.h b/rehlds/engine/sv_user.h index 44fc49f..c69e2f3 100644 --- a/rehlds/engine/sv_user.h +++ b/rehlds/engine/sv_user.h @@ -120,6 +120,7 @@ extern qboolean nofind; void SV_ParseConsistencyResponse(client_t *pSenderClient); qboolean SV_FileInConsistencyList(const char *filename, consistency_t **ppconsist); int SV_TransferConsistencyInfo(void); +int SV_TransferConsistencyInfo_internal(void); void SV_SendConsistencyList(sizebuf_t *msg); void SV_PreRunCmd(void); void SV_CopyEdictToPhysent(physent_t *pe, int e, edict_t *check); diff --git a/rehlds/public/rehlds/rehlds_api.h b/rehlds/public/rehlds/rehlds_api.h index f0580ff..e7c38e3 100644 --- a/rehlds/public/rehlds/rehlds_api.h +++ b/rehlds/public/rehlds/rehlds_api.h @@ -161,6 +161,10 @@ typedef IVoidHookChainRegistry IRehldsHookRegistry_SV_WriteVoiceCod typedef IHookChain IRehldsHook_Steam_GSGetSteamID; typedef IHookChainRegistry IRehldsHookRegistry_Steam_GSGetSteamID; +//SV_TransferConsistencyInfo hook +typedef IHookChain IRehldsHook_SV_TransferConsistencyInfo; +typedef IHookChainRegistry IRehldsHookRegistry_SV_TransferConsistencyInfo; + class IRehldsHookchains { public: virtual ~IRehldsHookchains() { } @@ -196,6 +200,7 @@ public: virtual IRehldsHookRegistry_SV_ActivateServer* SV_ActivateServer() = 0; virtual IRehldsHookRegistry_SV_WriteVoiceCodec* SV_WriteVoiceCodec() = 0; virtual IRehldsHookRegistry_Steam_GSGetSteamID* Steam_GSGetSteamID() = 0; + virtual IRehldsHookRegistry_SV_TransferConsistencyInfo* SV_TransferConsistencyInfo() = 0; }; struct RehldsFuncs_t { @@ -240,6 +245,7 @@ struct RehldsFuncs_t { void(*MSG_WriteString)(sizebuf_t *sb, const char *s); void*(*GetPluginApi)(const char *name); void(*RegisterPluginApi)(const char *name, void *impl); + qboolean(*SV_FileInConsistencyList)(const char *filename, struct consistency_s **ppconsist); }; class IRehldsApi { diff --git a/rehlds/rehlds/rehlds_api_impl.cpp b/rehlds/rehlds/rehlds_api_impl.cpp index 5e5cb72..386c1d7 100644 --- a/rehlds/rehlds/rehlds_api_impl.cpp +++ b/rehlds/rehlds/rehlds_api_impl.cpp @@ -191,7 +191,8 @@ RehldsFuncs_t g_RehldsApiFuncs = &MSG_WriteShort_api, &MSG_WriteString_api, &Rehlds_GetPluginApi, - &Rehlds_RegisterPluginApi + &Rehlds_RegisterPluginApi, + &SV_FileInConsistencyList }; sizebuf_t* EXT_FUNC GetNetMessage_api() @@ -349,6 +350,10 @@ CRehldsHookRegistry_Steam_GSGetSteamID* CRehldsHookchains::Steam_GSGetSteamID() return &m_Steam_GSGetSteamID; } +CRehldsHookRegistry_SV_TransferConsistencyInfo* CRehldsHookchains::SV_TransferConsistencyInfo() { + return &m_SV_TransferConsistencyInfo; +} + int EXT_FUNC CRehldsApi::GetMajorVersion() { return REHLDS_API_VERSION_MAJOR; diff --git a/rehlds/rehlds/rehlds_api_impl.h b/rehlds/rehlds/rehlds_api_impl.h index afaaa15..beb10b0 100644 --- a/rehlds/rehlds/rehlds_api_impl.h +++ b/rehlds/rehlds/rehlds_api_impl.h @@ -155,6 +155,10 @@ typedef IVoidHookChainRegistryImpl CRehldsHookRegistry_SV_WriteVoic typedef IHookChainImpl CRehldsHook_Steam_GSGetSteamID; typedef IHookChainRegistryImpl CRehldsHookRegistry_Steam_GSGetSteamID; +//SV_TransferConsistencyInfo hook +typedef IHookChainImpl CRehldsHook_SV_TransferConsistencyInfo; +typedef IHookChainRegistryImpl CRehldsHookRegistry_SV_TransferConsistencyInfo; + class CRehldsHookchains : public IRehldsHookchains { public: CRehldsHookRegistry_Steam_NotifyClientConnect m_Steam_NotifyClientConnect; @@ -188,6 +192,7 @@ public: CRehldsHookRegistry_SV_ActivateServer m_SV_ActivateServer; CRehldsHookRegistry_SV_WriteVoiceCodec m_SV_WriteVoiceCodec; CRehldsHookRegistry_Steam_GSGetSteamID m_Steam_GSGetSteamID; + CRehldsHookRegistry_SV_TransferConsistencyInfo m_SV_TransferConsistencyInfo; public: virtual IRehldsHookRegistry_Steam_NotifyClientConnect* Steam_NotifyClientConnect(); @@ -221,6 +226,7 @@ public: virtual IRehldsHookRegistry_SV_ActivateServer* SV_ActivateServer(); virtual IRehldsHookRegistry_SV_WriteVoiceCodec* SV_WriteVoiceCodec(); virtual CRehldsHookRegistry_Steam_GSGetSteamID* Steam_GSGetSteamID(); + virtual CRehldsHookRegistry_SV_TransferConsistencyInfo* SV_TransferConsistencyInfo(); }; extern CRehldsHookchains g_RehldsHookchains;