forked from R2Northstar/NorthstarLauncher
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose origin auth state and errors to squirrel (R2Northstar#468)
Also moves `NSIsMasterServerAuthenticated` out of `scriptserverbrowser.cpp` because it didn't really fit there This will be used for showing failed origin auth errors in the game's UI
- Loading branch information
1 parent
9d8bedf
commit c093ee1
Showing
5 changed files
with
61 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include "squirrel/squirrel.h" | ||
#include "masterserver/masterserver.h" | ||
#include "engine/r2engine.h" | ||
#include "client/r2client.h" | ||
|
||
ADD_SQFUNC("bool", NSIsMasterServerAuthenticated, "", "", ScriptContext::UI) | ||
{ | ||
g_pSquirrel<context>->pushbool(sqvm, g_pMasterServerManager->m_bOriginAuthWithMasterServerDone); | ||
return SQRESULT_NOTNULL; | ||
} | ||
|
||
/* | ||
global struct MasterServerAuthResult | ||
{ | ||
bool success | ||
string errorCode | ||
string errorMessage | ||
} | ||
*/ | ||
|
||
ADD_SQFUNC("MasterServerAuthResult", NSGetMasterServerAuthResult, "", "", ScriptContext::UI) | ||
{ | ||
g_pSquirrel<context>->pushnewstructinstance(sqvm, 3); | ||
|
||
g_pSquirrel<context>->pushbool(sqvm, g_pMasterServerManager->m_bOriginAuthWithMasterServerSuccessful); | ||
g_pSquirrel<context>->sealstructslot(sqvm, 0); | ||
|
||
g_pSquirrel<context>->pushstring(sqvm, g_pMasterServerManager->m_sOriginAuthWithMasterServerErrorCode.c_str(), -1); | ||
g_pSquirrel<context>->sealstructslot(sqvm, 1); | ||
|
||
g_pSquirrel<context>->pushstring(sqvm, g_pMasterServerManager->m_sOriginAuthWithMasterServerErrorMessage.c_str(), -1); | ||
g_pSquirrel<context>->sealstructslot(sqvm, 2); | ||
|
||
return SQRESULT_NOTNULL; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters