s&box docs
API ReferenceSandbox.Services

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.

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

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

Metadata

FieldValue
NamespaceSandbox.Services
Typeclass
AssemblySandbox.Engine
Doc IDT:Sandbox.Services.Stats

On this page