public static void PresentConnectionError(ConnectionFailedReason reason)
        {
            _mpLobbyConnectionController.LeaveLobby();
            _joiningLobbyViewController.HideLoading();

            if (reason != ConnectionFailedReason.ConnectionCanceled)
            {
                var canRetry = (LastConnectToHostedGame != null &&
                                reason != ConnectionFailedReason.InvalidPassword &&
                                reason != ConnectionFailedReason.VersionMismatch);

                _simpleDialogPromptViewController.Init("Connection failed", ConnectionErrorText.Generate(reason), "Back to browser", canRetry ? "Retry connection" : null, delegate(int btnId)
                {
                    switch (btnId)
                    {
                    default:
                    case 0:     // Back to browser
                        ReplaceTopViewController(PluginUi.ServerBrowserViewController, null, ViewController.AnimationType.In, ViewController.AnimationDirection.Vertical);
                        break;

                    case 1:     // Retry connection
                        ConnectToHostedGame(LastConnectToHostedGame);
                        break;
                    }
                });
                ReplaceTopViewController(_simpleDialogPromptViewController, null, ViewController.AnimationType.In, ViewController.AnimationDirection.Vertical);
            }
            else
            {
                ReplaceTopViewController(PluginUi.ServerBrowserViewController, null, ViewController.AnimationType.In, ViewController.AnimationDirection.Vertical);
            }
        }
 public static void CancelLobbyJoin()
 {
     _mpLobbyConnectionController.LeaveLobby();
     _joiningLobbyViewController.HideLoading();
 }