aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/clientauthhooks.cpp
diff options
context:
space:
mode:
authorEmma Miler <emma.pi@protonmail.com>2022-12-19 19:32:16 +0100
committerGitHub <noreply@github.com>2022-12-19 19:32:16 +0100
commite04f3b36accccb590a2d51b4829256b9964ac3fd (patch)
tree20ee30c82e6f53e6e772be2e1b9613eebca12bf3 /NorthstarDLL/clientauthhooks.cpp
parent33f18a735986dcd136bf8ba70ad8331306c28227 (diff)
downloadNorthstarLauncher-e04f3b36accccb590a2d51b4829256b9964ac3fd.tar.gz
NorthstarLauncher-e04f3b36accccb590a2d51b4829256b9964ac3fd.zip
Restructuring (#365)
* Remove launcher proxy * Restructuring * More restructuring * Fix include dirs * Fix merge * Remove clang thing * Filters * Oops
Diffstat (limited to 'NorthstarDLL/clientauthhooks.cpp')
-rw-r--r--NorthstarDLL/clientauthhooks.cpp64
1 files changed, 0 insertions, 64 deletions
diff --git a/NorthstarDLL/clientauthhooks.cpp b/NorthstarDLL/clientauthhooks.cpp
deleted file mode 100644
index cd01ad91..00000000
--- a/NorthstarDLL/clientauthhooks.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-#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;
-
-// clang-format off
-AUTOHOOK(AuthWithStryder, engine.dll + 0x1843A0,
-void, __fastcall, (void* a1))
-// clang-format on
-{
- // 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);
-}
-
-char* p3PToken;
-
-// clang-format off
-AUTOHOOK(Auth3PToken, engine.dll + 0x183760,
-char*, __fastcall, ())
-// clang-format on
-{
- if (g_pMasterServerManager->m_sOwnClientAuthToken[0])
- {
- memset(p3PToken, 0x0, 1024);
- strcpy(p3PToken, "Protocol 3: Protect the Pilot");
- }
-
- return Auth3PToken();
-}
-
-ON_DLL_LOAD_CLIENT_RELIESON("engine.dll", ClientAuthHooks, ConVar, (CModule module))
-{
- AUTOHOOK_DISPATCH()
-
- p3PToken = module.Offset(0x13979D80).As<char*>();
-
- // 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");
-}