Ejemplo n.º 1
0
        public void AcceptFromInbox(RealTimeMultiplayerListener listener)
        {
            lock (mSessionLock)
            {
                if (GetRoomStatus() == RoomStatus.Active)
                {
                    OurUtils.Logger.e("Received attempt to accept invitation without cleaning up " +
                                      "active session.");
                    listener.OnRoomConnected(false);
                    return;
                }

                AndroidHelperFragment.ShowInvitationInboxUI((status, invitation) =>
                {
                    if (status != UIStatus.Valid)
                    {
                        OurUtils.Logger.d("User did not complete invitation screen.");
                        listener.OnRoomConnected(false);
                        return;
                    }

                    mInvitation = invitation;

                    AcceptInvitation(mInvitation.InvitationId, listener);
                });
            }
        }
Ejemplo n.º 2
0
        public void AcceptFromInbox(RealTimeMultiplayerListener listener)
        {
            var listenerOnGameThread = new OnGameThreadForwardingListener(listener);

            lock (mSessionLock)
            {
                if (GetRoomStatus() == RoomStatus.Active)
                {
                    OurUtils.Logger.e("Received attempt to accept invitation without cleaning up " +
                                      "active session.");
                    listenerOnGameThread.OnRoomConnected(false);
                    return;
                }

                AndroidHelperFragment.ShowInvitationInboxUI((status, invitation) =>
                {
                    if (status == UIStatus.NotAuthorized)
                    {
                        mAndroidClient.SignOut((() => listenerOnGameThread.OnRoomConnected(false)));
                        return;
                    }

                    if (status != UIStatus.Valid)
                    {
                        OurUtils.Logger.d("User did not complete invitation screen.");
                        listenerOnGameThread.OnRoomConnected(false);
                        return;
                    }

                    mInvitation = invitation;

                    AcceptInvitation(mInvitation.InvitationId, listener);
                });
            }
        }