Facepunch.Steamworks Wiki


Functions for accessing and manipulating Steam user information. This is also where the APIs for Steam Voice are exposed.


static event Action OnClientGameServerDeny
Sent by the Steam server to the client telling it to disconnect from the specified game server, which it may be in the process of or already connected to. The game client should immediately disconnect upon receiving this message. This can usually occur if the user doesn't have rights to play on the game server.
Sent for games with enabled anti indulgence / duration control, for enabled users. Lets the game know whether persistent rewards or XP should be granted at normal rate, half rate, or zero rate.
static event Action<string> OnGameWebCallback
Sent to your game in response to a steam://gamewebcallback/ command from a user clicking a link in the Steam overlay browser. You can use this to add support for external site signups where you want to pop back into the browser after some web page signup sequence, and optionally get back some detail about that.
static event Action OnLicensesUpdated
Called whenever the users licenses (owned packages) changes.
static event Action<AppId, ulong, bool> OnMicroTxnAuthorizationResponse
Called when a user has responded to a microtransaction authorization request. ( appid, orderid, user authorized )
static event Action OnSteamServerConnectFailure
Called when a connection attempt has failed. This will occur periodically if the Steam client is not connected, and has failed when retrying to establish a connection.
static event Action OnSteamServersConnected
Called when a connections to the Steam back-end has been established. This means the Steam client now has a working connection to the Steam servers. Usually this will have occurred before the game has launched, and should only be seen if the user has dropped connection due to a networking issue or a Steam server update.
static event Action OnSteamServersDisconnected
Called if the client has lost connection to the Steam servers. Real-time services will be disabled until a matching OnSteamServersConnected has been posted.
Called when an auth ticket has been validated. The first parameter is the steamid of this user The second is the Steam ID that owns the game, this will be different from the first if the game is being borrowed via Steam Family Sharing


static bool HasVoiceData { get; }
Returns true if we have voice data waiting to be read
static bool IsBehindNAT { get; }
Checks if the current users looks like they are behind a NAT device. This is only valid if the user is connected to the Steam servers and may not catch all forms of NAT.
static bool IsPhoneIdentifying { get; }
Checks whether the user's phone number is used to uniquely identify them.
static bool IsPhoneRequiringVerification { get; }
Checks whether the current user's phone number is awaiting (re)verification.
static bool IsPhoneVerified { get; }
Checks whether the current user has verified their phone number.
static bool IsTwoFactorEnabled { get; }
Checks whether the current user has Steam Guard two factor authentication enabled on their account.
static uint OptimalSampleRate { get; }
static uint SampleRate { get; set; }
static int SteamLevel { get; }
Gets the Steam level of the user, as shown on their Steam community profile.
static bool VoiceRecord { get; set; }
Starts/Stops voice recording. Once started, use GetAvailableVoice and GetVoice to get the data, and then call StopVoiceRecording when the user has released their push-to-talk hotkey or the game session has completed.


static BeginAuthResult BeginAuthSession( byte[] ticketData, SteamId steamid )
static int DecompressVoice( byte[] from, System.IO.Stream output )
Decodes the compressed voice data returned by GetVoice. The output data is raw single-channel 16-bit PCM audio.The decoder supports any sample rate from 11025 to 48000.
static void EndAuthSession( SteamId steamid )
Retrieve a authentication ticket to be sent to the entity who wishes to authenticate you.
static async Task<AuthTicket> GetAuthSessionTicketAsync( double timeoutSeconds = 10 )
Retrieve a authentication ticket to be sent to the entity who wishes to authenticate you. This waits for a positive response from the backend before returning the ticket. This means the ticket is definitely ready to go as soon as it returns. Will return null if the callback times out or returns negatively.
Get anti indulgence / duration control
static async Task<string> GetStoreAuthUrlAsync( string url )
Requests a URL which authenticates an in-game browser for store check-out, and then redirects to the specified URL. As long as the in-game browser accepts and handles session cookies, Steam microtransaction checkout pages will automatically recognize the user instead of presenting a login page. NOTE: The URL has a very short lifetime to prevent history-snooping attacks, so you should only call this API when you are about to launch the browser, or else immediately navigate to the result URL using a hidden..
static int ReadVoiceData( System.IO.Stream stream )
Reads the voice data and returns the number of bytes written. The compressed data can be transmitted by your application and decoded back into raw audio data using DecompressVoice on the other side. The compressed data provided is in an arbitrary format and is not meant to be played directly. This should be called once per frame, and at worst no more than four times a second to keep the microphone input delay as low as possible. Calling this any less may result in gaps in the returned stream.
static byte[] ReadVoiceDataBytes()
Reads the voice data and returns the bytes. You should obviously ideally be using ReadVoiceData because it won't be creating a new byte array every call. But this makes it easier to get it working, so let the babies have their bottle.
static async Task<byte[]> RequestEncryptedAppTicketAsync()
Requests an application ticket encrypted with the secret "encrypted app ticket key". The encryption key can be obtained from the Encrypted App Ticket Key page on the App Admin for your app. There can only be one call pending, and this call is subject to a 60 second rate limit. This can fail if you don't have an encrypted ticket set for your app here https://partner.steamgames.com/apps/sdkauth/