aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/miscserverscript.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-10-19 20:22:04 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-10-19 20:22:04 +0100
commit48acde84bd58c82eaa3a9838757dfcd05ab4ebf5 (patch)
tree429dd17294784175cce59b01ba071c728b3eabd1 /NorthstarDedicatedTest/miscserverscript.cpp
parented7e4fed4ddedaf9d4c181052ca552a0914d57bb (diff)
downloadNorthstarLauncher-48acde84bd58c82eaa3a9838757dfcd05ab4ebf5.tar.gz
NorthstarLauncher-48acde84bd58c82eaa3a9838757dfcd05ab4ebf5.zip
add reconnecting to local lobby with auth on leave
Diffstat (limited to 'NorthstarDedicatedTest/miscserverscript.cpp')
-rw-r--r--NorthstarDedicatedTest/miscserverscript.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/NorthstarDedicatedTest/miscserverscript.cpp b/NorthstarDedicatedTest/miscserverscript.cpp
index dd4c7101..bc4b43c0 100644
--- a/NorthstarDedicatedTest/miscserverscript.cpp
+++ b/NorthstarDedicatedTest/miscserverscript.cpp
@@ -19,7 +19,7 @@ void* GetPlayerByIndex(int playerIndex)
}
// void function NSEarlyWritePlayerIndexPersistenceForLeave( int playerIndex )
-SQInteger SQ_EarlyWritePlayerIndexPersistenceForLeave(void* sqvm)
+SQRESULT SQ_EarlyWritePlayerIndexPersistenceForLeave(void* sqvm)
{
int playerIndex = ServerSq_getinteger(sqvm, 1);
void* player = GetPlayerByIndex(playerIndex);
@@ -27,34 +27,34 @@ SQInteger SQ_EarlyWritePlayerIndexPersistenceForLeave(void* sqvm)
if (!g_ServerAuthenticationManager->m_additionalPlayerData.count(player))
{
ServerSq_pusherror(sqvm, fmt::format("Invalid playerindex {}", playerIndex).c_str());
- return -1;
+ return SQRESULT_ERROR;
}
g_ServerAuthenticationManager->m_additionalPlayerData[player].needPersistenceWriteOnLeave = false;
g_ServerAuthenticationManager->WritePersistentData(player);
- return 0;
+ return SQRESULT_NULL;
}
// bool function NSIsWritingPlayerPersistence()
-SQInteger SQ_IsWritingPlayerPersistence(void* sqvm)
+SQRESULT SQ_IsWritingPlayerPersistence(void* sqvm)
{
ServerSq_pushbool(sqvm, g_MasterServerManager->m_savingPersistentData);
- return 1;
+ return SQRESULT_NOTNULL;
}
// bool function NSIsPlayerIndexLocalPlayer( int playerIndex )
-SQInteger SQ_IsPlayerIndexLocalPlayer(void* sqvm)
+SQRESULT SQ_IsPlayerIndexLocalPlayer(void* sqvm)
{
int playerIndex = ServerSq_getinteger(sqvm, 1);
void* player = GetPlayerByIndex(playerIndex);
if (!g_ServerAuthenticationManager->m_additionalPlayerData.count(player))
{
ServerSq_pusherror(sqvm, fmt::format("Invalid playerindex {}", playerIndex).c_str());
- return -1;
+ return SQRESULT_ERROR;
}
ServerSq_pushbool(sqvm, !strcmp(g_LocalPlayerUserID, (char*)player + 0xF500));
- return 1;
+ return SQRESULT_NOTNULL;
}
void InitialiseMiscServerScriptCommand(HMODULE baseAddress)