aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorF1F7Y <64418963+F1F7Y@users.noreply.github.com>2022-06-16 00:35:12 +0200
committerGitHub <noreply@github.com>2022-06-16 00:35:12 +0200
commitdf8c4b26e7727dd45c244f25304d2a35c66bffa6 (patch)
treef0691f9558825eeae63d5afe69b262385a3a77dd
parent93f10fd55c5ff6f6cebb82601ff850d11f92a840 (diff)
downloadNorthstarLauncher-df8c4b26e7727dd45c244f25304d2a35c66bffa6.tar.gz
NorthstarLauncher-df8c4b26e7727dd45c244f25304d2a35c66bffa6.zip
Expose IsDedicated on server vm (#179)
-rw-r--r--NorthstarDedicatedTest/miscserverscript.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/NorthstarDedicatedTest/miscserverscript.cpp b/NorthstarDedicatedTest/miscserverscript.cpp
index b2bf52ec..3b06ca10 100644
--- a/NorthstarDedicatedTest/miscserverscript.cpp
+++ b/NorthstarDedicatedTest/miscserverscript.cpp
@@ -4,6 +4,7 @@
#include "masterserver.h"
#include "serverauthentication.h"
#include "gameutils.h"
+#include "dedicated.h"
// annoying helper function because i can't figure out getting players or entities from sqvm rn
// wish i didn't have to do it like this, but here we are
@@ -57,10 +58,19 @@ SQRESULT SQ_IsPlayerIndexLocalPlayer(void* sqvm)
return SQRESULT_NOTNULL;
}
+// bool function NSIsDedicated()
+
+SQRESULT SQ_IsDedicated(void* sqvm)
+{
+ ServerSq_pushbool(sqvm, IsDedicated());
+ return SQRESULT_NOTNULL;
+}
+
void InitialiseMiscServerScriptCommand(HMODULE baseAddress)
{
g_ServerSquirrelManager->AddFuncRegistration(
"void", "NSEarlyWritePlayerIndexPersistenceForLeave", "int playerIndex", "", SQ_EarlyWritePlayerIndexPersistenceForLeave);
g_ServerSquirrelManager->AddFuncRegistration("bool", "NSIsWritingPlayerPersistence", "", "", SQ_IsWritingPlayerPersistence);
g_ServerSquirrelManager->AddFuncRegistration("bool", "NSIsPlayerIndexLocalPlayer", "int playerIndex", "", SQ_IsPlayerIndexLocalPlayer);
+ g_ServerSquirrelManager->AddFuncRegistration("bool", "NSIsDedicated", "", "", SQ_IsDedicated);
} \ No newline at end of file