示例#1
0
 void SetEntityToken()
 {
     PlayFabAuthenticationAPI.GetEntityToken
         (new GetEntityTokenRequest(),
         (result) => _entityKey = new EntityKey()
     {
         Id = result.Entity.Id, Type = result.Entity.Type
     },
         (err) => print(err.GenerateErrorReport()));
 }
示例#2
0
        private static void JoinMatchmaking(PlayFab.MultiplayerModels.EntityKey entity)
        {
            // We're joining a simple 2-player matchmaking queue with no rules or restrictions.
            var matchMakingRequest = new CreateMatchmakingTicketRequest()
            {
                QueueName = "nr_simple",
                Creator   = new MatchmakingPlayer()
                {
                    Entity = entity
                },
                GiveUpAfterSeconds = 30
            };

            var match = PlayFabMultiplayerAPI.CreateMatchmakingTicketAsync(matchMakingRequest).Result;

            if (match.Error != null)
            {
                Console.WriteLine($"!!! Matchmaking failed: {match.Error.ErrorMessage}");
            }
        }