From 9e469ac28b610ecb8bce3e6c279660fae78861cf Mon Sep 17 00:00:00 2001 From: Emma Miler Date: Mon, 21 Nov 2022 00:38:42 +0100 Subject: 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 --- NorthstarDLL/scriptservertoclientstringcommand.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'NorthstarDLL/scriptservertoclientstringcommand.cpp') diff --git a/NorthstarDLL/scriptservertoclientstringcommand.cpp b/NorthstarDLL/scriptservertoclientstringcommand.cpp index 5c116973..ac19c3af 100644 --- a/NorthstarDLL/scriptservertoclientstringcommand.cpp +++ b/NorthstarDLL/scriptservertoclientstringcommand.cpp @@ -5,14 +5,8 @@ void ConCommand_ns_script_servertoclientstringcommand(const CCommand& arg) { - if (g_pSquirrel->m_pSQVM && - g_pSquirrel->setupfunc("NSClientCodeCallback_RecievedServerToClientStringCommand") != SQRESULT_ERROR) - { - g_pSquirrel->pushstring(g_pSquirrel->m_pSQVM->sqvm, arg.ArgS()); - g_pSquirrel->call( - g_pSquirrel->m_pSQVM->sqvm, - 1); // todo: doesn't throw or log errors from within this, probably not great behaviour - } + if (g_pSquirrel->m_pSQVM) + g_pSquirrel->Call("NSClientCodeCallback_RecievedServerToClientStringCommand", arg.ArgS()); } ON_DLL_LOAD_CLIENT_RELIESON("client.dll", ScriptServerToClientStringCommand, ClientSquirrel, (CModule module)) -- cgit v1.2.3