From f9bc3c9d1834cb8bd5f872b749b057c33e8b0102 Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Wed, 24 Aug 2022 00:32:31 +0100 Subject: Adjust folder structure (#242) * Adjust folder structure * change launcher directory name --- NorthstarDLL/scriptservertoclientstringcommand.cpp | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 NorthstarDLL/scriptservertoclientstringcommand.cpp (limited to 'NorthstarDLL/scriptservertoclientstringcommand.cpp') diff --git a/NorthstarDLL/scriptservertoclientstringcommand.cpp b/NorthstarDLL/scriptservertoclientstringcommand.cpp new file mode 100644 index 00000000..084db1e4 --- /dev/null +++ b/NorthstarDLL/scriptservertoclientstringcommand.cpp @@ -0,0 +1,24 @@ +#include "pch.h" +#include "scriptservertoclientstringcommand.h" +#include "squirrel.h" +#include "convar.h" +#include "concommand.h" + +void ConCommand_ns_script_servertoclientstringcommand(const CCommand& arg) +{ + if (g_ClientSquirrelManager->sqvm && + g_ClientSquirrelManager->setupfunc("NSClientCodeCallback_RecievedServerToClientStringCommand") != SQRESULT_ERROR) + { + g_ClientSquirrelManager->pusharg(arg.ArgS()); + g_ClientSquirrelManager->call(1); // todo: doesn't throw or log errors from within this, probably not great behaviour + } +} + +void InitialiseScriptServerToClientStringCommands(HMODULE baseAddress) +{ + RegisterConCommand( + "ns_script_servertoclientstringcommand", + ConCommand_ns_script_servertoclientstringcommand, + "", + FCVAR_CLIENTDLL | FCVAR_SERVER_CAN_EXECUTE); +} -- cgit v1.2.3