예제 #1
0
        public IEnumerator CancelPlayerTickets()
        {
            ExecutionCompleted = false;

            PlayFabMultiplayerAPI.CancelAllMatchmakingTicketsForPlayer(
                new CancelAllMatchmakingTicketsForPlayerRequest
            {
                QueueName = QueueConfiguration.QueueName,
                Entity    = new EntityKey
                {
                    Id   = Player.Entity.Id,
                    Type = Player.Entity.Type,
                },
                AuthenticationContext = PlayFabAuthenticationContext
            },
                (result) =>
            {
                ExecutionCompleted = true;
                // set both objects to null as the related ticket was cancelled
                MatchmakingTicketResult = null;
                MatchmakingTicketStatus = null;
            },
                (error) =>
            {
                var result = $"On CancelPlayerTickets failed. Message: {error.ErrorMessage}, Code: {error.HttpCode}";
                Debug.Log(result);
            }
                );

            yield return(WaitForExecution());
        }
예제 #2
0
        void CancelMatchmaking()
        {
            var r = new CancelAllMatchmakingTicketsForPlayerRequest {
                Entity = _entityKey, QueueName = SelectedQueue
            };

            PlayFabMultiplayerAPI.CancelAllMatchmakingTicketsForPlayer(r, (result) => Debug.Log("Cancelled matchmaking for player"), (error) => print(error.GenerateErrorReport()));
        }