aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/client/clientauthhooks.cpp
diff options
context:
space:
mode:
authorJack <66967891+ASpoonPlaysGames@users.noreply.github.com>2023-12-14 12:00:26 +0000
committerGitHub <noreply@github.com>2023-12-14 13:00:26 +0100
commit0976a3500e6774258322ab2bc80ebd515c175e77 (patch)
tree8573693b05b741c9a988265bc137820f908c922e /NorthstarDLL/client/clientauthhooks.cpp
parent8a4107191b782d087a94511e9fb6f85fcb7c43d9 (diff)
downloadNorthstarLauncher-0976a3500e6774258322ab2bc80ebd515c175e77.tar.gz
NorthstarLauncher-0976a3500e6774258322ab2bc80ebd515c175e77.zip
Rework `-vanilla` to be a vanilla compatibility mode (#601)
Old `-vanilla` behaviour is now handled by `-nonorthstardll`. New squirrel constant called `VANILLA`. Set to true when in vanilla compatibility mode. Differences when in vanilla compatibility mode: - Doesn't restrict server commands (same as `-norestrictservercommands`) - Doesn't block FairFight screenshot functions - Doesn't do Atlas-related stuff (except for mainmenupromos)
Diffstat (limited to 'NorthstarDLL/client/clientauthhooks.cpp')
-rw-r--r--NorthstarDLL/client/clientauthhooks.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/NorthstarDLL/client/clientauthhooks.cpp b/NorthstarDLL/client/clientauthhooks.cpp
index e66da6c8..adb2ab22 100644
--- a/NorthstarDLL/client/clientauthhooks.cpp
+++ b/NorthstarDLL/client/clientauthhooks.cpp
@@ -1,6 +1,7 @@
#include "masterserver/masterserver.h"
#include "core/convar/convar.h"
#include "client/r2client.h"
+#include "core/vanilla.h"
AUTOHOOK_INIT()
@@ -16,6 +17,14 @@ AUTOHOOK(AuthWithStryder, engine.dll + 0x1843A0,
void, __fastcall, (void* a1))
// clang-format on
{
+ // don't attempt to do Atlas auth if we are in vanilla compatibility mode
+ // this prevents users from joining untrustworthy servers (unless they use a concommand or something)
+ if (g_pVanillaCompatibility->GetVanillaCompatibility())
+ {
+ AuthWithStryder(a1);
+ return;
+ }
+
// 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)
@@ -39,7 +48,7 @@ AUTOHOOK(Auth3PToken, engine.dll + 0x183760,
char*, __fastcall, ())
// clang-format on
{
- if (g_pMasterServerManager->m_sOwnClientAuthToken[0])
+ if (!g_pVanillaCompatibility->GetVanillaCompatibility() && g_pMasterServerManager->m_sOwnClientAuthToken[0])
{
memset(p3PToken, 0x0, 1024);
strcpy(p3PToken, "Protocol 3: Protect the Pilot");