mirror of
https://github.com/rehlds/rehlds.git
synced 2025-01-01 09:35:37 +03:00
PreprocessPacket hook moved after IP ban check
AUTH_IDTYPE moved to ReHLSDK
This commit is contained in:
parent
8e0377617c
commit
4594ffba4a
@ -1251,7 +1251,7 @@ void NET_FreeMsg(net_messages_t *pmsg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* <d40a2> ../engine/net_ws.c:1391 */
|
/* <d40a2> ../engine/net_ws.c:1391 */
|
||||||
qboolean NET_GetPacket_internal(netsrc_t sock)
|
qboolean NET_GetPacket(netsrc_t sock)
|
||||||
{
|
{
|
||||||
net_messages_t *pmsg; // 1393
|
net_messages_t *pmsg; // 1393
|
||||||
qboolean bret; // 1396
|
qboolean bret; // 1396
|
||||||
@ -1300,25 +1300,6 @@ qboolean NET_GetPacket_internal(netsrc_t sock)
|
|||||||
return bret;
|
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* <d41a9> ../engine/net_ws.c:1454 */
|
/* <d41a9> ../engine/net_ws.c:1454 */
|
||||||
void NET_AllocateQueues(void)
|
void NET_AllocateQueues(void)
|
||||||
{
|
{
|
||||||
|
@ -91,13 +91,6 @@
|
|||||||
#define HL_GENERIC_MAX 512
|
#define HL_GENERIC_MAX 512
|
||||||
#define HL_EVENT_MAX 256
|
#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 */
|
/* <87d6f> ../engine/server.h:43 */
|
||||||
typedef enum redirect_e
|
typedef enum redirect_e
|
||||||
{
|
{
|
||||||
|
@ -3560,6 +3560,11 @@ void SV_SendBan(void)
|
|||||||
SZ_Clear(&net_message);
|
SZ_Clear(&net_message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool EXT_FUNC NET_GetPacketPreprocessor(uint8* data, unsigned int len, const netadr_t& srcAddr)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/* <ab9af> ../engine/sv_main.c:4818 */
|
/* <ab9af> ../engine/sv_main.c:4818 */
|
||||||
void SV_ReadPackets(void)
|
void SV_ReadPackets(void)
|
||||||
{
|
{
|
||||||
@ -3571,6 +3576,10 @@ void SV_ReadPackets(void)
|
|||||||
continue;
|
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)
|
if (*(uint32 *)net_message.data == 0xFFFFFFFF)
|
||||||
{
|
{
|
||||||
// Connectionless packet
|
// Connectionless packet
|
||||||
|
@ -29,6 +29,14 @@
|
|||||||
|
|
||||||
#include "archtypes.h"
|
#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 */
|
/* <2e915> ../engine/userid.h:22 */
|
||||||
typedef struct USERID_s
|
typedef struct USERID_s
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
TEST(CRC32C_Hash, CRC32C, 1000) {
|
TEST(CRC32C_Hash, CRC32C, 1000) {
|
||||||
|
|
||||||
Sys_CheckCpuInstructionsSupport();
|
Sys_CheckCpuInstructionsSupport();
|
||||||
CHECK_WARNING_OUT("SSE4.1 Support", cpuinfo.sse4_1);
|
CHECK_WARNING_OUT("SSE4.2 Support", cpuinfo.sse4_2);
|
||||||
|
|
||||||
struct testdata_t {
|
struct testdata_t {
|
||||||
const char* src;
|
const char* src;
|
||||||
|
Loading…
Reference in New Issue
Block a user