public static abstract sealed class Sandbox.Services.Stats
Allows access to stats for the current game. Stats are defined by the game's author and can be used to track anything from player actions to performance metrics. They are how you submit data to leaderboards.
Related Guides
Broader workflow and conceptual references connected to this API.
Methods
Showing 11 methods
public static void Flush()
Send any pending stats to the backend. Don't wait for confirmation of ingestiom, fire and forget.
public static System.Threading.Tasks.Task FlushAndWaitAsync(System.Threading.CancellationToken token = null)
Send any pending stats to the backend, will wait until they're available for query before finishing.
Parameters
token: Default: null
public static System.Threading.Tasks.Task FlushAsync(System.Threading.CancellationToken token = null)
Send any pending stats to the backend. Don't wait for confirmation of ingestiom, fire and forget.
Parameters
token: Default: null
public static Sandbox.Services.Stats.GlobalStats GetGlobalStats(string packageIdent)
Get the global stats for this package
public static Sandbox.Services.Stats.PlayerStats GetLocalPlayerStats(string packageIdent)
Get the global stats for this package
public static Sandbox.Services.Stats.PlayerStats GetPlayerStats(string packageIdent, long steamid)
Get the stats for this package
No results match this filter.
Properties
Showing 2 properties
public static Sandbox.Services.Stats.GlobalStats Sandbox.Services.Stats.Global { get; set; }
Get the global stats for the calling package
public static Sandbox.Services.Stats.PlayerStats Sandbox.Services.Stats.LocalPlayer { get; set; }
Get the global stats for the calling package
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox.Services |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.Services.Stats |