From db2c7c7c1079d1acbc16df4e344729e273a590f0 Mon Sep 17 00:00:00 2001 From: WPMGPRoSToTeMa Date: Mon, 13 Jul 2015 02:00:34 +0300 Subject: [PATCH] Added SetModelName function to ReHLDS API --- rehlds/public/rehlds/rehlds_api.h | 2 +- rehlds/public/rehlds/rehlds_interfaces.h | 2 ++ rehlds/rehlds/rehlds_interfaces_impl.cpp | 5 +++++ rehlds/rehlds/rehlds_interfaces_impl.h | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/rehlds/public/rehlds/rehlds_api.h b/rehlds/public/rehlds/rehlds_api.h index b25364b..57e5c43 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 1 -#define REHLDS_API_VERSION_MINOR 2 +#define REHLDS_API_VERSION_MINOR 3 //Steam_NotifyClientConnect hook typedef IHookChain IRehldsHook_Steam_NotifyClientConnect; diff --git a/rehlds/public/rehlds/rehlds_interfaces.h b/rehlds/public/rehlds/rehlds_interfaces.h index 6b841d5..9fde652 100644 --- a/rehlds/public/rehlds/rehlds_interfaces.h +++ b/rehlds/public/rehlds/rehlds_interfaces.h @@ -108,4 +108,6 @@ public: virtual const char* GetName() = 0; virtual uint32 GetWorldmapCrc() = 0; virtual uint8* GetClientDllMd5() = 0; + + virtual void SetModelName(const char* modelname) = 0; }; diff --git a/rehlds/rehlds/rehlds_interfaces_impl.cpp b/rehlds/rehlds/rehlds_interfaces_impl.cpp index c7de73b..8eea115 100644 --- a/rehlds/rehlds/rehlds_interfaces_impl.cpp +++ b/rehlds/rehlds/rehlds_interfaces_impl.cpp @@ -161,6 +161,11 @@ const char* EXT_FUNC CRehldsServerData::GetModelName() { return g_psv.modelname; } +void EXT_FUNC CRehldsServerData::SetModelName(const char* modelname) { + Q_strncpy(g_psv.modelname, modelname, ARRAYSIZE(g_psv.modelname) - 1); + g_psv.modelname[ARRAYSIZE(g_psv.modelname) - 1] = '\0'; +} + const char* EXT_FUNC CRehldsServerData::GetName() { return g_psv.name; } diff --git a/rehlds/rehlds/rehlds_interfaces_impl.h b/rehlds/rehlds/rehlds_interfaces_impl.h index cc9cd2c..d311dfa 100644 --- a/rehlds/rehlds/rehlds_interfaces_impl.h +++ b/rehlds/rehlds/rehlds_interfaces_impl.h @@ -96,6 +96,8 @@ public: virtual const char* GetName(); virtual uint32 GetWorldmapCrc(); virtual uint8* GetClientDllMd5(); + + virtual void SetModelName(const char* modelname); }; extern CGameClient** g_GameClients;