Exemple #1
0
    void OnSearchingInvitedGame(int clientJoinRequestId, string invitingPrimaryKey)
    {
        //Popup.Show( TextDatabase.instance[0109061], "Searching for a suitable game...", "Cancel", OnMessageBoxEvent );
        m_MessageBox =
            (GuiPopupMessageBox)
            Owner.ShowPopup("MessageBox",
                            TextDatabase.instance[0109061],
                            TextDatabase.instance[0109058],
                            (inPopup, inResult) =>
        {
            //inPopup.ForceClose();
            m_MessageBox = null;

            if (inResult == E_PopupResultCode.Ok)
            {
                //FIXME We do not have the id now on the client side. Reimplement later.
                // The problem here is that this client does not pass any information to the lobby.
                // All the communication happens between the master (inviter) and the lobby. The childs (friends) receives just the OnSearchingInvitedGame a notification.
                LobbyClient.CancelFindServer(-1);

                UpdateStatus(m_Master, false);
                LeaveGang(m_Master);
            }
        });
        m_MessageBox.SetButtonText(TextDatabase.instance[02040009]);
    }
Exemple #2
0
    void OnNoServerAvailable(int clientJoinRequestId)
    {
        if (m_MessageBox == null || m_MessageBox.IsVisible == false)
        {
            return;
        }

        m_MessageBox.SetText(TextDatabase.instance[0109055]);
        m_MessageBox.SetButtonText(TextDatabase.instance[02040007]);
        m_MessageBox = null;

        LeaveGang(m_Master);
    }
        //-------------------------------------------------------------------------------------------------------------
        public static void Show(string caption, string message, string button, PopupHandler handler)
        {
            m_Popup   = GuiBaseUtils.ShowMessageBox(caption, message, OnResult) as GuiPopupMessageBox;
            m_Handler = null;

            if (m_Popup == null)
            {
                return;
            }

            if ((button != null) && (button.Length > 0))
            {
                m_Popup.SetButtonVisible(true);
                m_Popup.SetButtonText(button);
            }
            else
            {
                m_Popup.SetButtonVisible(false);
            }

            m_Handler = handler;
        }
    IEnumerator UpdateProfile_Coroutine()
    {
        // show message box with some info
        GuiPopupMessageBox msgbox =
            Owner.ShowPopup("MessageBox", TextDatabase.instance[0107000], TextDatabase.instance[0107022]) as GuiPopupMessageBox;

        msgbox.SetButtonVisible(false);

        // update profile
        UpdateMFAccountAndFetchPPI action = CloudUser.instance.UpdateUser(m_Password1Hash,
                                                                          GuiBaseUtils.FixNickname(m_Nickname, CloudUser.instance.userName_TODO),
                                                                          null,
                                                                          m_ReceiveNews,
                                                                          m_Region);

        while (action.isDone == false)
        {
            yield return(new WaitForSeconds(0.2f));
        }

        if (action.isSucceeded == true)
        {
            // update cloud user with actual informations
            string username   = "";
            string nickname   = "";
            string password   = "";
            int    pwdLength  = 0;
            bool   rememberMe = true;
            bool   autoLogin  = true;
            CloudUser.instance.GetLoginData(ref nickname, ref username, ref password, ref pwdLength, ref rememberMe, ref autoLogin);
            CloudUser.instance.SetLoginData(CloudUser.instance.primaryKey,
                                            m_Nickname,
                                            username,
                                            m_Password1Hash,
                                            m_PasswordLength,
                                            rememberMe,
                                            autoLogin);
            CloudUser.instance.receiveNews = m_ReceiveNews;
            CloudUser.instance.region      = m_Region;

            PlayerPersistantInfo ppi = PPIManager.Instance.GetLocalPPI();
            if (ppi != null)
            {
                ppi.Name = m_Nickname;
                PPIManager.Instance.NotifyLocalPPIChanged();
            }

            // connect to correct lobby
            LobbyClient.ConnectToLobby(m_Region);

            // inform user that we are done
            msgbox.SetText(TextDatabase.instance[0107020]);
            msgbox.SetHandler((popup, result) => { Owner.Back(); });
        }
        else
        {
            // inform user that there were a problem with updating
            msgbox.SetText(TextDatabase.instance[0107021]);
        }

        // let user press 'OK'
        msgbox.SetButtonText(TextDatabase.instance[0107024]);
        msgbox.SetButtonVisible(true);
    }