aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/hoststate.cpp
diff options
context:
space:
mode:
authorEmma Miler <emma.pi@protonmail.com>2022-11-21 00:38:42 +0100
committerGitHub <noreply@github.com>2022-11-20 23:38:42 +0000
commit9e469ac28b610ecb8bce3e6c279660fae78861cf (patch)
tree57274f3be03cb160e42af7ed939274a2a028dbf0 /NorthstarDLL/hoststate.cpp
parent70b71ba3d3ad7121c6aabe55271542f55abe4008 (diff)
downloadNorthstarLauncher-9e469ac28b610ecb8bce3e6c279660fae78861cf.tar.gz
NorthstarLauncher-9e469ac28b610ecb8bce3e6c279660fae78861cf.zip
Squirrel bridge v3 (#310)
* Initial * Move squirrelmanager to virtual base class * Implement changes from code review * Formatting * Update squirrel.cpp * Formatting shit * Fix filters * Fix up Use new squirrel autobind syntax Move from `std::vector` to `std::queue` for message buffer Add `NSTestMessageBuffer` * Update squirrel.cpp * Update squirrel.h * Remove inline virtual final because this is stupid I probably had a bit of a brain fart when this was written * Moved to running ProcessMessages in-engine * Remove TestMessageBuffer * Formatting * Rename pushSQObject -> pushobject * Rename some stuff * Update squirrel.h * Formattting * Remove unneeded global access * Oops
Diffstat (limited to 'NorthstarDLL/hoststate.cpp')
-rw-r--r--NorthstarDLL/hoststate.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/NorthstarDLL/hoststate.cpp b/NorthstarDLL/hoststate.cpp
index c36af20c..24e4bf63 100644
--- a/NorthstarDLL/hoststate.cpp
+++ b/NorthstarDLL/hoststate.cpp
@@ -7,6 +7,7 @@
#include "tier0.h"
#include "r2engine.h"
#include "limits.h"
+#include "squirrel.h"
AUTOHOOK_INIT()
@@ -102,6 +103,16 @@ void, __fastcall, (CHostState* self, double flCurrentTime, float flFrameTime))
// update limits for frame
g_pServerLimits->RunFrame(flCurrentTime, flFrameTime);
}
+
+ // Run Squirrel message buffer
+ if (g_pSquirrel<ScriptContext::UI>->m_pSQVM != nullptr && g_pSquirrel<ScriptContext::UI>->m_pSQVM->sqvm != nullptr)
+ g_pSquirrel<ScriptContext::UI>->ProcessMessageBuffer();
+
+ if (g_pSquirrel<ScriptContext::CLIENT>->m_pSQVM != nullptr && g_pSquirrel<ScriptContext::CLIENT>->m_pSQVM->sqvm != nullptr)
+ g_pSquirrel<ScriptContext::CLIENT>->ProcessMessageBuffer();
+
+ if (g_pSquirrel<ScriptContext::SERVER>->m_pSQVM != nullptr && g_pSquirrel<ScriptContext::SERVER>->m_pSQVM->sqvm != nullptr)
+ g_pSquirrel<ScriptContext::SERVER>->ProcessMessageBuffer();
}
ON_DLL_LOAD_RELIESON("engine.dll", HostState, ConVar, (CModule module))