From aedbcd1380d1a5cecae493831792fe61bf20ef76 Mon Sep 17 00:00:00 2001 From: asmodai Date: Mon, 5 Oct 2015 00:23:10 +0300 Subject: [PATCH] Added API for getting cvar_vars. --- rehlds/public/rehlds/rehlds_api.h | 3 ++- rehlds/rehlds/rehlds_api_impl.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/rehlds/public/rehlds/rehlds_api.h b/rehlds/public/rehlds/rehlds_api.h index 70a1bdb..a172f50 100644 --- a/rehlds/public/rehlds/rehlds_api.h +++ b/rehlds/public/rehlds/rehlds_api.h @@ -35,7 +35,7 @@ #include "model.h" #define REHLDS_API_VERSION_MAJOR 2 -#define REHLDS_API_VERSION_MINOR 0 +#define REHLDS_API_VERSION_MINOR 1 //Steam_NotifyClientConnect hook typedef IHookChain IRehldsHook_Steam_NotifyClientConnect; @@ -209,6 +209,7 @@ struct RehldsFuncs_t { void(*MSG_WriteBitVec3Coord)(const float *fa); void(*MSG_EndBitWriting)(sizebuf_t *buf); void*(*SZ_GetSpace)(sizebuf_t *buf, int length); + cvar_t*(*GetCvarVars)(); }; class IRehldsApi { diff --git a/rehlds/rehlds/rehlds_api_impl.cpp b/rehlds/rehlds/rehlds_api_impl.cpp index 79ebf27..bcc4cd5 100644 --- a/rehlds/rehlds/rehlds_api_impl.cpp +++ b/rehlds/rehlds/rehlds_api_impl.cpp @@ -81,6 +81,10 @@ void EXT_FUNC MSG_EndBitWriting_api(sizebuf_t *buf) { MSG_EndBitWriting(buf); } +cvar_t* EXT_FUNC GetCvarVars_api() { + return cvar_vars; +} + CRehldsServerStatic g_RehldsServerStatic; CRehldsServerData g_RehldsServerData; CRehldsHookchains g_RehldsHookchains; @@ -115,7 +119,8 @@ RehldsFuncs_t g_RehldsApiFuncs = &MSG_WriteBits_api, &MSG_WriteBitVec3Coord_api, &MSG_EndBitWriting_api, - &SZ_GetSpace + &SZ_GetSpace, + &GetCvarVars_api }; sizebuf_t* EXT_FUNC GetNetMessage_api()