You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When I was using leaderboard.GetScoresForUsersAsync(SteamId[]), I noticed that if all your friends aren't on the leaderboard, null would be returned.
If the network connection is interrupted and the leaderboard data cannot be obtained, null is returned.
This return value confuses me, because I can't speculate from the return value data whether the current prompt for "network error" should be displayed, or if all of my friends don't have a score.
// Leaderboard
public async Task<LeaderboardEntry[]> GetScoresForUsersAsync(SteamId[] users)
{
if (users == null || users.Length == 0)
{
return null;
}
LeaderboardScoresDownloaded_t? leaderboardScoresDownloaded_t = await SteamUserStats.Internal.DownloadLeaderboardEntriesForUsers(Id, users, users.Length);
// !!!!!!!!!!!!!!!! I'm guessing it could be return null, when the network connection drops?
if (!leaderboardScoresDownloaded_t.HasValue)
{
return null;
}
return await LeaderboardResultToEntries(leaderboardScoresDownloaded_t.Value);
}
internal async Task<LeaderboardEntry[]> LeaderboardResultToEntries(LeaderboardScoresDownloaded_t r)
{
//!!!!!!!!!!!!!!!! I'm guessing it's this branch, but I didn't add logs to debug
if (r.CEntryCount <= 0)
{
return null;
}
LeaderboardEntry[] output = new LeaderboardEntry[r.CEntryCount];
LeaderboardEntry_t pLeaderboardEntry = default(LeaderboardEntry_t);
for (int i = 0; i < output.Length; i++)
{
if (SteamUserStats.Internal.GetDownloadedLeaderboardEntry(r.SteamLeaderboardEntries, i, ref pLeaderboardEntry, detailsBuffer, detailsBuffer.Length))
{
output[i] = LeaderboardEntry.From(pLeaderboardEntry, detailsBuffer);
}
}
await WaitForUserNames(output);
return output;
}
Describe the solution you'd like
Try to distinguish between leaderboard data fetch failed and all of my friends aren't on the leaderboard.
Is your feature request related to a problem? Please describe.
leaderboard.GetScoresForUsersAsync(SteamId[])
, I noticed that if all your friends aren't on the leaderboard, null would be returned.Describe the solution you'd like
Describe alternatives you've considered
leaderboard.GetScoresForUsersAsync
leaderboard.GetScoresAsync
Additional context
The text was updated successfully, but these errors were encountered: