Class SteamGameServerStats
Purpose: Functions for authenticating users via Steam to play on a game server
Inherited Members
Namespace: Unity.Steamworks.Interop
Assembly: Unity.Steamworks.Interop.dll
Syntax
public static class SteamGameServerStats
Methods
ClearUserAchievement(CSteamID, string)
Calls the Steamworks ISteamGameServerStats::ClearUserAchievement method.
Declaration
public static bool ClearUserAchievement(CSteamID steamIDUser, string pchName)
Parameters
| Type | Name | Description |
|---|---|---|
| CSteamID | steamIDUser | Passed through to |
| string | pchName | Passed through to |
Returns
| Type | Description |
|---|---|
| bool | The value |
GetUserAchievement(CSteamID, string, out bool)
Calls the Steamworks ISteamGameServerStats::GetUserAchievement method.
Declaration
public static bool GetUserAchievement(CSteamID steamIDUser, string pchName, out bool pbAchieved)
Parameters
| Type | Name | Description |
|---|---|---|
| CSteamID | steamIDUser | Passed through to |
| string | pchName | Passed through to |
| bool | pbAchieved | Passed through to |
Returns
| Type | Description |
|---|---|
| bool | The value |
GetUserStat(CSteamID, string, out int)
Calls the Steamworks ISteamGameServerStats::GetUserStat method.
Declaration
public static bool GetUserStat(CSteamID steamIDUser, string pchName, out int pData)
Parameters
| Type | Name | Description |
|---|---|---|
| CSteamID | steamIDUser | Passed through to |
| string | pchName | Passed through to |
| int | pData | Passed through to |
Returns
| Type | Description |
|---|---|
| bool | The value |
GetUserStat(CSteamID, string, out float)
Calls the Steamworks ISteamGameServerStats::GetUserStat method.
Declaration
public static bool GetUserStat(CSteamID steamIDUser, string pchName, out float pData)
Parameters
| Type | Name | Description |
|---|---|---|
| CSteamID | steamIDUser | Passed through to |
| string | pchName | Passed through to |
| float | pData | Passed through to |
Returns
| Type | Description |
|---|---|
| bool | The value |
RequestUserStats(CSteamID)
downloads stats for the user returns a GSStatsReceived_t callback when completed if the user has no stats, GSStatsReceived_t.m_eResult will be set to k_EResultFail these stats will only be auto-updated for clients playing on the server. For other users you'll need to call RequestUserStats() again to refresh any data
Declaration
public static SteamAPICall_t RequestUserStats(CSteamID steamIDUser)
Parameters
| Type | Name | Description |
|---|---|---|
| CSteamID | steamIDUser | Passed through to |
Returns
| Type | Description |
|---|---|
| SteamAPICall_t | The value |
RequestUserStatsAsync(CSteamID)
Async version of RequestUserStats(CSteamID).
Declaration
public static Task<GSStatsReceived_t> RequestUserStatsAsync(CSteamID steamIDUser)
Parameters
| Type | Name | Description |
|---|---|---|
| CSteamID | steamIDUser | Passed through to |
Returns
| Type | Description |
|---|---|
| Task<GSStatsReceived_t> | The GSStatsReceived_t Steam reports once the call completes. |
SetUserAchievement(CSteamID, string)
Calls the Steamworks ISteamGameServerStats::SetUserAchievement method.
Declaration
public static bool SetUserAchievement(CSteamID steamIDUser, string pchName)
Parameters
| Type | Name | Description |
|---|---|---|
| CSteamID | steamIDUser | Passed through to |
| string | pchName | Passed through to |
Returns
| Type | Description |
|---|---|
| bool | The value |
SetUserStat(CSteamID, string, int)
Calls the Steamworks ISteamGameServerStats::SetUserStat method.
Declaration
public static bool SetUserStat(CSteamID steamIDUser, string pchName, int nData)
Parameters
| Type | Name | Description |
|---|---|---|
| CSteamID | steamIDUser | Passed through to |
| string | pchName | Passed through to |
| int | nData | Passed through to |
Returns
| Type | Description |
|---|---|
| bool | The value |
SetUserStat(CSteamID, string, float)
Calls the Steamworks ISteamGameServerStats::SetUserStat method.
Declaration
public static bool SetUserStat(CSteamID steamIDUser, string pchName, float fData)
Parameters
| Type | Name | Description |
|---|---|---|
| CSteamID | steamIDUser | Passed through to |
| string | pchName | Passed through to |
| float | fData | Passed through to |
Returns
| Type | Description |
|---|---|
| bool | The value |
StoreUserStats(CSteamID)
Store the current data on the server, will get a GSStatsStored_t callback when set. If the callback has a result of k_EResultInvalidParam, one or more stats uploaded has been rejected, either because they broke constraints or were out of date. In this case the server sends back updated values. The stats should be re-iterated to keep in sync.
Declaration
public static SteamAPICall_t StoreUserStats(CSteamID steamIDUser)
Parameters
| Type | Name | Description |
|---|---|---|
| CSteamID | steamIDUser | Passed through to |
Returns
| Type | Description |
|---|---|
| SteamAPICall_t | The value |
StoreUserStatsAsync(CSteamID)
Async version of StoreUserStats(CSteamID).
Declaration
public static Task<GSStatsStored_t> StoreUserStatsAsync(CSteamID steamIDUser)
Parameters
| Type | Name | Description |
|---|---|---|
| CSteamID | steamIDUser | Passed through to |
Returns
| Type | Description |
|---|---|
| Task<GSStatsStored_t> | The GSStatsStored_t Steam reports once the call completes. |
UpdateUserAvgRateStat(CSteamID, string, float, double)
Calls the Steamworks ISteamGameServerStats::UpdateUserAvgRateStat method.
Declaration
public static bool UpdateUserAvgRateStat(CSteamID steamIDUser, string pchName, float flCountThisSession, double dSessionLength)
Parameters
| Type | Name | Description |
|---|---|---|
| CSteamID | steamIDUser | Passed through to |
| string | pchName | Passed through to |
| float | flCountThisSession | Passed through to |
| double | dSessionLength | Passed through to |
Returns
| Type | Description |
|---|---|
| bool | The value |