示例#1
0
        private async void GetLeaderBoardUsersListAsync(bool self, string leaderBoardId)
        {
            var trophyRequest = new TrophyRequest()
            {
                LeaderBoardId = leaderBoardId,
                UserId        = self ? _basicData.UserId : Guid.Empty.ToString()
            };

            if (Application.internetReachability == NetworkReachability.NotReachable)
            {
                PROBA.LeaderBoardUserListCanceled(RequestResponse.NoInternet);
                return;
            }
            try
            {
                var(success, statusCode, userLeaderBoards) = await _probaHttpClient.GetLeaderBoardUsersAsync(trophyRequest);

                if (!success)
                {
                    PROBA.LeaderBoardUserListCanceled(RequestResponse.Error);
                    return;
                }

                PROBA.LeaderBoardUserListReceived(userLeaderBoards);
            }
            catch (Exception e)
            {
                PROBA.LeaderBoardUserListCanceled(RequestResponse.Error);
                _probaLogger.LogError(e.Message, e.StackTrace);
            }
        }