Пример #1
0
        public static bool Prefix(MultiplayerModeSelectionFlowCoordinator __instance, ConnectionFailedReason reason)
        {
            Plugin.Log.Warn($"Multiplayer connection failed, reason: {reason}");

            if (MpModeSelection.WeInitiatedConnection)
            {
                // We only take over error handling UI if we initiated the connection
                if (reason == ConnectionFailedReason.ConnectionCanceled)
                {
                    // ...and if it's just a self-cancel, return to the browser immediately.
                    MpModeSelection.CancelLobbyJoin();
                    MpModeSelection.MakeServerBrowserTopView();
                }
                else
                {
                    MpModeSelection.PresentConnectionFailedError
                    (
                        errorMessage: ConnectionErrorText.Generate(reason),
                        canRetry: reason != ConnectionFailedReason.InvalidPassword && reason != ConnectionFailedReason.VersionMismatch
                    );
                }
                return(false);
            }
            return(true);
        }
Пример #2
0
        internal static void Prefix(MultiplayerModeSelectionFlowCoordinator __instance, JoiningLobbyViewController ____joiningLobbyViewController, JoinQuickPlayViewController ____joinQuickPlayViewController)
        {
            GameClassInstanceProvider classInstanceProvider = GameClassInstanceProvider.Instance;

            classInstanceProvider.MultiplayerModeSelectionFlowCoordinator = __instance;
            classInstanceProvider.JoinQuickPlayViewController             = ____joinQuickPlayViewController;
            classInstanceProvider.JoiningLobbyViewController = ____joiningLobbyViewController;
        }
        public static void SetUp()
        {
            _flowCoordinator = Resources.FindObjectsOfTypeAll <MultiplayerModeSelectionFlowCoordinator>().First();

            _mpLobbyConnectionController      = ReflectionUtil.GetField <MultiplayerLobbyConnectionController, MultiplayerModeSelectionFlowCoordinator>(_flowCoordinator, "_multiplayerLobbyConnectionController");
            _joiningLobbyViewController       = ReflectionUtil.GetField <JoiningLobbyViewController, MultiplayerModeSelectionFlowCoordinator>(_flowCoordinator, "_joiningLobbyViewController");
            _simpleDialogPromptViewController = ReflectionUtil.GetField <SimpleDialogPromptViewController, MultiplayerModeSelectionFlowCoordinator>(_flowCoordinator, "_simpleDialogPromptViewController");
        }
Пример #4
0
        public static bool Prefix(MultiplayerModeSelectionFlowCoordinator __instance, ConnectionFailedReason reason)
        {
            Plugin.Log.Warn($"Multiplayer connection failed, reason: {reason}");

            if (MpModeSelection.WeInitiatedConnection)
            {
                // We only take over error handling UI if we initiated the connection
                MpModeSelection.PresentConnectionError(reason);
                return(false);
            }

            return(true);
        }
        public static bool Prefix(MultiplayerModeSelectionFlowCoordinator __instance, MultiplayerModeSelectionViewController viewController, MultiplayerModeSelectionViewController.MenuButton menuButton)
        {
            // Make sure any overrides are cleared when we're going to connect or host
            MpConnect.ClearMasterServerOverride();

            if (menuButton == MenuButton.GameBrowser)
            {
                // When the "GameBrowser" button is clicked, bypass the game's own incomplete code & open our view instead
                PluginUi.LaunchServerBrowser();
                return(false);
            }
            else
            {
                // Going to a non-serverbrowser part of the online menu
                MpModeSelection.WeInitiatedConnection = false;
            }

            return(true);
        }
Пример #6
0
 public static void SetUp()
 {
     _flowCoordinator = Resources.FindObjectsOfTypeAll <MultiplayerModeSelectionFlowCoordinator>().First();
 }