diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-12-20 21:18:55 +0000 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-12-20 21:18:55 +0000 |
commit | e2c028702096367c6d10f3659d4c11f598829e2c (patch) | |
tree | 5c552595b812ce2d6f2a412ee4cea5791bde95ef /NorthstarDedicatedTest/clientauthhooks.cpp | |
parent | 6cacfd312ad4f433fa5acd3e1dc6383ca5685211 (diff) | |
download | NorthstarLauncher-e2c028702096367c6d10f3659d4c11f598829e2c.tar.gz NorthstarLauncher-e2c028702096367c6d10f3659d4c11f598829e2c.zip |
auth fix and typo fix
Diffstat (limited to 'NorthstarDedicatedTest/clientauthhooks.cpp')
-rw-r--r-- | NorthstarDedicatedTest/clientauthhooks.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/NorthstarDedicatedTest/clientauthhooks.cpp b/NorthstarDedicatedTest/clientauthhooks.cpp index 889512a2..a139504d 100644 --- a/NorthstarDedicatedTest/clientauthhooks.cpp +++ b/NorthstarDedicatedTest/clientauthhooks.cpp @@ -11,15 +11,19 @@ AuthWithStryderType AuthWithStryder; ConVar* Cvar_ns_has_agreed_to_send_token; +// mirrored in script +const int NOT_DECIDED_TO_SEND_TOKEN = 0; +const int AGREED_TO_SEND_TOKEN = 1; +const int DISAGREED_TO_SEND_TOKEN = 2; + void AuthWithStryderHook(void* a1) { // game will call this forever, until it gets a valid auth key // so, we need to manually invalidate our key until we're authed with northstar, then we'll allow game to auth with stryder - - if (!g_MasterServerManager->m_bOriginAuthWithMasterServerDone) + if (!g_MasterServerManager->m_bOriginAuthWithMasterServerDone && Cvar_ns_has_agreed_to_send_token->m_nValue != DISAGREED_TO_SEND_TOKEN) { // if player has agreed to send token and we aren't already authing, try to auth - if (Cvar_ns_has_agreed_to_send_token->m_nValue && !g_MasterServerManager->m_bOriginAuthWithMasterServerInProgress) + if (Cvar_ns_has_agreed_to_send_token->m_nValue == AGREED_TO_SEND_TOKEN && !g_MasterServerManager->m_bOriginAuthWithMasterServerInProgress) g_MasterServerManager->AuthenticateOriginWithMasterServer(g_LocalPlayerUserID, g_LocalPlayerOriginToken); // invalidate key so auth will fail |