diff --git a/dep/rehlsdk/common/const.h b/dep/rehlsdk/common/const.h index e8ba7c0..f539684 100644 --- a/dep/rehlsdk/common/const.h +++ b/dep/rehlsdk/common/const.h @@ -19,6 +19,18 @@ #pragma once #endif +// Max # of clients allowed in a server. +#define MAX_CLIENTS 32 + +// How many bits to use to encode an edict. +#define MAX_EDICT_BITS 11 // # of bits needed to represent max edicts +// Max # of edicts in a level (2048) +#define MAX_EDICTS (1< ../common/quakedef.h:29 */ typedef int BOOL; /* size: 4 */ +// user message +#define MAX_USER_MSG_DATA 192 + /* <627f> ../common/quakedef.h:137 */ //moved to com_model.h //typedef struct cache_user_s diff --git a/dep/rehlsdk/engine/common_rehlds.h b/dep/rehlsdk/engine/common_rehlds.h index b2cf597..c0004a8 100644 --- a/dep/rehlsdk/engine/common_rehlds.h +++ b/dep/rehlsdk/engine/common_rehlds.h @@ -28,8 +28,13 @@ #pragma once #include "const.h" +#include "qlimits.h" +#ifdef REHLDS_FIXES +#define COM_TOKEN_LEN 2048 +#else #define COM_TOKEN_LEN 1024 +#endif // Don't allow overflow #define SIZEBUF_CHECK_OVERFLOW 0 diff --git a/dep/rehlsdk/engine/custom.h b/dep/rehlsdk/engine/custom.h index 1bbd85d..190d769 100644 --- a/dep/rehlsdk/engine/custom.h +++ b/dep/rehlsdk/engine/custom.h @@ -18,6 +18,7 @@ #include "const.h" #define MAX_QPATH 64 // Must match value in quakedefs.h +#define MAX_RESOURCE_LIST 1280 ///////////////// // Customization diff --git a/dep/rehlsdk/engine/eiface.h b/dep/rehlsdk/engine/eiface.h index 60266ec..8081743 100644 --- a/dep/rehlsdk/engine/eiface.h +++ b/dep/rehlsdk/engine/eiface.h @@ -493,7 +493,7 @@ typedef struct // Return 1 if the packet is valid. Set response_buffer_size if you want to send a response packet. Incoming, it holds the max // size of the response_buffer, so you must zero it out if you choose not to respond. - int (*pfnConnectionlessPacket ) ( const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size ); + int (*pfnConnectionlessPacket ) ( const struct netadr_s *net_from_, const char *args, char *response_buffer, int *response_buffer_size ); // Enumerates player hulls. Returns 0 if the hull number doesn't exist, 1 otherwise int (*pfnGetHullBounds) ( int hullnumber, float *mins, float *maxs ); diff --git a/dep/rehlsdk/engine/rehlds_api.h b/dep/rehlsdk/engine/rehlds_api.h index f8ac00f..2857c5b 100644 --- a/dep/rehlsdk/engine/rehlds_api.h +++ b/dep/rehlsdk/engine/rehlds_api.h @@ -35,7 +35,7 @@ #include "model.h" #define REHLDS_API_VERSION_MAJOR 2 -#define REHLDS_API_VERSION_MINOR 2 +#define REHLDS_API_VERSION_MINOR 3 //Steam_NotifyClientConnect hook typedef IHookChain IRehldsHook_Steam_NotifyClientConnect; @@ -141,9 +141,21 @@ typedef IVoidHookChainRegistry IRehldsHook_SV_WriteFullClientUpdate; typedef IVoidHookChainRegistry IRehldsHookRegistry_SV_WriteFullClientUpdate; -//SV_GenericFileConsistencyResponce hook -typedef IVoidHookChain IRehldsHook_GenericFileConsistencyResponce; -typedef IVoidHookChainRegistry IRehldsHookRegistry_GenericFileConsistencyResponce; +//SV_CheckConsistencyResponse hook +typedef IHookChain IRehldsHook_SV_CheckConsistencyResponse; +typedef IHookChainRegistry IRehldsHookRegistry_SV_CheckConsistencyResponse; + +//SV_DropClient hook +typedef IVoidHookChain IRehldsHook_SV_DropClient; +typedef IVoidHookChainRegistry IRehldsHookRegistry_SV_DropClient; + +//SV_ActivateServer hook +typedef IVoidHookChain IRehldsHook_SV_ActivateServer; +typedef IVoidHookChainRegistry IRehldsHookRegistry_SV_ActivateServer; + +//SV_WriteVoiceCodec hook +typedef IVoidHookChain IRehldsHook_SV_WriteVoiceCodec; +typedef IVoidHookChainRegistry IRehldsHookRegistry_SV_WriteVoiceCodec; class IRehldsHookchains { public: @@ -175,7 +187,10 @@ public: virtual IRehldsHookRegistry_PF_Remove_I* PF_Remove_I() = 0; virtual IRehldsHookRegistry_PF_BuildSoundMsg_I* PF_BuildSoundMsg_I() = 0; virtual IRehldsHookRegistry_SV_WriteFullClientUpdate* SV_WriteFullClientUpdate() = 0; - virtual IRehldsHookRegistry_GenericFileConsistencyResponce* GenericFileConsistencyResponce() = 0; + virtual IRehldsHookRegistry_SV_CheckConsistencyResponse* SV_CheckConsistencyResponse() = 0; + virtual IRehldsHookRegistry_SV_DropClient* SV_DropClient() = 0; + virtual IRehldsHookRegistry_SV_ActivateServer* SV_ActivateServer() = 0; + virtual IRehldsHookRegistry_SV_WriteVoiceCodec* SV_WriteVoiceCodec() = 0; }; struct RehldsFuncs_t { @@ -211,6 +226,13 @@ struct RehldsFuncs_t { void*(*SZ_GetSpace)(sizebuf_t *buf, int length); cvar_t*(*GetCvarVars)(); int (*SV_GetChallenge)(const netadr_t& adr); + void (*SV_AddResource)(resourcetype_t type, const char *name, int size, unsigned char flags, int index); + int(*MSG_ReadShort)(void); + int(*MSG_ReadBuf)(int iSize, void *pbuf); + void(*MSG_WriteBuf)(sizebuf_t *sb, int iSize, void *buf); + void(*MSG_WriteByte)(sizebuf_t *sb, int c); + void(*MSG_WriteShort)(sizebuf_t *sb, int c); + void(*MSG_WriteString)(sizebuf_t *sb, const char *s); }; class IRehldsApi { diff --git a/dep/rehlsdk/engine/rehlds_interfaces.h b/dep/rehlsdk/engine/rehlds_interfaces.h index ce46d55..ea74dc3 100644 --- a/dep/rehlsdk/engine/rehlds_interfaces.h +++ b/dep/rehlsdk/engine/rehlds_interfaces.h @@ -67,6 +67,9 @@ public: virtual bool IsConnected() = 0; virtual void SetConnected(bool connected) = 0; + virtual uint32 GetVoiceStreams(int id) = 0; + virtual double GetLastVoiceTime() = 0; + virtual bool GetLoopback() = 0; // this must be the last virtual function in class #ifdef REHLDS_SELF @@ -113,4 +116,10 @@ public: virtual sizebuf_t* GetReliableDatagram() = 0; virtual void SetModelName(const char* modelname) = 0; + virtual void SetConsistencyNum(int num) = 0; + virtual int GetConsistencyNum() = 0; + virtual int GetResourcesNum() = 0; + virtual int GetDecalNameNum() = 0; + + virtual double GetTime() = 0; }; diff --git a/dep/rehlsdk/engine/sys_shared.cpp b/dep/rehlsdk/engine/sys_shared.cpp index f39b79a..58981d6 100644 --- a/dep/rehlsdk/engine/sys_shared.cpp +++ b/dep/rehlsdk/engine/sys_shared.cpp @@ -42,14 +42,9 @@ cpuinfo_t cpuinfo; void Sys_CheckCpuInstructionsSupport(void) { - unsigned int cpuid_data[4]; + int cpuid_data[4]; - // eax = 1, ecx = 0 -#if defined(__GNUC__) - __get_cpuid(0x1, &cpuid_data[0], &cpuid_data[1], &cpuid_data[2], &cpuid_data[3]); -#else //__GNUC__ - __cpuidex((int*)cpuid_data, 1, 0); -#endif //__GNUC__ + cpuid_ex(cpuid_data, 1, 0); cpuinfo.sse3 = (cpuid_data[2] & SSE3_FLAG) ? 1 : 0; // ecx cpuinfo.ssse3 = (cpuid_data[2] & SSSE3_FLAG) ? 1 : 0; @@ -57,12 +52,7 @@ void Sys_CheckCpuInstructionsSupport(void) cpuinfo.sse4_2 = (cpuid_data[2] & SSE4_2_FLAG) ? 1 : 0; cpuinfo.avx = (cpuid_data[2] & AVX_FLAG) ? 1 : 0; - // eax = 7, ecx = 0 -#if defined(__GNUC__) - __get_cpuid(0x7, &cpuid_data[0], &cpuid_data[1], &cpuid_data[2], &cpuid_data[3]); -#else //__GNUC__ - __cpuidex((int*)cpuid_data, 7, 0); -#endif //__GNUC__ + cpuid_ex(cpuid_data, 7, 0); cpuinfo.avx2 = (cpuid_data[1] & AVX2_FLAG) ? 1 : 0; // ebx } \ No newline at end of file