diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-05-09 03:59:56 +0100 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-05-09 03:59:56 +0100 |
commit | 77a1195d77034c00959dfd030e2eb7a57d58a88d (patch) | |
tree | 660a0ce48a7c161abb091872db5260d01671a5a1 /NorthstarDedicatedTest/squirrel.cpp | |
parent | 037113d4b8032cd3715d879c2f4b08f66fa2be43 (diff) | |
download | NorthstarLauncher-77a1195d77034c00959dfd030e2eb7a57d58a88d.tar.gz NorthstarLauncher-77a1195d77034c00959dfd030e2eb7a57d58a88d.zip |
get rid of context file
Diffstat (limited to 'NorthstarDedicatedTest/squirrel.cpp')
-rw-r--r-- | NorthstarDedicatedTest/squirrel.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/NorthstarDedicatedTest/squirrel.cpp b/NorthstarDedicatedTest/squirrel.cpp index 1e405e29..1772bdb8 100644 --- a/NorthstarDedicatedTest/squirrel.cpp +++ b/NorthstarDedicatedTest/squirrel.cpp @@ -44,6 +44,32 @@ SquirrelManager<ScriptContext::CLIENT>* g_ClientSquirrelManager; SquirrelManager<ScriptContext::SERVER>* g_ServerSquirrelManager; SquirrelManager<ScriptContext::UI>* g_UISquirrelManager; +template <ScriptContext context> SquirrelManager<context>* GetSquirrelManager() +{ + switch (context) + { + case ScriptContext::CLIENT: + return g_ClientSquirrelManager; + case ScriptContext::SERVER: + return g_ServerSquirrelManager; + case ScriptContext::UI: + return g_UISquirrelManager; + } +} + +const char* GetContextName(ScriptContext context) +{ + switch (context) + { + case ScriptContext::CLIENT: + return "CLIENT"; + case ScriptContext::SERVER: + return "SERVER"; + case ScriptContext::UI: + return "UI"; + } +} + ON_DLL_LOAD_RELIESON("client.dll", ClientSquirrel, ConCommand, (HMODULE baseAddress) { HookEnabler hook; |