From 93222402b8a00d7b0f72a38a28e5ea70417d3289 Mon Sep 17 00:00:00 2001 From: Asmodai Date: Wed, 26 Sep 2018 23:48:10 +0300 Subject: [PATCH] Optimize check for bans by ip --- rehlds/engine/sv_main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rehlds/engine/sv_main.cpp b/rehlds/engine/sv_main.cpp index c22a672..7c22ce5 100644 --- a/rehlds/engine/sv_main.cpp +++ b/rehlds/engine/sv_main.cpp @@ -3586,11 +3586,13 @@ void SV_ReadPackets(void) { while (NET_GetPacket(NS_SERVER)) { +#ifndef REHLDS_FIXES if (SV_FilterPacket()) { SV_SendBan(); continue; } +#endif bool pass = g_RehldsHookchains.m_PreprocessPacket.callChain(NET_GetPacketPreprocessor, net_message.data, net_message.cursize, net_from); if (!pass) @@ -3601,6 +3603,14 @@ void SV_ReadPackets(void) // Connectionless packet if (SV_CheckConnectionLessRateLimits(net_from)) { +#ifdef REHLDS_FIXES + if (SV_FilterPacket()) + { + SV_SendBan(); + continue; + } +#endif + Steam_HandleIncomingPacket(net_message.data, net_message.cursize, ntohl(*(u_long *)&net_from.ip[0]), htons(net_from.port)); SV_ConnectionlessPacket(); }