From df8c4b26e7727dd45c244f25304d2a35c66bffa6 Mon Sep 17 00:00:00 2001 From: F1F7Y <64418963+F1F7Y@users.noreply.github.com> Date: Thu, 16 Jun 2022 00:35:12 +0200 Subject: Expose IsDedicated on server vm (#179) --- NorthstarDedicatedTest/miscserverscript.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 -- cgit v1.2.3