diff --git a/rehlds/engine/net_ws.cpp b/rehlds/engine/net_ws.cpp index e0cd7d8..c1f124e 100644 --- a/rehlds/engine/net_ws.cpp +++ b/rehlds/engine/net_ws.cpp @@ -1251,7 +1251,7 @@ void NET_FreeMsg(net_messages_t *pmsg) } /* ../engine/net_ws.c:1391 */ -qboolean NET_GetPacket_internal(netsrc_t sock) +qboolean NET_GetPacket(netsrc_t sock) { net_messages_t *pmsg; // 1393 qboolean bret; // 1396 @@ -1300,25 +1300,6 @@ qboolean NET_GetPacket_internal(netsrc_t sock) return bret; } -bool EXT_FUNC NET_GetPacketPreprocessor(uint8* data, unsigned int len, const netadr_t& srcAddr) { - return true; -} - -qboolean NET_GetPacket(netsrc_t sock) { - qboolean getRes = NET_GetPacket_internal(sock); - while (getRes) { - bool pass = g_RehldsHookchains.m_PreprocessPacket.callChain(NET_GetPacketPreprocessor, net_message.data, net_message.cursize, net_from); - if (pass) { - return 1; - } - - //packet was consumed by 3rd party plugin, try to read another one - getRes = NET_GetPacket_internal(sock); - } - - return 0; -} - /* ../engine/net_ws.c:1454 */ void NET_AllocateQueues(void) { diff --git a/rehlds/engine/server.h b/rehlds/engine/server.h index 3a205c3..5eaa360 100644 --- a/rehlds/engine/server.h +++ b/rehlds/engine/server.h @@ -91,13 +91,6 @@ #define HL_GENERIC_MAX 512 #define HL_EVENT_MAX 256 -// Authentication types -#define AUTH_IDTYPE_UNKNOWN 0 -#define AUTH_IDTYPE_STEAM 1 -#define AUTH_IDTYPE_VALVE 2 -#define AUTH_IDTYPE_LOCAL 3 - - /* <87d6f> ../engine/server.h:43 */ typedef enum redirect_e { diff --git a/rehlds/engine/sv_main.cpp b/rehlds/engine/sv_main.cpp index e290bcf..ffef1ce 100644 --- a/rehlds/engine/sv_main.cpp +++ b/rehlds/engine/sv_main.cpp @@ -3560,6 +3560,11 @@ void SV_SendBan(void) SZ_Clear(&net_message); } +bool EXT_FUNC NET_GetPacketPreprocessor(uint8* data, unsigned int len, const netadr_t& srcAddr) +{ + return true; +} + /* ../engine/sv_main.c:4818 */ void SV_ReadPackets(void) { @@ -3571,6 +3576,10 @@ void SV_ReadPackets(void) continue; } + bool pass = g_RehldsHookchains.m_PreprocessPacket.callChain(NET_GetPacketPreprocessor, net_message.data, net_message.cursize, net_from); + if (!pass) + continue; + if (*(uint32 *)net_message.data == 0xFFFFFFFF) { // Connectionless packet diff --git a/rehlds/public/rehlds/userid_rehlds.h b/rehlds/public/rehlds/userid_rehlds.h index cd3ddc4..0fb8d84 100644 --- a/rehlds/public/rehlds/userid_rehlds.h +++ b/rehlds/public/rehlds/userid_rehlds.h @@ -29,6 +29,14 @@ #include "archtypes.h" +// Authentication types +enum AUTH_IDTYPE +{ + AUTH_IDTYPE_UNKNOWN = 0, + AUTH_IDTYPE_STEAM = 1, + AUTH_IDTYPE_VALVE = 2, + AUTH_IDTYPE_LOCAL = 3 +}; /* <2e915> ../engine/userid.h:22 */ typedef struct USERID_s diff --git a/rehlds/unittests/crc32c_tests.cpp b/rehlds/unittests/crc32c_tests.cpp index 885e7b8..9e4c4b6 100644 --- a/rehlds/unittests/crc32c_tests.cpp +++ b/rehlds/unittests/crc32c_tests.cpp @@ -6,7 +6,7 @@ TEST(CRC32C_Hash, CRC32C, 1000) { Sys_CheckCpuInstructionsSupport(); - CHECK_WARNING_OUT("SSE4.1 Support", cpuinfo.sse4_1); + CHECK_WARNING_OUT("SSE4.2 Support", cpuinfo.sse4_2); struct testdata_t { const char* src;