diff options
author | pg9182 <96569817+pg9182@users.noreply.github.com> | 2023-03-05 16:19:15 -0500 |
---|---|---|
committer | pg9182 <96569817+pg9182@users.noreply.github.com> | 2023-04-17 14:50:10 -0400 |
commit | 2c889a0bc06b19f5842d002f5d671aaab8c3b419 (patch) | |
tree | a04d62c61abcd6c7ddb4fd9b20e16b86b1a27d4d /NorthstarDLL/server/servernethooks.cpp | |
parent | 450d0b1ed437cf37b4309af952af8904f3f07768 (diff) | |
download | NorthstarLauncher-2c889a0bc06b19f5842d002f5d671aaab8c3b419.tar.gz NorthstarLauncher-2c889a0bc06b19f5842d002f5d671aaab8c3b419.zip |
Extract ProcessConnectionlessPacket hook to separate file
Diffstat (limited to 'NorthstarDLL/server/servernethooks.cpp')
-rw-r--r-- | NorthstarDLL/server/servernethooks.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/NorthstarDLL/server/servernethooks.cpp b/NorthstarDLL/server/servernethooks.cpp new file mode 100644 index 00000000..c5f4f75f --- /dev/null +++ b/NorthstarDLL/server/servernethooks.cpp @@ -0,0 +1,16 @@ +#include "engine/r2engine.h" +#include "shared/exploit_fixes/ns_limits.h" + +AUTOHOOK_INIT() + +AUTOHOOK(ProcessConnectionlessPacket, engine.dll + 0x117800, bool, , (void* a1, R2::netpacket_t* packet)) +{ + if (!g_pServerLimits->CheckConnectionlessPacketLimits(packet)) + return false; + return ProcessConnectionlessPacket(a1, packet); +} + +ON_DLL_LOAD_RELIESON("engine.dll", ServerNetHooks, ConVar, (CModule module)) +{ + AUTOHOOK_DISPATCH_MODULE(engine.dll) +} |