diff --git a/rehlds/public/rehlds/rehlds_api.h b/rehlds/public/rehlds/rehlds_api.h index 743e47d..278d3d5 100644 --- a/rehlds/public/rehlds/rehlds_api.h +++ b/rehlds/public/rehlds/rehlds_api.h @@ -38,7 +38,7 @@ #include "pr_dlls.h" #define REHLDS_API_VERSION_MAJOR 3 -#define REHLDS_API_VERSION_MINOR 14 +#define REHLDS_API_VERSION_MINOR 15 //Steam_NotifyClientConnect hook typedef IHookChain IRehldsHook_Steam_NotifyClientConnect; @@ -434,6 +434,9 @@ struct RehldsFuncs_t { void(*MSG_BeginReading)(); double(*GetHostFrameTime)(); struct cmd_function_s *(*GetFirstCmdFunctionHandle)(); + + // Pause + void(*SetServerPause)(bool status); }; class IRehldsApi { diff --git a/rehlds/rehlds/rehlds_api_impl.cpp b/rehlds/rehlds/rehlds_api_impl.cpp index 9cdd7e1..33b3a80 100644 --- a/rehlds/rehlds/rehlds_api_impl.cpp +++ b/rehlds/rehlds/rehlds_api_impl.cpp @@ -468,6 +468,26 @@ void EXT_FUNC SV_WriteMovevarsToClient_api(sizebuf_t *message) SV_WriteMovevarsToClient(message, &sv_movevars); } +void EXT_FUNC SetServerPause(bool setPause) +{ + g_psv.paused = setPause; +#ifdef REHLDS_FIXES + for (int i = 0; i < g_psvs.maxclients; i++) + { + if (g_psvs.clients[i].fakeclient) + continue; + if (!g_psvs.clients[i].connected) + continue; + + MSG_WriteByte(&g_psvs.clients[i].netchan.message, svc_setpause); + MSG_WriteByte(&g_psvs.clients[i].netchan.message, g_psv.paused); + } +#else // REHLDS_FIXES + MSG_WriteByte(&g_psv.reliable_datagram, svc_setpause); + MSG_WriteByte(&g_psv.reliable_datagram, g_psv.paused); +#endif // REHLDS_FIXES +} + CRehldsServerStatic g_RehldsServerStatic; CRehldsServerData g_RehldsServerData; CRehldsHookchains g_RehldsHookchains; @@ -571,7 +591,8 @@ RehldsFuncs_t g_RehldsApiFuncs = &SZ_Clear_api, &MSG_BeginReading_api, &GetHostFrameTime_api, - &GetFirstCmdFunctionHandle_api + &GetFirstCmdFunctionHandle_api, + &SetServerPause, }; bool EXT_FUNC SV_EmitSound2_internal(edict_t *entity, IGameClient *pReceiver, int channel, const char *sample, float volume, float attenuation, int flags, int pitch, int emitFlags, const float *pOrigin) diff --git a/rehlds/version/version.h b/rehlds/version/version.h index 3bed179..9282543 100644 --- a/rehlds/version/version.h +++ b/rehlds/version/version.h @@ -6,5 +6,5 @@ #pragma once #define VERSION_MAJOR 3 -#define VERSION_MINOR 14 +#define VERSION_MINOR 15 #define VERSION_MAINTENANCE 0