aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/squirrel.h
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-19 03:13:28 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-19 03:13:28 +0000
commit75b9583a6b66c09596f4c0a25188ba4d99ca34da (patch)
tree4eef5ac3c28faa511d08be350f6bc028d5ebc290 /NorthstarDedicatedTest/squirrel.h
parent682a00eaac30139929b1bb179ae7f4aa1a038572 (diff)
downloadNorthstarLauncher-75b9583a6b66c09596f4c0a25188ba4d99ca34da.tar.gz
NorthstarLauncher-75b9583a6b66c09596f4c0a25188ba4d99ca34da.zip
openssl support
Diffstat (limited to 'NorthstarDedicatedTest/squirrel.h')
-rw-r--r--NorthstarDedicatedTest/squirrel.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/NorthstarDedicatedTest/squirrel.h b/NorthstarDedicatedTest/squirrel.h
index 50b4a19e..d02a0000 100644
--- a/NorthstarDedicatedTest/squirrel.h
+++ b/NorthstarDedicatedTest/squirrel.h
@@ -60,7 +60,7 @@ struct SQFuncRegistration
};
// core sqvm funcs
-typedef SQRESULT(*sq_compilebufferType)(void* sqvm, CompileBufferState* compileBuffer, const char* file, int a1, int a2);
+typedef SQRESULT(*sq_compilebufferType)(void* sqvm, CompileBufferState* compileBuffer, const char* file, int a1, ScriptContex a2);
extern sq_compilebufferType ClientSq_compilebuffer;
extern sq_compilebufferType ServerSq_compilebuffer;
@@ -126,7 +126,7 @@ typedef SQBool(*sq_getboolType)(void*, SQInteger stackpos);
extern sq_getboolType ClientSq_getbool;
extern sq_getboolType ServerSq_getbool;
-template<Context context> class SquirrelManager
+template<ScriptContex context> class SquirrelManager
{
private:
std::vector<SQFuncRegistration*> m_funcRegistrations;
@@ -148,7 +148,7 @@ public:
{
spdlog::info("Registering {} function {}", GetContextName(context), funcReg->squirrelFuncName);
- if (context == CLIENT || context == UI)
+ if (context == ScriptContex::CLIENT || context == ScriptContex::UI)
ClientRegisterSquirrelFunc(sqvm, funcReg, 1);
else
ServerRegisterSquirrelFunc(sqvm, funcReg, 1);
@@ -176,21 +176,21 @@ public:
CompileBufferState bufferState = CompileBufferState(strCode);
SQRESULT compileResult;
- if (context == CLIENT || context == UI)
+ if (context == ScriptContex::CLIENT || context == ScriptContex::UI)
compileResult = ClientSq_compilebuffer(sqvm2, &bufferState, "console", -1, context);
- else if (context == SERVER)
+ else if (context == ScriptContex::SERVER)
compileResult = ServerSq_compilebuffer(sqvm2, &bufferState, "console", -1, context);
spdlog::info("sq_compilebuffer returned {}", compileResult);
if (compileResult >= 0)
{
- if (context == CLIENT || context == UI)
+ if (context == ScriptContex::CLIENT || context == ScriptContex::UI)
{
ClientSq_pushroottable(sqvm2);
SQRESULT callResult = ClientSq_call(sqvm2, 1, false, false);
spdlog::info("sq_call returned {}", callResult);
}
- else if (context == SERVER)
+ else if (context == ScriptContex::SERVER)
{
ServerSq_pushroottable(sqvm2);
SQRESULT callResult = ServerSq_call(sqvm2, 1, false, false);
@@ -222,6 +222,6 @@ public:
}
};
-extern SquirrelManager<CLIENT>* g_ClientSquirrelManager;
-extern SquirrelManager<SERVER>* g_ServerSquirrelManager;
-extern SquirrelManager<UI>* g_UISquirrelManager; \ No newline at end of file
+extern SquirrelManager<ScriptContex::CLIENT>* g_ClientSquirrelManager;
+extern SquirrelManager<ScriptContex::SERVER>* g_ServerSquirrelManager;
+extern SquirrelManager<ScriptContex::UI>* g_UISquirrelManager; \ No newline at end of file