internal override void HandleRoomResponse(RealtimeManager.RealTimeRoomResponse response)
 {
     if (!response.RequestSucceeded())
     {
         mSession.EnterState(new ShutdownState(mSession));
         mSession.OnGameThreadListener().RoomConnected(false);
     }
     else
     {
         mSession.EnterState(new LeavingRoom(mSession, response.Room(), delegate
         {
             mSession.OnGameThreadListener().RoomConnected(false);
         }));
     }
 }
Exemplo n.º 2
0
            internal override void HandleRoomResponse(RealtimeManager.RealTimeRoomResponse response)
            {
                // If the room creation didn't succeed, we have nothing left to do, just bail out
                // and alert the user callback.
                if (!response.RequestSucceeded())
                {
                    mSession.EnterState(new ShutdownState(mSession));
                    mSession.OnGameThreadListener().RoomConnected(false);
                    return;
                }

                // We just created a room which we're not going to use. Clean up and notify the user
                // when we're done.
                mSession.EnterState(new LeavingRoom(mSession, response.Room(),
                                                    () => mSession.OnGameThreadListener().RoomConnected(false)));
            }
            internal override void HandleRoomResponse(RealtimeManager.RealTimeRoomResponse response)
            {
                if (!response.RequestSucceeded())
                {
                    mContainingSession.EnterState(new ShutdownState(mContainingSession));
                    mContainingSession.OnGameThreadListener().RoomConnected(false);
                }

                mContainingSession.EnterState(new ConnectingState(response.Room(), mContainingSession));
            }
Exemplo n.º 4
0
 internal override void LeaveRoom()
 {
     Logger.d("Session was torn down before room was created.");
     mContainingSession.OnGameThreadListener().RoomConnected(false);
     mContainingSession.EnterState(new ShutdownState(mContainingSession));
 }
Exemplo n.º 5
0
 internal override void OnDataReceived(NativeRealTimeRoom room,
                                       MultiplayerParticipant sender, byte[] data, bool isReliable)
 {
     mSession.OnGameThreadListener().RealTimeMessageReceived(isReliable, sender.Id(), data);
 }
Exemplo n.º 6
0
 internal override void LeaveRoom()
 {
     mSession.OnGameThreadListener().LeftRoom();
 }