Skip to content

Commit

Permalink
Fix joining by code
Browse files Browse the repository at this point in the history
  • Loading branch information
js6pak committed Oct 6, 2023
1 parent ac2f1c4 commit 3cc0123
Showing 1 changed file with 41 additions and 15 deletions.
56 changes: 41 additions & 15 deletions Reactor.RemoveAccounts/FunctionalPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
{
Expand All @@ -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
{
Expand All @@ -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
{
Expand Down

0 comments on commit 3cc0123

Please sign in to comment.