aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-01-09 03:29:56 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-01-09 03:29:56 +0000
commit99d58d760032ff89ff91df9afc58e23b50c011b9 (patch)
tree9a76211e31cc16366fc44fb7c07ef705231b5793 /NorthstarDedicatedTest
parent2d31b6857683719e38d05052a11e1eff67807df9 (diff)
downloadNorthstarLauncher-99d58d760032ff89ff91df9afc58e23b50c011b9.tar.gz
NorthstarLauncher-99d58d760032ff89ff91df9afc58e23b50c011b9.zip
restrict netchan limit checks to serverside calls only
Diffstat (limited to 'NorthstarDedicatedTest')
-rw-r--r--NorthstarDedicatedTest/gameutils.cpp2
-rw-r--r--NorthstarDedicatedTest/gameutils.h3
-rw-r--r--NorthstarDedicatedTest/serverauthentication.cpp2
3 files changed, 6 insertions, 1 deletions
diff --git a/NorthstarDedicatedTest/gameutils.cpp b/NorthstarDedicatedTest/gameutils.cpp
index 1cbd8648..59f85194 100644
--- a/NorthstarDedicatedTest/gameutils.cpp
+++ b/NorthstarDedicatedTest/gameutils.cpp
@@ -45,6 +45,7 @@ ConVar* Cvar_communities_hostname;
ErrorType Error;
CommandLineType CommandLine;
Plat_FloatTimeType Plat_FloatTime;
+ThreadInServerFrameThreadType ThreadInServerFrameThread;
void InitialiseEngineGameUtilFunctions(HMODULE baseAddress)
{
@@ -106,4 +107,5 @@ void InitialiseTier0GameUtilFunctions(HMODULE baseAddress)
Error = reinterpret_cast<ErrorType>(GetProcAddress(baseAddress, "Error"));
CommandLine = reinterpret_cast<CommandLineType>(GetProcAddress(baseAddress, "CommandLine"));
Plat_FloatTime = reinterpret_cast<Plat_FloatTimeType>(GetProcAddress(baseAddress, "Plat_FloatTime"));
+ ThreadInServerFrameThread = reinterpret_cast<ThreadInServerFrameThreadType>(GetProcAddress(baseAddress, "ThreadInServerFrameThread"));
} \ No newline at end of file
diff --git a/NorthstarDedicatedTest/gameutils.h b/NorthstarDedicatedTest/gameutils.h
index 43f387d1..ff6a0fbf 100644
--- a/NorthstarDedicatedTest/gameutils.h
+++ b/NorthstarDedicatedTest/gameutils.h
@@ -234,6 +234,9 @@ extern CommandLineType CommandLine;
typedef double(*Plat_FloatTimeType)();
extern Plat_FloatTimeType Plat_FloatTime;
+typedef bool(*ThreadInServerFrameThreadType)();
+extern ThreadInServerFrameThreadType ThreadInServerFrameThread;
+
void InitialiseEngineGameUtilFunctions(HMODULE baseAddress);
void InitialiseServerGameUtilFunctions(HMODULE baseAddress);
void InitialiseTier0GameUtilFunctions(HMODULE baseAddress); \ No newline at end of file
diff --git a/NorthstarDedicatedTest/serverauthentication.cpp b/NorthstarDedicatedTest/serverauthentication.cpp
index da84280c..4e3446c2 100644
--- a/NorthstarDedicatedTest/serverauthentication.cpp
+++ b/NorthstarDedicatedTest/serverauthentication.cpp
@@ -342,7 +342,7 @@ char __fastcall CNetChan___ProcessMessagesHook(void* self, void* buf)
char ret = CNetChan___ProcessMessages(self, buf);
// check processing limits, unless we're in a level transition
- if (g_pHostState->m_iCurrentState == HostState_t::HS_RUN)
+ if (g_pHostState->m_iCurrentState == HostState_t::HS_RUN && ThreadInServerFrameThread())
{
// player that sent the message
void* sender = *(void**)((char*)self + 368);