From 3cc012398548cd5d1f18c4a907c63a8407661735 Mon Sep 17 00:00:00 2001 From: js6pak Date: Fri, 6 Oct 2023 16:15:31 +0200 Subject: [PATCH] Fix joining by code --- Reactor.RemoveAccounts/FunctionalPatches.cs | 56 +++++++++++++++------ 1 file changed, 41 insertions(+), 15 deletions(-) diff --git a/Reactor.RemoveAccounts/FunctionalPatches.cs b/Reactor.RemoveAccounts/FunctionalPatches.cs index 78cd341..edfc3bd 100644 --- a/Reactor.RemoveAccounts/FunctionalPatches.cs +++ b/Reactor.RemoveAccounts/FunctionalPatches.cs @@ -21,21 +21,7 @@ public static MethodBase TargetMethod() public static bool Prefix(ref bool __result) { - var eosManager = EOSManager.Instance; - - DataManager.Player.Account.LoginStatus = EOSManager.AccountLoginStatus.LoggedIn; - DataManager.Settings.Multiplayer.ChatMode = QuickChatModes.FreeChatOrQuickChat; - DataManager.Player.Onboarding.LastAcceptedPrivacyPolicyVersion = Constants.PrivacyPolicyVersion; - - eosManager.userId = new ProductUserId(); - - eosManager.hasRunLoginFlow = true; - eosManager.loginFlowFinished = true; - - AccountManager.Instance.privacyPolicyBg.gameObject.SetActive(false); - eosManager.CloseStartupWaitScreen(); - eosManager.HideCallbackWaitAnim(); - eosManager.IsAllowedOnline(true); + EOSManager.Instance.IsAllowedOnline(true); __result = false; return false; @@ -54,10 +40,31 @@ public static bool Prefix(EOSManager __instance) __instance.platformInitialized = true; _localUserIdProperty?.SetValue(null, new EpicAccountId()); + + DataManager.Player.Account.LoginStatus = EOSManager.AccountLoginStatus.LoggedIn; + DataManager.Settings.Multiplayer.ChatMode = QuickChatModes.FreeChatOrQuickChat; + DataManager.Player.Onboarding.LastAcceptedPrivacyPolicyVersion = Constants.PrivacyPolicyVersion; + + __instance.userId = new ProductUserId(); + + __instance.hasRunLoginFlow = true; + __instance.loginFlowFinished = true; + return false; } } + [HarmonyPatch(typeof(AccountManager), nameof(AccountManager.OnSceneLoaded))] + public static class AccountManagerOnSceneLoadedPatch + { + public static void Postfix(AccountManager __instance) + { + __instance.privacyPolicyBg.gameObject.SetActive(false); + __instance.waitingText.gameObject.SetActive(false); + __instance.postLoadWaiting.gameObject.SetActive(false); + } + } + [HarmonyPatch(typeof(EOSManager), nameof(EOSManager.ContinueInOfflineMode))] public static class ContinueInOfflineModePatch { @@ -67,6 +74,15 @@ public static bool Prefix() } } + [HarmonyPatch(typeof(EOSManager), nameof(EOSManager.LoginWithCorrectPlatform))] + public static class LoginWithCorrectPlatformPatch + { + public static bool Prefix() + { + return false; + } + } + [HarmonyPatch(typeof(AccountManager), nameof(AccountManager.CanPlayOnline))] public static class CanPlayOnlinePatch { @@ -77,6 +93,16 @@ public static bool Prefix(out bool __result) } } + [HarmonyPatch(typeof(EOSManager), nameof(EOSManager.HasFinishedLoginFlow))] + public static class HasFinishedLoginFlowPatch + { + public static bool Prefix(out bool __result) + { + __result = true; + return false; + } + } + [HarmonyPatch(typeof(EOSManager), nameof(EOSManager.ProductUserId), MethodType.Getter)] public static class ProductUserIdOverride {