diff --git a/rehlds/engine/net_chan.cpp b/rehlds/engine/net_chan.cpp index 87abfaa..0b6591f 100644 --- a/rehlds/engine/net_chan.cpp +++ b/rehlds/engine/net_chan.cpp @@ -846,7 +846,7 @@ qboolean Netchan_Process(netchan_t *chan) { // Make sure we actually could have ack'd this message #ifdef REHLDS_FIXES - if (sequence_ack >= chan->last_reliable_sequence) + if (sequence_ack >= (unsigned)chan->last_reliable_sequence) #else // REHLDS_FIXES if (chan->incoming_acknowledged + 1 >= chan->last_reliable_sequence) #endif // REHLDS_FIXES diff --git a/rehlds/engine/server.h b/rehlds/engine/server.h index 426b64d..b0a339e 100644 --- a/rehlds/engine/server.h +++ b/rehlds/engine/server.h @@ -644,6 +644,7 @@ void SV_SendUserReg(sizebuf_t *msg); void SV_New_f(void); void SV_SendRes_f(void); void SV_Spawn_f(void); +void SV_Spawn_f_internal(void); void SV_CheckUpdateRate(double *rate); void SV_RejectConnection(netadr_t *adr, char *fmt, ...); void SV_RejectConnectionForPassword(netadr_t *adr); diff --git a/rehlds/engine/sv_main.cpp b/rehlds/engine/sv_main.cpp index 8c8e884..614a568 100644 --- a/rehlds/engine/sv_main.cpp +++ b/rehlds/engine/sv_main.cpp @@ -1663,8 +1663,13 @@ void SV_SendRes_f(void) } } -/* ../engine/sv_main.c:2096 */ void SV_Spawn_f(void) +{ + g_RehldsHookchains.m_SV_Spawn_f.callChain(SV_Spawn_f_internal); +} + +/* ../engine/sv_main.c:2096 */ +void EXT_FUNC SV_Spawn_f_internal(void) { unsigned char data[NET_MAX_PAYLOAD]; sizebuf_t msg; @@ -2118,7 +2123,7 @@ void SV_ReplaceSpecialCharactersInName(char *newname, const char *oldname) break; // http://unicode-table.com/blocks/halfwidth-and-fullwidth-forms/ - newname[n++] = 0xEF; + newname[n++] = char(0xEF); newname[n++] = 0xBC | (((*s - 0x20) & 0x40) >> 6); newname[n++] = 0x80 + ((*s - 0x20) & 0x3F); diff --git a/rehlds/public/rehlds/rehlds_api.h b/rehlds/public/rehlds/rehlds_api.h index 4bb2d25..728cfd1 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 10 +#define REHLDS_API_VERSION_MINOR 11 //Steam_NotifyClientConnect hook typedef IHookChain IRehldsHook_Steam_NotifyClientConnect; @@ -177,6 +177,10 @@ typedef IVoidHookChainRegistry IRehldsHookRegistr typedef IVoidHookChain IRehldsHook_SV_EstablishTimeBase; typedef IVoidHookChainRegistry IRehldsHookRegistry_SV_EstablishTimeBase; +//SV_Spawn_f hook +typedef IVoidHookChain<> IRehldsHook_SV_Spawn_f; +typedef IVoidHookChainRegistry<> IRehldsHookRegistry_SV_Spawn_f; + class IRehldsHookchains { public: virtual ~IRehldsHookchains() { } @@ -216,6 +220,7 @@ public: virtual IRehldsHookRegistry_Steam_GSBUpdateUserData* Steam_GSBUpdateUserData() = 0; virtual IRehldsHookRegistry_Cvar_DirectSet* Cvar_DirectSet() = 0; virtual IRehldsHookRegistry_SV_EstablishTimeBase* SV_EstablishTimeBase() = 0; + virtual IRehldsHookRegistry_SV_Spawn_f* SV_Spawn_f() = 0; }; struct RehldsFuncs_t { diff --git a/rehlds/rehlds/rehlds_api_impl.cpp b/rehlds/rehlds/rehlds_api_impl.cpp index 145959e..0b05244 100644 --- a/rehlds/rehlds/rehlds_api_impl.cpp +++ b/rehlds/rehlds/rehlds_api_impl.cpp @@ -368,6 +368,10 @@ IRehldsHookRegistry_SV_EstablishTimeBase* CRehldsHookchains::SV_EstablishTimeBas return &m_SV_EstablishTimeBase; } +IRehldsHookRegistry_SV_Spawn_f* CRehldsHookchains::SV_Spawn_f() { + return &m_SV_Spawn_f; +} + 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 fd1e489..1f00b65 100644 --- a/rehlds/rehlds/rehlds_api_impl.h +++ b/rehlds/rehlds/rehlds_api_impl.h @@ -171,6 +171,10 @@ typedef IVoidHookChainRegistryImpl CRehldsHookReg typedef IVoidHookChainImpl CRehldsHook_SV_EstablishTimeBase; typedef IVoidHookChainRegistryImpl CRehldsHookRegistry_SV_EstablishTimeBase; +//SV_Spawn_f hook +typedef IVoidHookChainImpl<> CRehldsHook_SV_Spawn_f; +typedef IVoidHookChainRegistryImpl<> CRehldsHookRegistry_SV_Spawn_f; + class CRehldsHookchains : public IRehldsHookchains { public: CRehldsHookRegistry_Steam_NotifyClientConnect m_Steam_NotifyClientConnect; @@ -208,6 +212,7 @@ public: CRehldsHookRegistry_Steam_GSBUpdateUserData m_Steam_GSBUpdateUserData; CRehldsHookRegistry_Cvar_DirectSet m_Cvar_DirectSet; CRehldsHookRegistry_SV_EstablishTimeBase m_SV_EstablishTimeBase; + CRehldsHookRegistry_SV_Spawn_f m_SV_Spawn_f; public: virtual IRehldsHookRegistry_Steam_NotifyClientConnect* Steam_NotifyClientConnect(); @@ -245,6 +250,7 @@ public: virtual IRehldsHookRegistry_Steam_GSBUpdateUserData* Steam_GSBUpdateUserData(); virtual IRehldsHookRegistry_Cvar_DirectSet* Cvar_DirectSet(); virtual IRehldsHookRegistry_SV_EstablishTimeBase* SV_EstablishTimeBase(); + virtual IRehldsHookRegistry_SV_Spawn_f* SV_Spawn_f(); }; extern CRehldsHookchains g_RehldsHookchains;