コード例 #1
0
 internal void AcceptInvitation(MultiplayerInvitation invitation,
                                RealTimeEventListenerHelper listener,
                                Action <RealTimeRoomResponse> callback)
 {
     C.RealTimeMultiplayerManager_AcceptInvitation(mGameServices.AsHandle(),
                                                   invitation.AsPointer(), listener.AsPointer(), InternalRealTimeRoomCallback,
                                                   ToCallbackPointer(callback));
 }
コード例 #2
0
 internal void CreateRoom(RealtimeRoomConfig config, RealTimeEventListenerHelper helper,
     Action<RealTimeRoomResponse> callback) {
     C.RealTimeMultiplayerManager_CreateRealTimeRoom(mGameServices.AsHandle(),
         config.AsPointer(),
         helper.AsPointer(),
         InternalRealTimeRoomCallback,
         ToCallbackPointer(callback));
 }
コード例 #3
0
 internal void CreateRoom(RealtimeRoomConfig config, RealTimeEventListenerHelper helper,
                          Action <RealTimeRoomResponse> callback)
 {
     C.RealTimeMultiplayerManager_CreateRealTimeRoom(mGameServices.AsHandle(),
                                                     config.AsPointer(),
                                                     helper.AsPointer(),
                                                     InternalRealTimeRoomCallback,
                                                     ToCallbackPointer(callback));
 }
コード例 #4
0
 internal void AcceptInvitation(MultiplayerInvitation invitation,
     RealTimeEventListenerHelper listener,
     Action<RealTimeRoomResponse> callback) {
     C.RealTimeMultiplayerManager_AcceptInvitation(mGameServices.AsHandle(),
         invitation.AsPointer(), listener.AsPointer(), InternalRealTimeRoomCallback,
         ToCallbackPointer(callback));
 }
コード例 #5
0
 internal RealTimeEventListenerHelper SetOnRoomConnectedSetChangedCallback(Action <NativeRealTimeRoom> callback)
 {
     GooglePlayGames.Native.Cwrapper.RealTimeEventListenerHelper.RealTimeEventListenerHelper_SetOnRoomConnectedSetChangedCallback(this.SelfPtr(), new GooglePlayGames.Native.Cwrapper.RealTimeEventListenerHelper.OnRoomConnectedSetChangedCallback(RealTimeEventListenerHelper.InternalOnRoomConnectedSetChangedCallback), RealTimeEventListenerHelper.ToCallbackPointer(callback));
     return(this);
 }
コード例 #6
0
 internal static void InternalOnParticipantStatusChangedCallback(IntPtr room, IntPtr participant, IntPtr data)
 {
     RealTimeEventListenerHelper.PerformRoomAndParticipantCallback(nameof(InternalOnParticipantStatusChangedCallback), room, participant, data);
 }
コード例 #7
0
 public void CreateQuickGame(uint minOpponents, uint maxOpponents, uint variant, ulong exclusiveBitMask, RealTimeMultiplayerListener listener)
 {
     lock (mSessionLock)
     {
         RoomSession newSession = new RoomSession(mRealtimeManager, listener);
         if (mCurrentSession.IsActive())
         {
             Logger.e("Received attempt to create a new room without cleaning up the old one.");
             newSession.LeaveRoom();
         }
         else
         {
             mCurrentSession = newSession;
             Logger.d("QuickGame: Setting MinPlayersToStart = " + minOpponents);
             mCurrentSession.MinPlayersToStart = minOpponents;
             using (RealtimeRoomConfigBuilder realtimeRoomConfigBuilder = RealtimeRoomConfigBuilder.Create())
             {
                 RealtimeRoomConfig config = realtimeRoomConfigBuilder.SetMinimumAutomatchingPlayers(minOpponents).SetMaximumAutomatchingPlayers(maxOpponents).SetVariant(variant)
                                             .SetExclusiveBitMask(exclusiveBitMask)
                                             .Build();
                 using (config)
                 {
                     GooglePlayGames.Native.PInvoke.RealTimeEventListenerHelper helper = HelperForSession(newSession);
                     try
                     {
                         newSession.StartRoomCreation(mNativeClient.GetUserId(), delegate
                         {
                             mRealtimeManager.CreateRoom(config, helper, newSession.HandleRoomResponse);
                         });
                     }
                     finally
                     {
                         if (helper != null)
                         {
                             ((IDisposable)helper).Dispose();
                         }
                     }
                 }
             }
         }
     }
 }
コード例 #8
0
 public void AcceptFromInbox(RealTimeMultiplayerListener listener)
 {
     lock (mSessionLock)
     {
         RoomSession newRoom = new RoomSession(mRealtimeManager, listener);
         if (mCurrentSession.IsActive())
         {
             Logger.e("Received attempt to accept invitation without cleaning up active session.");
             newRoom.LeaveRoom();
         }
         else
         {
             mCurrentSession           = newRoom;
             mCurrentSession.ShowingUI = true;
             mRealtimeManager.ShowRoomInboxUI(delegate(RealtimeManager.RoomInboxUIResponse response)
             {
                 mCurrentSession.ShowingUI = false;
                 if (response.ResponseStatus() != CommonErrorStatus.UIStatus.VALID)
                 {
                     Logger.d("User did not complete invitation screen.");
                     newRoom.LeaveRoom();
                 }
                 else
                 {
                     GooglePlayGames.Native.PInvoke.MultiplayerInvitation invitation   = response.Invitation();
                     GooglePlayGames.Native.PInvoke.RealTimeEventListenerHelper helper = HelperForSession(newRoom);
                     try
                     {
                         Logger.d("About to accept invitation " + invitation.Id());
                         newRoom.StartRoomCreation(mNativeClient.GetUserId(), delegate
                         {
                             mRealtimeManager.AcceptInvitation(invitation, helper, delegate(RealtimeManager.RealTimeRoomResponse acceptResponse)
                             {
                                 using (invitation)
                                 {
                                     newRoom.HandleRoomResponse(acceptResponse);
                                     newRoom.SetInvitation(invitation.AsInvitation());
                                 }
                             });
                         });
                     }
                     finally
                     {
                         if (helper != null)
                         {
                             ((IDisposable)helper).Dispose();
                         }
                     }
                 }
             });
         }
     }
 }
コード例 #9
0
 internal static RealTimeEventListenerHelper Create() =>
 new RealTimeEventListenerHelper(RealTimeEventListenerHelper.RealTimeEventListenerHelper_Construct());
コード例 #10
0
 protected override void CallDispose(HandleRef selfPointer)
 {
     RealTimeEventListenerHelper.RealTimeEventListenerHelper_Dispose(selfPointer);
 }
コード例 #11
0
 internal void AcceptInvitation(MultiplayerInvitation invitation, RealTimeEventListenerHelper listener, Action <RealTimeRoomResponse> callback)
 {
     if (< > f__mg$cacheA == null)
     {