aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/clientauthhooks.cpp
diff options
context:
space:
mode:
authorBobTheBob9 <for.oliver.kirkham@gmail.com>2022-08-16 01:12:59 +0100
committerBobTheBob9 <for.oliver.kirkham@gmail.com>2022-08-16 01:12:59 +0100
commit082f3893215797268d7ac8c1000ebe371f276af7 (patch)
treeb5cc677a49635a9244559e235d4915c064c9f6c4 /NorthstarDLL/clientauthhooks.cpp
parentb30a385fc25dad05e568ae8538f5aa3656c5c8d4 (diff)
downloadNorthstarLauncher-082f3893215797268d7ac8c1000ebe371f276af7.tar.gz
NorthstarLauncher-082f3893215797268d7ac8c1000ebe371f276af7.zip
lots of stuff idk
Diffstat (limited to 'NorthstarDLL/clientauthhooks.cpp')
-rw-r--r--NorthstarDLL/clientauthhooks.cpp88
1 files changed, 44 insertions, 44 deletions
diff --git a/NorthstarDLL/clientauthhooks.cpp b/NorthstarDLL/clientauthhooks.cpp
index 6d642bc2..3f3ace8e 100644
--- a/NorthstarDLL/clientauthhooks.cpp
+++ b/NorthstarDLL/clientauthhooks.cpp
@@ -1,44 +1,44 @@
-#include "pch.h"
-#include "masterserver.h"
-#include "convar.h"
-#include "r2client.h"
-
-AUTOHOOK_INIT()
-
-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;
-
-AUTOHOOK(AuthWithStryder, engine.dll + 0x1843A0,
-void,, (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_pMasterServerManager->m_bOriginAuthWithMasterServerDone && Cvar_ns_has_agreed_to_send_token->GetInt() != 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->GetInt() == AGREED_TO_SEND_TOKEN &&
- !g_pMasterServerManager->m_bOriginAuthWithMasterServerInProgress)
- g_pMasterServerManager->AuthenticateOriginWithMasterServer(R2::g_pLocalPlayerUserID, R2::g_pLocalPlayerOriginToken);
-
- // invalidate key so auth will fail
- *R2::g_pLocalPlayerOriginToken = 0;
- }
-
- AuthWithStryder(a1);
-}
-
-ON_DLL_LOAD_CLIENT_RELIESON("engine.dll", ClientAuthHooks, ConVar, (CModule module))
-{
- AUTOHOOK_DISPATCH()
-
- // this cvar will save to cfg once initially agreed with
- Cvar_ns_has_agreed_to_send_token = new ConVar(
- "ns_has_agreed_to_send_token",
- "0",
- FCVAR_ARCHIVE_PLAYERPROFILE,
- "whether the user has agreed to send their origin token to the northstar masterserver");
-} \ No newline at end of file
+#include "pch.h"
+#include "masterserver.h"
+#include "convar.h"
+#include "r2client.h"
+
+AUTOHOOK_INIT()
+
+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;
+
+AUTOHOOK(AuthWithStryder, engine.dll + 0x1843A0,
+void,, (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_pMasterServerManager->m_bOriginAuthWithMasterServerDone && Cvar_ns_has_agreed_to_send_token->GetInt() != 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->GetInt() == AGREED_TO_SEND_TOKEN &&
+ !g_pMasterServerManager->m_bOriginAuthWithMasterServerInProgress)
+ g_pMasterServerManager->AuthenticateOriginWithMasterServer(R2::g_pLocalPlayerUserID, R2::g_pLocalPlayerOriginToken);
+
+ // invalidate key so auth will fail
+ *R2::g_pLocalPlayerOriginToken = 0;
+ }
+
+ AuthWithStryder(a1);
+}
+
+ON_DLL_LOAD_CLIENT_RELIESON("engine.dll", ClientAuthHooks, ConVar, (CModule module))
+{
+ AUTOHOOK_DISPATCH()
+
+ // this cvar will save to cfg once initially agreed with
+ Cvar_ns_has_agreed_to_send_token = new ConVar(
+ "ns_has_agreed_to_send_token",
+ "0",
+ FCVAR_ARCHIVE_PLAYERPROFILE,
+ "whether the user has agreed to send their origin token to the northstar masterserver");
+}