From deca47cb54e41010d1df432b699654212eb2710f Mon Sep 17 00:00:00 2001 From: hubdom <26039831+hubdom@users.noreply.github.com> Date: Wed, 2 Jun 2021 23:10:57 +0200 Subject: [PATCH] fix server lagging as a result from too many ConMsgs due to packet spam --- AMBuildScript | 4 ++-- extension.cpp | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/AMBuildScript b/AMBuildScript index 2506d84..5bfb63d 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -158,7 +158,7 @@ class ExtensionConfig(object): '-fvisibility=hidden', ] cxx.cxxflags += [ - '-std=c++11', + '-std=c++14', '-fno-exceptions', '-fno-threadsafe-statics', '-Wno-non-virtual-dtor', @@ -260,7 +260,7 @@ class ExtensionConfig(object): def configure_windows(self, cxx): cxx.defines += ['WIN32', '_WINDOWS'] - + def ConfigureForExtension(self, context, compiler): compiler.cxxincludes += [ os.path.join(context.currentSourcePath), diff --git a/extension.cpp b/extension.cpp index 1eb283e..9cf62c7 100644 --- a/extension.cpp +++ b/extension.cpp @@ -206,6 +206,14 @@ static struct SrcdsPatch "xxxxxxxxxxx", (unsigned char *)"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90", 0, 0, 0, false + }, + // 10: fix server lagging resulting from too many ConMsgs due to packet spam + { + "_ZN8CNetChan19ProcessPacketHeaderEP11netpacket_s", + (unsigned char *)"\x89\x44\x24\x04\x89\x5C\x24\x0C\x89\x54\x24\x08\xE8\xE0\xAB\x22\x00", + "xxxxxxxxxxxxx????", + (unsigned char *)"\x89\x44\x24\x04\x89\x5C\x24\x0C\x89\x54\x24\x08\x90\x90\x90\x90\x90", + 0, 0, 0, true } }; @@ -724,7 +732,7 @@ bool CSSFixes::SDK_OnLoad(char *error, size_t maxlength, bool late) return false; } - pPatch->pPatchAddress = FindPattern(pPatch->pAddress, pPatch->pPatchSignature, pPatch->pPatchPattern, 1024); + pPatch->pPatchAddress = FindPattern(pPatch->pAddress, pPatch->pPatchSignature, pPatch->pPatchPattern, 4096); if(!pPatch->pPatchAddress) { snprintf(error, maxlength, "Could not find patch signature for symbol: %s", pPatch->pSignature);