Facepunch.Steamworks Wiki

Steamworks.SteamServerStats

Methods

static bool ClearAchievement( SteamId steamid, string name )
Resets the unlock status of an achievement for the specified user. Must have called Refresh on a steamid first. Remember to use Commit after use.
static bool GetAchievement( SteamId steamid, string name )
Return true if available, exists and unlocked
static float GetFloat( SteamId steamid, string name, float defaultValue = 0 )
Get the named stat for this user. If getting the stat failed, will return defaultValue. You should have called Refresh for this userid - which downloads the stats from the backend. If you didn't call it this will always return defaultValue.
static int GetInt( SteamId steamid, string name, int defaultValue = 0 )
Get the named stat for this user. If getting the stat failed, will return defaultValue. You should have called Refresh for this userid - which downloads the stats from the backend. If you didn't call it this will always return defaultValue.
static async Task<Result> RequestUserStatsAsync( SteamId steamid )
Downloads stats for the user If the user has no stats will return fail these stats will only be auto-updated for clients playing on the server
static bool SetAchievement( SteamId steamid, string name )
Unlocks the specified achievement for the specified user. Must have called Refresh on a steamid first. Remember to use Commit after use.
static bool SetFloat( SteamId steamid, string name, float stat )
Set the named stat for this user. Setting stats should follow the rules you defined in Steamworks.
static bool SetInt( SteamId steamid, string name, int stat )
Set the named stat for this user. Setting stats should follow the rules you defined in Steamworks.
static async Task<Result> StoreUserStats( SteamId steamid )
Once you've set a stat change on a user you need to commit your changes. You can do that using this function. The callback will let you know if your action succeeded, but most of the time you can fire and forget.