Added SteamUserStats.RequestGlobalStats

This commit is contained in:
Garry Newman 2020-02-22 21:03:29 +00:00
parent d58dfdf4d2
commit c8cb180b78

View File

@ -138,6 +138,22 @@ namespace Steamworks
return Internal.RequestCurrentStats();
}
/// <summary>
/// Asynchronously fetches global stats data, which is available for stats marked as
/// "aggregated" in the App Admin panel of the Steamworks website.
/// You must have called RequestCurrentStats and it needs to return successfully via
/// its callback prior to calling this.
/// </summary>
/// <param name="days">How many days of day-by-day history to retrieve in addition to the overall totals. The limit is 60.</param>
/// <returns>OK indicates success, InvalidState means you need to call RequestCurrentStats first, Fail means the remote call failed</returns>
public static async Task<Result> RequestGlobalStats( int days )
{
var result = await SteamUserStats.Internal.RequestGlobalStats( days );
if ( !result.HasValue ) return Result.Fail;
return result.Value.Result;
}
/// <summary>
/// Gets a leaderboard by name, it will create it if it's not yet created.
/// Leaderboards created with this function will not automatically show up in the Steam Community.