Example #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]);
    }
Example #2
0
    //-----------------------------------------------------------------------------------------------------------------
    void OnMessageBoxEvent(GuiPopup popup, E_PopupResultCode result)
    {
        if (m_IsConnectingToLobby)
        {
            m_IsConnectingToLobby = false;
            LobbyClient.ToLobbyConnectionResult -= OnLobbyConnectionResult;
        }

        if (m_IsLookingForServer)
        {
            if (result == E_PopupResultCode.Ok)             // User pressed the cancel button
            {
                LobbyClient.CancelFindServer(m_LastJoinRequestId);
            }

            m_IsLookingForServer = false;
        }

        if (m_IsConnectingToServer)
        {
            m_IsConnectingToServer = false;
        }
    }