コード例 #1
0
        // UGCHandle_t m_hUGC

        internal static LeaderboardEntry From(LeaderboardEntry_t e, int[] detailsBuffer)
        {
            var r = new LeaderboardEntry
            {
                User       = new Friend(e.SteamIDUser),
                GlobalRank = e.GlobalRank,
                Score      = e.Score,
                Details    = null
            };

            if (e.CDetails > 0)
            {
                r.Details = detailsBuffer.Take(e.CDetails).ToArray();
            }

            return(r);
        }
コード例 #2
0
        internal static LeaderboardEntry From(LeaderboardEntry_t e, int[] detailsBuffer)
        {
            LeaderboardEntry leaderboardEntry = new LeaderboardEntry()
            {
                User       = new Friend(e.SteamIDUser),
                GlobalRank = e.GlobalRank,
                Score      = e.Score,
                Details    = null
            };
            LeaderboardEntry array = leaderboardEntry;

            if (e.CDetails > 0)
            {
                array.Details = detailsBuffer.Take <int>(e.CDetails).ToArray <int>();
            }
            return(array);
        }
コード例 #3
0
        public async Task <LeaderboardEntry[]> LeaderboardResultToEntries(LeaderboardScoresDownloaded_t r)
        {
            if (r.CEntryCount <= 0)
            {
                return(null);
            }

            var output = new LeaderboardEntry[r.CEntryCount];
            var e      = default(LeaderboardEntry_t);

            for (var i = 0; i < output.Length; i++)
            {
                if (SteamUserStats.Internal.GetDownloadedLeaderboardEntry(r.SteamLeaderboardEntries, i, ref e, detailsBuffer, detailsBuffer.Length))
                {
                    output[i] = LeaderboardEntry.From(e, detailsBuffer);
                }
            }

            await WaitForUserNames(output);

            return(output);
        }
コード例 #4
0
        internal async Task WaitForUserNames(LeaderboardEntry[] entries)
        {
            bool flag = false;

            while (!flag)
            {
                flag = true;
                LeaderboardEntry[] leaderboardEntryArray = entries;
                for (int i = 0; i < (int)leaderboardEntryArray.Length; i++)
                {
                    LeaderboardEntry leaderboardEntry = leaderboardEntryArray[i];
                    if (leaderboardEntry.User.Id != (long)0)
                    {
                        if (SteamFriends.Internal.RequestUserInformation(leaderboardEntry.User.Id, true))
                        {
                            flag             = false;
                            leaderboardEntry = new LeaderboardEntry();
                        }
                    }
                }
                leaderboardEntryArray = null;
                await Task.Delay(1);
            }
        }
コード例 #5
0
        internal async Task <LeaderboardEntry[]> LeaderboardResultToEntries(LeaderboardScoresDownloaded_t r)
        {
            LeaderboardEntry[] leaderboardEntryArray;
            if (r.CEntryCount > 0)
            {
                LeaderboardEntry[] leaderboardEntryArray1 = new LeaderboardEntry[r.CEntryCount];
                LeaderboardEntry_t leaderboardEntryT      = new LeaderboardEntry_t();
                for (int i = 0; i < (int)leaderboardEntryArray1.Length; i++)
                {
                    if (SteamUserStats.Internal.GetDownloadedLeaderboardEntry(r.SteamLeaderboardEntries, i, ref leaderboardEntryT, Leaderboard.detailsBuffer, (int)Leaderboard.detailsBuffer.Length))
                    {
                        leaderboardEntryArray1[i] = LeaderboardEntry.From(leaderboardEntryT, Leaderboard.detailsBuffer);
                    }
                }
                await this.WaitForUserNames(leaderboardEntryArray1);

                leaderboardEntryArray = leaderboardEntryArray1;
            }
            else
            {
                leaderboardEntryArray = null;
            }
            return(leaderboardEntryArray);
        }