private static void OnClient(IntPtr thisptr, IntPtr pvParam)
        {
            Action <LeaderboardScoresDownloaded_t> action = LeaderboardScoresDownloaded_t.actionClient;

            if (action != null)
            {
                action(LeaderboardScoresDownloaded_t.Fill(pvParam));
            }
            else
            {
            }
        }
        public static async Task <LeaderboardScoresDownloaded_t?> GetResultAsync(SteamAPICall_t handle)
        {
            LeaderboardScoresDownloaded_t?nullable;
            bool flag = false;

            while (!SteamUtils.IsCallComplete(handle, out flag))
            {
                await Task.Delay(1);

                if ((SteamClient.IsValid ? false : !SteamServer.IsValid))
                {
                    nullable = null;
                    return(nullable);
                }
            }
            if (!flag)
            {
                IntPtr intPtr = Marshal.AllocHGlobal(LeaderboardScoresDownloaded_t.StructSize);
                try
                {
                    if (!(!SteamUtils.Internal.GetAPICallResult(handle, intPtr, LeaderboardScoresDownloaded_t.StructSize, 1105, ref flag) | flag))
                    {
                        nullable = new LeaderboardScoresDownloaded_t?(LeaderboardScoresDownloaded_t.Fill(intPtr));
                    }
                    else
                    {
                        nullable = null;
                    }
                }
                finally
                {
                    Marshal.FreeHGlobal(intPtr);
                }
            }
            else
            {
                nullable = null;
            }
            return(nullable);
        }
Пример #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 <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);
        }