Ejemplo n.º 1
0
        /// <summary>
        /// Allows for paging through all players in a given segment. This API creates a snapshot of all player profiles that match the segment definition at the time of its creation and lives through the Total Seconds to Live, refreshing its life span on each subsequent use of the Continuation Token. Profiles that change during the course of paging will not be reflected in the results. AB Test segments are currently not supported by this operation.
        /// </summary>
        public static void GetPlayersInSegment(GetPlayersInSegmentRequest request, Action <GetPlayersInSegmentResult> resultCallback, Action <PlayFabError> errorCallback, object customData = null)
        {
            if (PlayFabSettings.DeveloperSecretKey == null)
            {
                throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method");
            }

            PlayFabHttp.MakeApiCall("/Admin/GetPlayersInSegment", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData);
        }
Ejemplo n.º 2
0
        public async Task <List <string> > GetUsersIdAsync()
        {
            var userIds = new List <string>();
            var reqGetPlayersInSegment = new GetPlayersInSegmentRequest
            {
                SegmentId = configuration.AllUserSegmentId
            };

            var result = await PlayFabAdminAPI.GetPlayersInSegmentAsync(reqGetPlayersInSegment);

            result.Result.PlayerProfiles.ForEach(playerProfile => userIds.Add(playerProfile.PlayerId));
            return(userIds);
        }