aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/server
diff options
context:
space:
mode:
authorpg9182 <96569817+pg9182@users.noreply.github.com>2023-03-05 16:19:15 -0500
committerpg9182 <96569817+pg9182@users.noreply.github.com>2023-04-17 14:50:10 -0400
commit2c889a0bc06b19f5842d002f5d671aaab8c3b419 (patch)
treea04d62c61abcd6c7ddb4fd9b20e16b86b1a27d4d /NorthstarDLL/server
parent450d0b1ed437cf37b4309af952af8904f3f07768 (diff)
downloadNorthstarLauncher-2c889a0bc06b19f5842d002f5d671aaab8c3b419.tar.gz
NorthstarLauncher-2c889a0bc06b19f5842d002f5d671aaab8c3b419.zip
Extract ProcessConnectionlessPacket hook to separate file
Diffstat (limited to 'NorthstarDLL/server')
-rw-r--r--NorthstarDLL/server/servernethooks.cpp16
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)
+}