From c8cb180b78e2f158cc40e0d1dcd13390b0959346 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Sat, 22 Feb 2020 21:03:29 +0000 Subject: [PATCH] Added SteamUserStats.RequestGlobalStats --- Facepunch.Steamworks/SteamUserStats.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Facepunch.Steamworks/SteamUserStats.cs b/Facepunch.Steamworks/SteamUserStats.cs index 29e6a6f..5ec4f67 100644 --- a/Facepunch.Steamworks/SteamUserStats.cs +++ b/Facepunch.Steamworks/SteamUserStats.cs @@ -138,6 +138,22 @@ namespace Steamworks return Internal.RequestCurrentStats(); } + /// + /// 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. + /// + /// How many days of day-by-day history to retrieve in addition to the overall totals. The limit is 60. + /// OK indicates success, InvalidState means you need to call RequestCurrentStats first, Fail means the remote call failed + public static async Task RequestGlobalStats( int days ) + { + var result = await SteamUserStats.Internal.RequestGlobalStats( days ); + if ( !result.HasValue ) return Result.Fail; + return result.Value.Result; + } + + /// /// 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.