Unstable 1.1.14.0

This commit is contained in:
Markus Isberg
2023-10-02 16:43:54 +03:00
parent 94f5a93a0c
commit cf8f0de659
606 changed files with 21906 additions and 11456 deletions
@@ -11,11 +11,15 @@ namespace Steamworks
{
internal static ISteamUserStats? Internal => Interface as ISteamUserStats;
internal override void InitializeInterface( bool server )
internal override bool InitializeInterface( bool server )
{
SetInterface( server, new ISteamUserStats( server ) );
if ( Interface is null || Interface.Self == IntPtr.Zero ) return false;
InstallEvents();
RequestCurrentStats();
return true;
}
public static bool StatsRecieved { get; internal set; }
@@ -38,25 +42,25 @@ namespace Steamworks
/// <summary>
/// called when the achivement icon is loaded
/// Invoked when an achivement icon is loaded.
/// </summary>
internal static event Action<string, int>? OnAchievementIconFetched;
/// <summary>
/// called when the latests stats and achievements have been received
/// from the server
/// Invoked when the latests stats and achievements have been received
/// from the server.
/// </summary>
public static event Action<SteamId, Result>? OnUserStatsReceived;
/// <summary>
/// result of a request to store the user stats for a game
/// Result of a request to store the user stats for a game.
/// </summary>
public static event Action<Result>? OnUserStatsStored;
/// <summary>
/// result of a request to store the achievements for a game, or an
/// Result of a request to store the achievements for a game, or an
/// "indicate progress" call. If both m_nCurProgress and m_nMaxProgress
/// are zero, that means the achievement has been fully unlocked
/// are zero, that means the achievement has been fully unlocked.
/// </summary>
public static event Action<Achievement, int, int>? OnAchievementProgress;
@@ -67,7 +71,7 @@ namespace Steamworks
public static event Action<SteamId>? OnUserStatsUnloaded;
/// <summary>
/// Get the available achievements
/// Get all available achievements.
/// </summary>
public static IEnumerable<Achievement> Achievements
{
@@ -104,7 +108,7 @@ namespace Steamworks
/// <summary>
/// Tries to get the number of players currently playing this game.
/// Or -1 if failed.
/// Or <c>-1</c> if failed.
/// </summary>
public static async Task<int> PlayerCountAsync()
{
@@ -146,11 +150,11 @@ namespace Steamworks
/// <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
/// You must have called <see cref="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>
/// <param name="days">How many days of day-by-day history to retrieve in addition to the overall totals. The limit is <c>60</c>.</param>
/// <returns><see cref="Result.OK"/> indicates success, <see cref="Result.InvalidState"/> means you need to call <see cref="RequestCurrentStats"/> first, <see cref="Result.Fail"/> means the remote call failed</returns>
public static async Task<Result> RequestGlobalStatsAsync( int days )
{
if (Internal is null) { return Result.Fail; }
@@ -216,8 +220,7 @@ namespace Steamworks
}
/// <summary>
/// Set a stat value. This will automatically call StoreStats() after a successful call
/// unless you pass false as the last argument.
/// Set a stat value. This will automatically call <see cref="StoreStats"/> after a successful call.
/// </summary>
public static bool SetStat( string name, int value )
{
@@ -225,8 +228,7 @@ namespace Steamworks
}
/// <summary>
/// Set a stat value. This will automatically call StoreStats() after a successful call
/// unless you pass false as the last argument.
/// Set a stat value. This will automatically call <see cref="StoreStats"/> after a successful call.
/// </summary>
public static bool SetStat( string name, float value )
{
@@ -234,7 +236,7 @@ namespace Steamworks
}
/// <summary>
/// Get a Int stat value
/// Get an <see langword="int"/> stat value.
/// </summary>
public static int GetStatInt( string name )
{
@@ -244,7 +246,7 @@ namespace Steamworks
}
/// <summary>
/// Get a float stat value
/// Get a <see langword="float"/> stat value.
/// </summary>
public static float GetStatFloat( string name )
{
@@ -254,7 +256,7 @@ namespace Steamworks
}
/// <summary>
/// Practically wipes the slate clean for this user. If includeAchievements is true, will wipe
/// Practically wipes the slate clean for this user. If <paramref name="includeAchievements"/> is <see langword="true"/>, will also wipe
/// any achievements too.
/// </summary>
/// <returns></returns>
@@ -263,4 +265,4 @@ namespace Steamworks
return Internal != null && Internal.ResetAllStats( includeAchievements );
}
}
}
}