private void OnLeaderboardScoresDownloaded(LeaderboardScoresDownloaded_t pCallback, bool bIOFailure) { Debug.Log("[" + LeaderboardScoresDownloaded_t.k_iCallback + " - LeaderboardScoresDownloaded] - " + pCallback.m_hSteamLeaderboard + " -- " + pCallback.m_hSteamLeaderboardEntries + " -- " + pCallback.m_cEntryCount); m_SteamLeaderboardEntries = pCallback.m_hSteamLeaderboardEntries; }
private void download(SteamLeaderboard_t leaderboard) { #if STEAMWORKS this.globalLeaderboardDownloadCall = new CallResult<LeaderboardScoresDownloaded_t>((downloaded, downloadedFailure) => { this.globalLeaderboardDownloadCall = null; if (downloadedFailure) this.OnLeaderboardError.Execute(); else { if (downloaded.m_cEntryCount == 0) { // We're not ranked // Get the top global list this.globalLeaderboardDownloadCall = new CallResult<LeaderboardScoresDownloaded_t>((downloaded2, downloadedFailure2) => { if (downloadedFailure2) this.OnLeaderboardError.Execute(); else { this.globalScoresDownloaded = true; this.globalScores = downloaded2; this.checkLeaderboardsDownloaded(); } }); this.globalLeaderboardDownloadCall.Set(SteamUserStats.DownloadLeaderboardEntries(leaderboard, ELeaderboardDataRequest.k_ELeaderboardDataRequestGlobal, 0, this.before + this.after)); } else { this.globalScoresDownloaded = true; this.globalScores = downloaded; this.checkLeaderboardsDownloaded(); } } }); this.globalLeaderboardDownloadCall.Set(SteamUserStats.DownloadLeaderboardEntries(leaderboard, ELeaderboardDataRequest.k_ELeaderboardDataRequestGlobalAroundUser, -this.before, this.after)); this.friendLeaderboardDownloadCall = new CallResult<LeaderboardScoresDownloaded_t>((downloaded, downloadedFailure) => { this.friendLeaderboardDownloadCall = null; if (downloadedFailure) this.OnLeaderboardError.Execute(); else { this.friendScoresDownloaded = true; this.friendScores = downloaded; this.checkLeaderboardsDownloaded(); } }); this.friendLeaderboardDownloadCall.Set(SteamUserStats.DownloadLeaderboardEntries(leaderboard, ELeaderboardDataRequest.k_ELeaderboardDataRequestFriends, -this.friendsBefore, this.friendsAfter)); #endif }
internal async Task <LeaderboardScoresDownloaded_t?> DownloadLeaderboardEntriesForUsers(SteamLeaderboard_t hSteamLeaderboard, [In, Out] SteamId[] prgUsers, int cUsers) { return(await LeaderboardScoresDownloaded_t.GetResultAsync(_DownloadLeaderboardEntriesForUsers( Self, hSteamLeaderboard, prgUsers, cUsers ))); }
internal async Task <LeaderboardScoresDownloaded_t?> DownloadLeaderboardEntries(SteamLeaderboard_t hSteamLeaderboard, LeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd) { return(await LeaderboardScoresDownloaded_t.GetResultAsync(_DownloadLeaderboardEntries( Self, hSteamLeaderboard, eLeaderboardDataRequest, nRangeStart, nRangeEnd ))); }
internal async Task <LeaderboardScoresDownloaded_t?> DownloadLeaderboardEntriesForUsers(SteamLeaderboard_t hSteamLeaderboard, [In][Out] SteamId[] prgUsers, int cUsers) { LeaderboardScoresDownloaded_t?resultAsync = await LeaderboardScoresDownloaded_t.GetResultAsync(this._DownloadLeaderboardEntriesForUsers(this.Self, hSteamLeaderboard, prgUsers, cUsers)); return(resultAsync); }
private void OnLeaderboardDownloadedEntries(LeaderboardScoresDownloaded_t pLeaderboardScoresDownloaded, bool bIOFailure) { m_bDownloading = false; m_bIOFailure = bIOFailure; // Leaderboard entries handle will be invalid once we return from this function. Copy all data now. int nLeaderboardEntries = Mathf.Min(pLeaderboardScoresDownloaded.m_cEntryCount, k_nMaxLeaderboardEntries); LeaderboardEntry_t[] leaderboardEntries = new LeaderboardEntry_t[nLeaderboardEntries]; for (int i = 0; i < nLeaderboardEntries; i++) { SteamUserStats.GetDownloadedLeaderboardEntry(pLeaderboardScoresDownloaded.m_hSteamLeaderboardEntries, i, out leaderboardEntries[i], null, 0); } if (m_LeaderboardDownloadedCallback != null) { m_LeaderboardDownloadedCallback(leaderboardEntries); } }