From 0976a3500e6774258322ab2bc80ebd515c175e77 Mon Sep 17 00:00:00 2001 From: Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> Date: Thu, 14 Dec 2023 12:00:26 +0000 Subject: 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) --- NorthstarDLL/client/clientauthhooks.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'NorthstarDLL/client') 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"); -- cgit v1.2.3