aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/miscserverscript.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-05-09 16:42:33 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-05-09 16:42:33 +0100
commit5a58dd1c05e943d6b440bea5b4a6ae80ce16841e (patch)
tree9ea18142c2e2885b990671c04db4786aa05f86f3 /NorthstarDedicatedTest/miscserverscript.cpp
parent77a1195d77034c00959dfd030e2eb7a57d58a88d (diff)
downloadNorthstarLauncher-5a58dd1c05e943d6b440bea5b4a6ae80ce16841e.tar.gz
NorthstarLauncher-5a58dd1c05e943d6b440bea5b4a6ae80ce16841e.zip
refactor some squirrel stuff and ingame compilation error message
Diffstat (limited to 'NorthstarDedicatedTest/miscserverscript.cpp')
-rw-r--r--NorthstarDedicatedTest/miscserverscript.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/NorthstarDedicatedTest/miscserverscript.cpp b/NorthstarDedicatedTest/miscserverscript.cpp
index 3c32ad1c..5d346b2a 100644
--- a/NorthstarDedicatedTest/miscserverscript.cpp
+++ b/NorthstarDedicatedTest/miscserverscript.cpp
@@ -22,12 +22,12 @@ void* GetPlayerByIndex(int playerIndex)
// void function NSEarlyWritePlayerIndexPersistenceForLeave( int playerIndex )
SQRESULT SQ_EarlyWritePlayerIndexPersistenceForLeave(void* sqvm)
{
- int playerIndex = g_ServerSquirrelManager->sq_getinteger(sqvm, 1);
+ int playerIndex = g_pServerSquirrel->sq_getinteger(sqvm, 1);
void* player = GetPlayerByIndex(playerIndex);
if (!g_ServerAuthenticationManager->m_additionalPlayerData.count(player))
{
- g_ServerSquirrelManager->sq_raiseerror(sqvm, fmt::format("Invalid playerindex {}", playerIndex).c_str());
+ g_pServerSquirrel->sq_raiseerror(sqvm, fmt::format("Invalid playerindex {}", playerIndex).c_str());
return SQRESULT_ERROR;
}
@@ -39,29 +39,29 @@ SQRESULT SQ_EarlyWritePlayerIndexPersistenceForLeave(void* sqvm)
// bool function NSIsWritingPlayerPersistence()
SQRESULT SQ_IsWritingPlayerPersistence(void* sqvm)
{
- g_ServerSquirrelManager->sq_pushbool(sqvm, g_MasterServerManager->m_bSavingPersistentData);
+ g_pServerSquirrel->sq_pushbool(sqvm, g_MasterServerManager->m_bSavingPersistentData);
return SQRESULT_NOTNULL;
}
// bool function NSIsPlayerIndexLocalPlayer( int playerIndex )
SQRESULT SQ_IsPlayerIndexLocalPlayer(void* sqvm)
{
- int playerIndex = g_ServerSquirrelManager->sq_getinteger(sqvm, 1);
+ int playerIndex = g_pServerSquirrel->sq_getinteger(sqvm, 1);
void* player = GetPlayerByIndex(playerIndex);
if (!g_ServerAuthenticationManager->m_additionalPlayerData.count(player))
{
- g_ServerSquirrelManager->sq_raiseerror(sqvm, fmt::format("Invalid playerindex {}", playerIndex).c_str());
+ g_pServerSquirrel->sq_raiseerror(sqvm, fmt::format("Invalid playerindex {}", playerIndex).c_str());
return SQRESULT_ERROR;
}
- g_ServerSquirrelManager->sq_pushbool(sqvm, !strcmp(g_LocalPlayerUserID, (char*)player + 0xF500));
+ g_pServerSquirrel->sq_pushbool(sqvm, !strcmp(g_LocalPlayerUserID, (char*)player + 0xF500));
return SQRESULT_NOTNULL;
}
ON_DLL_LOAD_RELIESON("server.dll", MiscServerScriptCommands, ServerSquirrel, (HMODULE baseAddress)
{
- g_ServerSquirrelManager->AddFuncRegistration(
+ g_pServerSquirrel->AddFuncRegistration(
"void", "NSEarlyWritePlayerIndexPersistenceForLeave", "int playerIndex", "", SQ_EarlyWritePlayerIndexPersistenceForLeave);
- g_ServerSquirrelManager->AddFuncRegistration("bool", "NSIsWritingPlayerPersistence", "", "", SQ_IsWritingPlayerPersistence);
- g_ServerSquirrelManager->AddFuncRegistration("bool", "NSIsPlayerIndexLocalPlayer", "int playerIndex", "", SQ_IsPlayerIndexLocalPlayer);
+ g_pServerSquirrel->AddFuncRegistration("bool", "NSIsWritingPlayerPersistence", "", "", SQ_IsWritingPlayerPersistence);
+ g_pServerSquirrel->AddFuncRegistration("bool", "NSIsPlayerIndexLocalPlayer", "int playerIndex", "", SQ_IsPlayerIndexLocalPlayer);
}) \ No newline at end of file