Facepunch.Steamworks.Posix
An awaitable version of a SteamAPICall_t
This gets called if IsComplete returned false on the first call.
The Action "continues" the async call. We pass it to the Dispatch
to be called when the callback returns.
Gets the result. This is called internally by the async shit.
Return true if complete or failed
This is what makes this struct awaitable
Gives us a generic way to get the CallbackId of structs
Cancels a ticket.
You should cancel your ticket when you close the game or leave a server.
Responsible for all callback/callresult handling
This manually pumps Steam's message queue and dispatches those
events to any waiting callbacks/callresults.
If set then we'll call this function every time a callback is generated.
This is SLOW!! - it's for debugging - don't keep it on all the time. If you want to access a specific
callback then please create an issue on github and I'll add it!
Params are : [Callback Type] [Callback Contents] [server]
Called if an exception happens during a callback/callresult.
This is needed because the exception isn't always accessible when running
async.. and can fail silently. With this hooked you won't be stuck wondering
what happened.
This gets called from Client/Server Init
It's important to switch to the manual dispatcher
Make sure we don't call Frame in a callback - because that'll cause some issues for everyone.
Calls RunFrame and processes events from this Steam Pipe
To be safe we don't call the continuation functions while iterating
the Callback list. This is maybe overly safe because the only way this
could be an issue is if the callback list is modified in the continuation
which would only happen if starting or shutting down in the callback.
A callback is a general global message
Given a callback, try to turn it into a string
A result is a reply to a specific command
Pumps the queue in an async loop so we don't
have to think about it. This has the advantage that
you can call .Wait() on async shit and it still works.
Pumps the queue in an async loop so we don't
have to think about it. This has the advantage that
you can call .Wait() on async shit and it still works.
Watch for a steam api call
Install a global callback. The passed function will get called if it's all good.
The score is just a simple numerical value
The score represents a time, in seconds
The score represents a time, in milliseconds
The top-score is the lowest number
The top-score is the highest number
Send the message unreliably. Can be lost. Messages *can* be larger than a
single MTU (UDP packet), but there is no retransmission, so if any piece
of the message is lost, the entire message will be dropped.
The sending API does have some knowledge of the underlying connection, so
if there is no NAT-traversal accomplished or there is a recognized adjustment
happening on the connection, the packet will be batched until the connection
is open again.
Disable Nagle's algorithm.
By default, Nagle's algorithm is applied to all outbound messages. This means
that the message will NOT be sent immediately, in case further messages are
sent soon after you send this, which can be grouped together. Any time there
is enough buffered data to fill a packet, the packets will be pushed out immediately,
but partially-full packets not be sent until the Nagle timer expires.
If the message cannot be sent very soon (because the connection is still doing some initial
handshaking, route negotiations, etc), then just drop it. This is only applicable for unreliable
messages. Using this flag on reliable messages is invalid.
Reliable message send. Can send up to 0.5mb in a single message.
Does fragmentation/re-assembly of messages under the hood, as well as a sliding window for
efficient sends of large chunks of data.
Return a NetIdentity that represents LocalHost
Return true if this identity is localhost
Convert to a SteamId
Set the specified Address
Automatically convert to a SteamId
Returns NULL if we're not a SteamId
Returns NULL if we're not a NetAddress
We override tostring to provide a sensible representation
The Port. This is redundant documentation.
Any IP, specific port
Localhost IP, specific port
Specific IP, specific port
Specific IP, specific port
Set everything to zero
Return true if the IP is ::0. (Doesn't check port.)
Return true if IP is mapped IPv4
Return true if IP is a fake IPv4 for Steam Datagram Relay
Return true if this identity is localhost. (Either IPv6 ::1, or IPv4 127.0.0.1)
Get the Address section
Used as a base to create your client connection. This creates a socket
to a single connection.
You can override all the virtual functions to turn it into what you
want it to do.
Accept an incoming connection that has been received on a listen socket.
Disconnects from the remote host and invalidates the connection handle. Any unread data on the connection is discarded..
reasonCode is defined and used by you.
Get/Set connection user data
A name for the connection, used mostly for debugging
This is the best version to use.
Ideally should be using an IntPtr version unless you're being really careful with the byte[] array and
you're not creating a new one every frame (like using .ToArray())
Ideally should be using an IntPtr version unless you're being really careful with the byte[] array and
you're not creating a new one every frame (like using .ToArray())
This creates a ton of garbage - so don't do anything with this beyond testing!
Flush any messages waiting on the Nagle timer and send them at the next transmission
opportunity (often that means right now).
Returns detailed connection stats in text format. Useful
for dumping to a log, etc.
Plain text connection info
Returns a small set of information about the real-time state of the connection.
Configure multiple outbound messages streams ("lanes") on a connection, and
control head-of-line blocking between them.
Describe the state of a connection
High level state of the connection
Remote address. Might be all 0's if we don't know it, or if this is N/A.
Who is on the other end? Depending on the connection type and phase of the connection, we might not know
Basic cause of the connection termination or problem.
Describe the status of a connection
Number of bytes unreliable data pending to be sent. This is data that you have recently requested to be sent but has not yet actually been put on the wire.
Number of bytes reliable data pending to be sent. This is data that you have recently requested to be sent but has not yet actually been put on the wire.
Number of bytes of reliable data that has been placed the wire, but for which we have not yet received an acknowledgment, and thus we may have to re-transmit.
Describe the status of a connection
Current ping (ms)
Outgoing packets per second
Outgoing bytes per second
Incoming packets per second
Incoming bytes per second
Connection quality measured locally, 0...1 (percentage of packets delivered end-to-end in order).
Packet delivery success rate as observed from remote host, 0...1 (percentage of packets delivered end-to-end in order).
Number of bytes unreliable data pending to be sent. This is data that you have recently requested to be sent but has not yet actually been put on the wire.
Number of bytes reliable data pending to be sent. This is data that you have recently requested to be sent but has not yet actually been put on the wire.
Number of bytes of reliable data that has been placed the wire, but for which we have not yet received an acknowledgment, and thus we may have to re-transmit.
Object that describes a "location" on the Internet with sufficient
detail that we can reasonably estimate an upper bound on the ping between
the two hosts, even if a direct route between the hosts is not possible,
and the connection must be routed through the Steam Datagram Relay network.
This does not contain any information that identifies the host. Indeed,
if two hosts are in the same building or otherwise have nearly identical
networking characteristics, then it's valid to use the same location
object for both of them.
NOTE: This object should only be used in the same process! Do not serialize it,
send it over the wire, or persist it in a file or database! If you need
to do that, convert it to a string representation using the methods in
ISteamNetworkingUtils().
Estimate the round-trip latency between two arbitrary locations, in
milliseconds. This is a conservative estimate, based on routing through
the relay network. For most basic relayed connections, this ping time
will be pretty accurate, since it will be based on the route likely to
be actually used.
If a direct IP route is used (perhaps via NAT traversal), then the route
will be different, and the ping time might be better. Or it might actually
be a bit worse! Standard IP routing is frequently suboptimal!
But even in this case, the estimate obtained using this method is a
reasonable upper bound on the ping time. (Also it has the advantage
of returning immediately and not sending any packets.)
In a few cases we might not able to estimate the route. In this case
a negative value is returned. k_nSteamNetworkingPing_Failed means
the reason was because of some networking difficulty. (Failure to
ping, etc) k_nSteamNetworkingPing_Unknown is returned if we cannot
currently answer the question for some other reason.
Do you need to be able to do this from a backend/matchmaking server?
You are looking for the "ticketgen" library.
Destroy a listen socket. All the connections that were accepting on the listen
socket are closed ungracefully.
Represents a Steam Achievement.
Gets whether or not the achievement has been unlocked.
Gets the identifier of the achievement. This is the "API Name" on Steamworks.
Gets the display name of the achievement.
Gets the description of the achievement.
If is , this value represents the time that the achievement was unlocked.
Gets the icon of the achievement. This can return a null image even though the image exists if the image
hasn't been downloaded by Steam yet. You should use if you want to wait for the image to be downloaded.
Gets the icon of the achievement, yielding until the icon is received or the is reached.
The timeout in milliseconds before the request will be canceled. Defaults to 5000.
Gets a decimal (0-1) representing the global amount of users who have unlocked the specified achievement, or -1 if no data available.
Unlock this achievement.
Reset this achievement to be locked.
Provides information about a DLC.
The of the DLC.
The name of the DLC.
Whether or not the DLC is available.
Represents download progress.
Whether or not the download is currently active.
How many bytes have been downloaded.
How many bytes in total the download is.
Gets the amount of bytes left that need to be downloaded.
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.
appid generating playtime
is duration control applicable to user + game combination
playtime since most recent 5 hour gap in playtime, only counting up to regulatory limit of playtime, in seconds
playtime on current calendar day
recommended progress
Represents details of a file.
The size of the file in bytes.
Returns the color of the pixel at the specified position.
X-coordinate
Y-coordinate
The color.
If the X and Y or out of bounds.
Returns "{Width}x{Height} ({length of }bytes)"
Represents a color.
the name of a leaderboard
Submit your score and replace your old score even if it was better
Submit your new score, but won't replace your high score if it's lower
Attaches a piece of user generated content the user's entry on a leaderboard
Fetches leaderboard entries for an arbitrary set of users on a specified leaderboard.
Used to query for a sequential range of leaderboard entries by leaderboard Sort.
Used to retrieve leaderboard entries relative a user's entry. If there are not enough entries in the leaderboard
before or after the user's entry, Steam will adjust the range to try to return the number of entries requested.
For example, if the user is #1 on the leaderboard and start is set to -2, end is set to 2, Steam will return the first
5 entries in the leaderboard. If The current user has no entry, this will return null.
Used to retrieve all leaderboard entries for friends of the current user
Represents a Steam lobby.
Try to join this room. Will return on success,
and anything else is a failure.
Leave a lobby; this will take effect immediately on the client side
other users in the lobby will be notified by a LobbyChatUpdate_t callback
Invite another user to the lobby.
Will return if the invite is successfully sent, whether or not the target responds
returns if the local user is not connected to the Steam servers
Gets the number of users in this lobby.
Returns current members in the lobby. The current user must be in the lobby in order to see the users.
Get data associated with this lobby.
Set data associated with this lobby.
Removes a metadata key from the lobby.
Get all data for this lobby.
Gets per-user metadata for someone in this lobby.
Sets per-user metadata (for the local user implicitly).
Sends a string to the chat room.
Sends bytes to the chat room.
Sends bytes to the chat room from an unsafe buffer.
Refreshes metadata for a lobby you're not necessarily in right now.
You never do this for lobbies you're a member of, only if your
this will send down all the metadata associated with a lobby.
This is an asynchronous call.
Returns if the local user is not connected to the Steam servers.
Results will be returned by a LobbyDataUpdate_t callback.
If the specified lobby doesn't exist, LobbyDataUpdate_t::m_bSuccess will be set to .
Max members able to join this lobby. Cannot be over 250.
Can only be set by the owner of the lobby.
Sets the lobby as public.
Sets the lobby as private.
Sets the lobby as invisible.
Sets the lobby as friends only.
Set whether or not the lobby can be joined.
Whether or not the lobby can be joined.
[SteamID variant]
Allows the owner to set the game server associated with the lobby. Triggers the
Steammatchmaking.OnLobbyGameCreated event.
[IP/Port variant]
Allows the owner to set the game server associated with the lobby. Triggers the
Steammatchmaking.OnLobbyGameCreated event.
Gets the details of the lobby's game server, if set. Returns true if the lobby is
valid and has a server set, otherwise returns false.
Gets or sets the owner of the lobby. You must be the lobby owner to set the owner
Check if the specified SteamId owns the lobby.
only lobbies in the same immediate region will be returned
only lobbies in the same immediate region will be returned
only lobbies in the same immediate region will be returned
Filter by specified key/value pair; string parameters
Numerical filter where value is less than the value provided
Numerical filter where value is greater than the value provided
Numerical filter where value must be equal to the value provided
Numerical filter where value must not equal the value provided
Test key, initialize numerical filter list if necessary, then add new numerical filter
Order filtered results according to key/values nearest the provided key/value pair.
Can specify multiple near value filters; each successive filter is lower priority than the previous.
returns only lobbies with the specified number of slots available
sets how many results to return, the lower the count the faster it is to download the lobby results
Run the query, get the matching lobbies
A server query packet.
Target IP address
Target port
This data is pooled. Make a copy if you don't use it immediately.
This buffer is also quite large - so pay attention to Size.
Size of the data
Represents a RemotePlaySession from the SteamRemotePlay interface
Returns true if this session was valid when created. This will stay true even
after disconnection - so be sure to watch SteamRemotePlay.OnSessionDisconnected
Get the SteamID of the connected user
Get the name of the session client device
Get the name of the session client device
Represents a screenshot that was taken by a user.
Tags a user as being visible in the screenshot
Sets the location of the screenshot.
Gets the individual tags for this server
Add this server to our history list
If we're already in the history list, weill set the last played time to now
If this server responds to source engine style queries, we'll be able to get a list of rules here
Remove this server from our history list
Add this server to our favourite list
Remove this server from our favourite list
Read gameserveritem_t.m_bHadSuccessfulResponse without allocating the struct on the heap
An optional interface to use instead of deriving
The actual connection we're managing
The last received ConnectionInfo
We're trying to connect!
Client is connected. They move from connecting to Connections
The connection has been closed remotely or disconnected locally. Check data.State for details.
Sends a message to multiple connections.
The connections to send the message to.
The number of connections to send the message to, to allow reusing the connections array.
Pointer to the message data.
Size of the message data.
Flags to control delivery of the message.
An optional array to hold the results of sending the messages for each connection.
Ideally should be using an IntPtr version unless you're being really careful with the byte[] array and
you're not creating a new one every frame (like using .ToArray())
Ideally should be using an IntPtr version unless you're being really careful with the byte[] array and
you're not creating a new one every frame (like using .ToArray())
This creates a ton of garbage - so don't do anything with this beyond testing!
We started connecting to this guy
Called when the connection is fully connected and can start being communicated with
We got disconnected
Received a message
Must call Accept or Close on the connection within a second or so
Called when the connection is fully connected and can start being communicated with
Called when the connection leaves. Must call Close on the connection
Received a message from a connection
Used as a base to create your networking server. This creates a socket
and listens/communicates with multiple queries.
You can override all the virtual functions to turn it into what you
want it to do.
Default behaviour is to accept every connection
Client is connected. They move from connecting to Connections
The connection has been closed remotely or disconnected locally. Check data.State for details.
Which app we're querying. Defaults to the current app.
When a new server is added, this function will get called
Called for every responsive server
A list of servers that responded. If you're only interested in servers that responded since you
last updated, then simply clear this list.
A list of servers that were in the master list but didn't respond.
Query the server list. Task result will be true when finished
Exposes a wide range of information and actions for applications and Downloadable Content (DLC).
Posted after the user gains ownership of DLC and that DLC is installed.
Posted after the user gains executes a Steam URL with command line or query parameters
such as steam://run/appid//-commandline/?param1=value1(and)param2=value2(and)param3=value3 etc
while the game is already running. The new params can be queried
with GetLaunchQueryParam and GetLaunchCommandLine.
Gets whether or not the active user is subscribed to the current App ID.
Gets whether or not the user borrowed this game via Family Sharing. If true, call GetAppOwner() to get the lender SteamID.
Gets whether or not the license owned by the user provides low violence depots.
Low violence depots are useful for copies sold in countries that have content restrictions
Gets whether or not the current App ID license is for Cyber Cafes.
Gets whether or not the user has a VAC ban on their account.
Gets the current language that the user has set.
This falls back to the Steam UI language if the user hasn't explicitly picked a language for the title.
Gets a list of the languages the current app supports.
Gets whether or not the active user is subscribed to a specified App ID.
Only use this if you need to check ownership of another game related to yours, a demo for example.
The App ID of the DLC to check.
Gets whether or not the user owns a specific DLC and if the DLC is installed.
The App ID of the DLC to check.
Returns the time of the purchase of the app.
The App ID to check the purchase time for.
Checks if the user is subscribed to the current app through a free weekend.
This function will return false for users who have a retail or other type of license.
Before using, please ask your Valve technical contact how to package and secure your free weekened.
Returns metadata for all available DLC.
Install control for optional DLC.
The App ID of the DLC to install.
Uninstall control for optional DLC.
The App ID of the DLC to uninstall.
Gets the name of the beta branch that is launched, or if the application is not running on a beta branch.
Force verify game content on next launch.
If you detect the game is out-of-date (for example, by having the client detect a version mismatch with a server),
you can call MarkContentCorrupt to force a verify, show a message to the user, and then quit.
Whether or not to only verify missing files.
Gets a list of all installed depots for a given App ID in mount order.
The App ID.
Gets the install folder for a specific App ID.
This works even if the application is not installed, based on where the game would be installed with the default Steam library location.
The App ID.
Gets whether or not the app is owned by the current user. The app may not actually be owned by the current user; they may have it left over from a free weekend, etc.
The App ID.
Gets the Steam ID of the original owner of the current app. If it's different from the current user then it is borrowed.
Gets the associated launch parameter if the game is run via steam://run/appid/?param1=value1;param2=value2;param3=value3 etc.
Parameter names starting with the character '@' are reserved for internal use and will always return an empty string.
Parameter names starting with an underscore '_' are reserved for steam features -- they can be queried by the game,
but it is advised that you not param names beginning with an underscore for your own features.
The name of the parameter.
The launch parameter value.
Gets the download progress for optional DLC.
The App ID to check the progress for.
Gets the Build ID of this app, which can change at any time based on backend updates to the game.
Defaults to 0 if you're not running a build downloaded from steam.
Asynchronously retrieves metadata details about a specific file in the depot manifest.
The name of the file.
Get command line if game was launched via Steam URL, e.g. steam://run/appid//command line/.
This method of passing a connect string (used when joining via rich presence, accepting an
invite, etc) is preferable to passing the connect string on the operating system command
line, which is a security risk. In order for rich presence joins to go through this
path and not be placed on the OS command line, you must set a value in your app's
configuration on Steam. Ask Valve for help with this.
Check if game is a timed trial with limited playtime.
The amount of seconds left on the timed trial.
The amount of seconds played on the timed trial.
Initialize the steam client.
If is false you need to call manually every frame.
Check if Steam is loaded and accessible.
Shuts down the steam client.
Checks if the current user's Steam client is connected to the Steam servers.
If it's not, no real-time services provided by the Steamworks API will be enabled. The Steam
client will automatically be trying to recreate the connection as often as possible. When the
connection is restored a SteamServersConnected_t callback will be posted.
You usually don't need to check for this yourself. All of the API calls that rely on this will
check internally. Forcefully disabling stuff when the player loses access is usually not a
very good experience for the player and you could be preventing them from accessing APIs that do not
need a live connection to Steam.
Gets the Steam ID of the account currently logged into the Steam client. This is
commonly called the 'current user', or 'local user'.
A Steam ID is a unique identifier for a Steam accounts, Steam groups, Lobbies and Chat
rooms, and used to differentiate users in all parts of the Steamworks API.
returns the local players name - guaranteed to not be .
This is the same name as on the user's community profile page.
Gets the status of the current user.
Returns the App ID of the current process.
Checks if your executable was launched through Steam and relaunches it through Steam if it wasn't.
This returns true then it starts the Steam client if required and launches your game again through it,
and you should quit your process as soon as possible. This effectively runs steam://run/AppId so it
may not relaunch the exact executable that called it, as it will always relaunch from the version
installed in your Steam library folder/
Note that during development, when not launching via Steam, this might always return true.
Called in interfaces that rely on this being initialized
Class for utilizing the Steam Friends API.
Invoked when a chat message has been received from a friend. You'll need to enable
to recieve this. (friend, msgtype, message)
Invoked when a chat message has been received in a Steam group chat that we are in. Associated Functions: JoinClanChatRoom. (friend, msgtype, message)
Invoked when a friends' status changes.
Invoked when the user tries to join a game from their friends list.
Rich presence will have been set with the "connect" key which is set here.
Invoked when game overlay activates or deactivates.
The game can use this to be pause or resume single player games.
Invoked when the user tries to join a different game server from their friends list.
Game client should attempt to connect to specified server when this is received.
Invoked when the user tries to join a lobby from their friends list.
Game client should attempt to connect to specified lobby when this is received.
Invoked when a friend's rich presence data is updated.
Invoked when an overlay browser instance is navigated to a
protocol/scheme registered by .
Gets an of friends that the current user has.
An of friends.
Gets an of blocked users that the current user has.
An of blocked users.
Gets an of friend requests that the current user has.
An of friend requests.
Opens a specific overlay window. Valid options are:
"friends",
"community",
"players",
"settings",
"officialgamegroup",
"stats",
"achievements".
"steamid" - Opens the overlay web browser to the specified user or groups profile.
"chat" - Opens a chat window to the specified user, or joins the group chat.
"jointrade" - Opens a window to a Steam Trading session that was started with the ISteamEconomy/StartTrade Web API.
"stats" - Opens the overlay web browser to the specified user's stats.
"achievements" - Opens the overlay web browser to the specified user's achievements.
"friendadd" - Opens the overlay in minimal mode prompting the user to add the target user as a friend.
"friendremove" - Opens the overlay in minimal mode prompting the user to remove the target friend.
"friendrequestaccept" - Opens the overlay in minimal mode prompting the user to accept an incoming friend invite.
"friendrequestignore" - Opens the overlay in minimal mode prompting the user to ignore an incoming friend invite.
Activates the Steam Overlay to the Steam store page for the provided app.
Activates Steam Overlay web browser directly to the specified URL.
Activates the Steam Overlay to open the invite dialog. Invitations sent from this dialog will be for the provided lobby.
Mark a target user as 'played with'.
NOTE: The current user must be in game with the other player for the association to work.
Requests the persona name and optionally the avatar of a specified user.
NOTE: It's a lot slower to download avatars and churns the local cache, so if you don't need avatars, don't request them.
returns true if we're fetching the data, false if we already have it
Returns a small avatar of the user with the given .
The of the user to get.
A with a value if the image was successfully retrieved.
Returns a medium avatar of the user with the given .
The of the user to get.
A with a value if the image was successfully retrieved.
Returns a large avatar of the user with the given .
The of the user to get.
A with a value if the image was successfully retrieved.
Find a rich presence value by key for current user. Will be null if not found.
Sets a rich presence value by key for current user.
Clears all of the current user's rich presence data.
Listens for Steam friends chat messages.
You can then show these chats inline in the game. For example with a Blizzard style chat message system or the chat system in Dota 2.
After enabling this you will receive callbacks when ever the user receives a chat message.
Gets whether or not the current user is following the user with the given .
The to check.
Boolean.
Call this before calling ActivateGameOverlayToWebPage() to have the Steam Overlay Browser block navigations
to your specified protocol (scheme) uris and instead dispatch a OverlayBrowserProtocolNavigation callback to your game.
Class for utilizing Steam Input.
You shouldn't really need to call this because it gets called by
but Valve think it might be a nice idea if you call it right before you get input info -
just to make sure the info you're getting is 100% up to date.
Gets a list of connected controllers.
Return an absolute path to the PNG image glyph for the provided digital action name. The current
action set in use for the controller will be used for the lookup. You should cache the result and
maintain your own list of loaded PNG assets.
Return an absolute path to the PNG image glyph for the provided digital action name. The current
action set in use for the controller will be used for the lookup. You should cache the result and
maintain your own list of loaded PNG assets.
Return an absolute path to the SVF image glyph for the provided digital action name. The current
action set in use for the controller will be used for the lookup. You should cache the result and
maintain your own list of loaded PNG assets.
Class for utilizing the Steam Inventory API.
Call this if you're going to want to access definition information. You should be able to get
away with calling this once at the start if your game, assuming your items don't change all the time.
This will trigger at which point Definitions should be set.
Will call and wait until Definitions is not null
Try to find the definition that matches this definition ID.
Uses a dictionary so should be about as fast as possible.
We will try to keep this list of your items automatically up to date.
Update the list of Items[]
Get all items and return the InventoryResult
This is used to grant a specific item to the user. This should
only be used for development prototyping, from a trusted server,
or if you don't care about hacked clients granting arbitrary items.
This call can be disabled by a setting on Steamworks.
Crafting! Uses the passed items to buy the target item.
You need to have set up the appropriate exchange rules in your item
definitions. This assumes all the items passed in aren't stacked.
Crafting! Uses the passed items to buy the target item.
You need to have set up the appropriate exchange rules in your item
definitions. This assumes all the items passed in aren't stacked.
Deserializes a result set and verifies the signature bytes.
This call has a potential soft-failure mode where the Result is expired, it will
still succeed in this mode.The "expired"
result could indicate that the data may be out of date - not just due to timed
expiration( one hour ), but also because one of the items in the result set may
have been traded or consumed since the result set was generated.You could compare
the timestamp from GetResultTimestamp to ISteamUtils::GetServerRealTime to determine
how old the data is. You could simply ignore the "expired" result code and
continue as normal, or you could request the player with expired data to send
an updated result set.
You should call CheckResultSteamID on the result handle when it completes to verify
that a remote player is not pretending to have a different user's inventory.
Grant all promotional items the user is eligible for.
Trigger an item drop for this user. This is for timed drops.
Trigger a promo item drop. You can call this at startup, it won't
give users multiple promo drops.
Start buying a cart load of items. This will return a positive result is the purchase has
begun. You should listen out for SteamUser.OnMicroTxnAuthorizationResponse for a success.
Methods for clients to access matchmaking services, favorites, and to operate on game lobbies
Maximum number of characters a lobby metadata key can be
Invoked when the current user is invited to a lobby.
Invoked when the current user joins a lobby.
Invoked when the current user creates a lobby.
Invoked when a game server has been associated with a lobby.
Invoked when a lobby's metadata is modified.
Invoked when a member in a lobby's metadata is modified.
Invoked when a member joins a lobby.
Invoked when a lobby member leaves the lobby.
Invoked when a lobby member leaves the lobby.
Invoked when a lobby member is kicked from a lobby. The 3rd param is the user that kicked them.
Invoked when a lobby member is kicked from a lobby. The 3rd param is the user that kicked them.
Invoked when a chat message is received from a member of the lobby.
Creates a new invisible lobby. Call to take it online.
Attempts to directly join the specified lobby.
Get a list of servers that are on the current user's favorites list.
Get a list of servers that the current user has added to their history.
Methods for clients to access matchmaking services, favorites, and to operate on game lobbies
Functions to control music playback in the steam client.
This gives games the opportunity to do things like pause the music or lower the volume,
when an important cut scene is shown, and start playing afterwards.
Nothing uses Steam Music though so this can probably get fucked
Invoked when playback status is changed.
Invoked when the volume of the music player is changed.
Checks if Steam Music is enabled.
if a song is currently playing, paused, or queued up to play; otherwise .
Gets the current status of the Steam Music player
Plays the music player.
Pauses the music player.
Forces the music player to play the previous song.
Forces the music player to skip to the next song.
Gets and sets the current volume of the Steam Music player
Class for utilizing the Steam Network API.
Invoked when a wants to send the current user a message. You should respond by calling
if you want to recieve their messages.
Invoked when packets can't get through to the specified user.
All queued packets unsent at this point will be dropped, further attempts
to send will retry making the connection (but will be dropped if we fail again).
This should be called in response to a .
Allow or disallow P2P connects to fall back on Steam server relay if direct
connection or NAT traversal can't be established. Applies to connections
created after setting or old connections that need to reconnect.
This should be called when you're done communicating with a user, as this will
free up all of the resources allocated for the connection under-the-hood.
If the remote user tries to send data to you again, a new
callback will be posted
Checks if a P2P packet is available to read.
Checks if a P2P packet is available to read, and gets the size of the message if there is one.
Reads in a packet that has been sent from another user via SendP2PPacket.
Reads in a packet that has been sent from another user via SendP2PPacket.
Reads in a packet that has been sent from another user via SendP2PPacket.
Sends a P2P packet to the specified user.
This is a session-less API which automatically establishes NAT-traversing or Steam relay server connections.
NOTE: The first packet send may be delayed as the NAT-traversal code runs.
Sends a P2P packet to the specified user.
This is a session-less API which automatically establishes NAT-traversing or Steam relay server connections.
NOTE: The first packet send may be delayed as the NAT-traversal code runs.
Get the identity assigned to this interface.
E.g. on Steam, this is the user's SteamID, or for the gameserver interface, the SteamID assigned
to the gameserver. Returns false and sets the result to an invalid identity if we don't know
our identity yet. (E.g. GameServer has not logged in. On Steam, the user will know their SteamID
even if they are not signed into Steam.)
Creates a "server" socket that listens for clients to connect to by calling
Connect, over ordinary UDP (IPv4 or IPv6)
To use this derive a class from and override as much as you want.
Creates a "server" socket that listens for clients to connect to by calling
Connect, over ordinary UDP (IPv4 or IPv6).
To use this you should pass a class that inherits . You can use
SocketManager to get connections and send messages, but the ISocketManager class
will received all the appropriate callbacks.
Connect to a socket created via CreateListenSocketIP.
Connect to a socket created via CreateListenSocketIP.
Creates a server that will be relayed via Valve's network (hiding the IP and improving ping).
To use this derive a class from and override as much as you want.
Creates a server that will be relayed via Valve's network (hiding the IP and improving ping).
To use this you should pass a class that inherits . You can use
to get connections and send messages, but the class
will received all the appropriate callbacks.
Connect to a relay server.
Connect to a relay server.
Begin asynchronous process of allocating a fake IPv4 address that other
peers can use to contact us via P2P. IP addresses returned by this
function are globally unique for a given appid.
For gameservers, you *must* call this after initializing the SDK but before
beginning login. Steam needs to know in advance that FakeIP will be used.
Return info about the FakeIP and port that we have been assigned, if any.
Creates a server that will be relayed via Valve's network (hiding the IP and improving ping).
To use this derive a class from and override as much as you want.
Creates a server that will be relayed via Valve's network (hiding the IP and improving ping).
To use this you should pass a class that inherits . You can use
to get connections and send messages, but the class
will received all the appropriate callbacks.
Provides Steam Networking utilities.
A function to receive debug network information on. This will do nothing
unless you set to something other than .
You should set this to an appropriate level instead of setting it to the highest
and then filtering it by hand because a lot of energy is used by creating the strings
and your frame rate will tank and you won't know why.
The latest available status gathered from the SteamRelayNetworkStatus callback
If you know that you are going to be using the relay network (for example,
because you anticipate making P2P connections), call this to initialize the
relay network. If you do not call this, the initialization will
be delayed until the first time you use a feature that requires access
to the relay network, which will delay that first access.
You can also call this to force a retry if the previous attempt has failed.
Performing any action that requires access to the relay network will also
trigger a retry, and so calling this function is never strictly necessary,
but it can be useful to call it a program launch time, if access to the
relay network is anticipated.
Use GetRelayNetworkStatus or listen for SteamRelayNetworkStatus_t
callbacks to know when initialization has completed.
Typically initialization completes in a few seconds.
Note: dedicated servers hosted in known data centers do *not* need
to call this, since they do not make routing decisions. However, if
the dedicated server will be using P2P functionality, it will act as
a "client" and this should be called.
Return location info for the current host.
It takes a few seconds to initialize access to the relay network. If
you call this very soon after startup the data may not be available yet.
This always return the most up-to-date information we have available
right now, even if we are in the middle of re-calculating ping times.
Same as PingLocation.EstimatePingTo, but assumes that one location is the local host.
This is a bit faster, especially if you need to calculate a bunch of
these in a loop to find the fastest one.
If you need ping information straight away, wait on this. It will return
immediately if you already have up to date ping data.
[0 - 100] - Randomly discard N pct of packets.
[0 - 100] - Randomly discard N pct of packets.
Delay all packets by N ms.
Delay all packets by N ms.
Timeout value (in ms) to use when first connecting.
Timeout value (in ms) to use after connection is established.
Upper limit of buffered pending bytes to be sent.
If this is reached SendMessage will return LimitExceeded.
Default is 524288 bytes (512k).
Minimum send rate clamp, 0 is no limit.
This value will control the min allowed sending rate that
bandwidth estimation is allowed to reach. Default is 0 (no-limit)
Maximum send rate clamp, 0 is no limit.
This value will control the max allowed sending rate that
bandwidth estimation is allowed to reach. Default is 0 (no-limit)
Nagle time, in microseconds. When SendMessage is called, if
the outgoing message is less than the size of the MTU, it will be
queued for a delay equal to the Nagle timer value. This is to ensure
that if the application sends several small messages rapidly, they are
coalesced into a single packet.
See historical RFC 896. Value is in microseconds.
Default is 5000us (5ms).
Don't automatically fail IP connections that don't have
strong auth. On clients, this means we will attempt the connection even if
we don't know our identity or can't get a cert. On the server, it means that
we won't automatically reject a connection due to a failure to authenticate.
(You can examine the incoming connection and decide whether to accept it.)
This is a dev configuration value, and you should not let users modify it in
production.
Allow unencrypted (and unauthenticated) communication.
0: Not allowed (the default)
1: Allowed, but prefer encrypted
2: Allowed, and preferred
3: Required. (Fail the connection if the peer requires encryption.)
This is a dev configuration value, since its purpose is to disable encryption.
You should not let users modify it in production. (But note that it requires
the peer to also modify their value in order for encryption to be disabled.)
Log RTT calculations for inline pings and replies.
Log SNP packets send.
Log each message send/recv.
Log dropped packets.
Log P2P rendezvous messages.
Log ping relays.
Get Debug Information via event.
Except when debugging, you should only use
or . For best performance, do NOT
request a high detail level and then filter out messages in the callback.
This incurs all of the expense of formatting the messages, which are then discarded.
Setting a high priority value (low numeric value) here allows the library to avoid
doing this work.
So we can remember and provide a Get for DebugLevel.
We need to keep the delegate around until it's not used anymore.
This can be called from other threads - so we're going to queue these up and process them in a safe place.
Called regularly from the Dispatch loop so we can provide a timely
stream of messages.
Undocumented Parental Settings
Parental Settings Changed
This API can be used to selectively advertise your multiplayer game session in a Steam chat room group.
Tell Steam the number of player spots that are available for your party, and a join-game string, and it
will show a beacon in the selected group and allow that many users to “follow” the beacon to your party.
Adjust the number of open slots if other players join through alternate matchmaking methods.
Invoked when the list of possible Party beacon locations has changed
Invoked when the list of active beacons may have changed
Gets the amount of beacons that are active.
Gets an of active beacons.
Functions that provide information about Steam Remote Play sessions, streaming your game content to another computer or to a Steam Link app or hardware.
Invoked when a session is connected.
Invoked when a session becomes disconnected.
Gets the number of currently connected Steam Remote Play sessions
Get the currently connected Steam Remote Play session ID at the specified index.
IsValid will return if it's out of bounds
Invite a friend to Remote Play Together.
This returns if the invite can't be sent
Class for utilizing the Steam Remote Storage API.
Creates a new file, writes the bytes to the file, and then closes the file.
If the target file already exists, it is overwritten
The path of the file.
The bytes of data.
A boolean, detailing whether or not the operation was successful.
Opens a binary file, reads the contents of the file into a byte array, and then closes the file.
The path of the file.
Checks whether the specified file exists.
The path of the file.
Whether or not the file exists.
Checks if a specific file is persisted in the steam cloud.
The path of the file.
Boolean.
Gets the specified file's last modified date/time.
The path of the file.
A describing when the file was modified last.
Returns the specified files size in bytes, or 0 if the file does not exist.
The path of the file.
The size of the file in bytes, or 0 if the file doesn't exist.
Deletes the file from remote storage, but leaves it on the local disk and remains accessible from the API.
A boolean, detailing whether or not the operation was successful.
Deletes a file from the local disk, and propagates that delete to the cloud.
Gets the total number of quota bytes.
Gets the total number of quota bytes that have been used.
Number of bytes remaining until the quota is used.
returns if AND are .
Checks if the account wide Steam Cloud setting is enabled for this user
or if they disabled it in the Settings->Cloud dialog.
Checks if the per game Steam Cloud setting is enabled for this user
or if they disabled it in the Game Properties->Update dialog.
This must only ever be set as the direct result of the user explicitly
requesting that it's enabled or not. This is typically accomplished with
a checkbox within your in-game options
Gets the total number of local files synchronized by Steam Cloud.
Gets a list of filenames synchronized by Steam Cloud.
Class for utilizing the Steam Screenshots API.
Invoked when a screenshot has been requested by the user from the Steam screenshot hotkey.
This will only be called if is true, in which case Steam
will not take the screenshot itself.
Invoked when a screenshot has been successfully written or otherwise added to the library and can now be tagged.
Invoked when a screenshot attempt failed.
Writes a screenshot to the user's screenshot library given the raw image data, which must be in RGB format.
The return value is a handle that is valid for the duration of the game process and can be used to apply tags.
Adds a screenshot to the user's screenshot library from disk. If a thumbnail is provided, it must be 200 pixels wide and the same aspect ratio
as the screenshot, otherwise a thumbnail will be generated if the user uploads the screenshot. The screenshots must be in either JPEG or TGA format.
The return value is a handle that is valid for the duration of the game process and can be used to apply tags.
JPEG, TGA, and PNG formats are supported.
Causes the Steam overlay to take a screenshot.
If screenshots are being hooked by the game then a
callback is sent back to the game instead.
Toggles whether the overlay handles screenshots when the user presses the screenshot hotkey, or if the game handles them.
Hooking is disabled by default, and only ever enabled if you do so with this function.
If the hooking is enabled, then the callback will be sent if the user presses the hotkey or
when TriggerScreenshot is called, and then the game is expected to call or in response.
Provides the core of the Steam Game Servers API
Invoked when aser has been authed or rejected
Invoked when a connection to the Steam back-end has been established.
This means the server now is logged on and has a working connection to the Steam master server.
This will occur periodically if the Steam client is not connected, and has failed when retrying to establish a connection (result, stilltrying).
Invoked when the server is disconnected from Steam
Invoked when authentication status changes, useful for grabbing once availability is current.
Initialize the steam server.
If is you need to call manually every frame.
Run the callbacks. This is also called in Async callbacks.
Sets whether this should be marked as a dedicated server.
If not, it is assumed to be a listen server.
Gets or sets the current MaxPlayers.
This doesn't enforce any kind of limit, it just updates the master server.
Gets or sets the current BotCount.
This doesn't enforce any kind of limit, it just updates the master server.
Gets or sets the current Map Name.
Gets or sets the current ModDir.
Gets the current product.
Gets or sets the current Product.
Gets or sets the current ServerName.
Set whether the server should report itself as passworded.
Gets or sets the current GameTags. This is a comma seperated list of tags for this server.
When querying the server list you can filter by these tags.
Gets the SteamId of the server.
Log onto Steam anonymously.
Log off of Steam.
Returns true if the server is connected and registered with the Steam master server
You should have called etc on startup.
To the best of its ability this tries to get the server's
current public IP address. Be aware that this is likely to return
for the first few seconds after initialization.
Enable or disable heartbeats, which are sent regularly to the master server.
Enabled by default.
Enable or disable heartbeats, which are sent regularly to the master server.
Enabled by default.
Force send a heartbeat to the master server instead of waiting
for the next automatic update (if you've left them enabled)
Update this connected player's information. You should really call this
any time a player's name or score changes. This keeps the information shown
to server queries up to date.
Sets a Key Value. These can be anything you like, and are accessible
when querying servers from the server list.
Information describing gamemodes are common here.
Remove all key values.
Start authorizing a ticket. This user isn't authorized yet. Wait for a call to OnAuthChange.
Forget this guy. They're no longer in the game.
If true, Steam wants to send a packet. You should respond by sending
this packet in an unconnected way to the returned Address and Port.
Packet to send. The Data passed is pooled - so use it immediately.
True if we want to send a packet
We have received a server query on our game port. Pass it to Steam to handle.
We have received a server query on our game port. Pass it to Steam to handle.
Does the user own this app (which could be DLC).
Downloads stats for the user.
If the user has no stats, this will return .
These stats will only be auto-updated for clients playing on the server.
The SteamId of the user to get stats for.
A task describing the progress and result of the download.
Set the named stat for this user. Setting stats should follow the rules
you defined in Steamworks.
The SteamId of the user to set stats for.
The name of the stat.
The value of the stat.
Set the named stat for this user. Setting stats should follow the rules
you defined in Steamworks.
The SteamId of the user to set stats for.
The name of the stat.
The value of the stat.
Get the named stat for this user. If getting the stat failed, will return
. You should have called for this SteamID - which downloads
the stats from the backend. If you didn't call it this will always return .
The SteamId of the user to get stats for.
The name of the stat.
The value to return if the stats cannot be received.
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.
The SteamId of the user to get stats for.
The name of the stat.
The value to return if the stats cannot be received.
Unlocks the specified achievement for the specified user. Must have called on a SteamID first.
Remember to use after use.
The SteamId of the user to unlock the achievement for.
The ID of the achievement.
Resets the unlock status of an achievement for the specified user. Must have called on a SteamID first.
Remember to use after use.
The SteamId of the user to clear the achievement for.
The ID of the achievement.
Return if available, exists and unlocked
Once you've set a stat change on a user you need to commit your changes.
You can do that using this method. The callback will let you know if
your action succeeded, but most of the time you can fire and forget.
The SteamId of the user to store stats for.
A task describing the progress and result of the commit.
Sets a description for the current game state in the timeline. These help the user to find specific moments in the timeline when saving clips. Setting a
new state description replaces any previous description.
Clears the previous set game state in the timeline.
Use this to mark an event on the Timeline. This event will be instantaneous. (See to add events that happened over time.)
Use this to mark an event on the Timeline that takes some amount of time to complete.
Use this to mark the start of an event on the Timeline that takes some amount of time to complete. The duration of the event is determined by a matching call
to . If the game wants to cancel an event in progress, they can do that with a call to .
Use this to update the details of an event that was started with .
Use this to identify the end of an event that was started with .
Use this to remove a Timeline event that was previously added.
Use this to determine if video recordings exist for the specified event. This can be useful when the game needs to decide whether or not to show a control
that will call .
Use this to start a game phase. Game phases allow the user to navigate their background recordings and clips. Exactly what a game phase means will vary game
to game, but the game phase should be a section of gameplay that is usually between 10 minutes and a few hours in length, and should be the main way a user
would think to divide up the game. These are presented to the user in a UI that shows the date the game was played, with one row per game slice. Game phases
should be used to mark sections of gameplay that the user might be interested in watching.
Use this to end a game phase that was started with .
The phase ID is used to let the game identify which phase it is referring to in calls to or
. It may also be used to associated multiple phases with each other.
A game-provided persistent ID for a game phase. This could be a the match ID in a multiplayer game, a chapter name in a single player game, the ID of a character, etc.
Use this to determine if video recordings exist for the specified game phase. This can be useful when the game needs to decide whether or not to show a control that will call .
Use this to add a game phase tag. Phase tags represent data with a well defined set of options, which could be data such as match resolution, hero played, game mode, etc. Tags can have an icon
in addition to a text name. Multiple tags within the same group may be added per phase and all will be remembered. For example, this may be called multiple times for a "Bosses Defeated" group,
with different names and icons for each boss defeated during the phase, all of which will be shown to the user.
Use this to add a game phase attribute. Phase attributes represent generic text fields that can be updated throughout the duration of the phase. They are meant to be used for phase metadata
that is not part of a well defined set of options. For example, a KDA attribute that starts with the value "0/0/0" and updates as the phase progresses, or something like a played-entered character
name. Attributes can be set as many times as the game likes with SetGamePhaseAttribute, and only the last value will be shown to the user.
Changes the color of the timeline bar. See for how to use each value.
Opens the Steam overlay to the section of the timeline represented by the game phase.
Opens the Steam overlay to the section of the timeline represented by the timeline event. This event must be in the current game session, since values are not
valid for future runs of the game.
Functions for accessing and manipulating Steam user information.
This is also where the APIs for Steam Voice are exposed.
Invoked after an item is downloaded.
Invoked when a new item is subscribed.
Start downloading this item. You'll get notified of completion via .
The ID of the file to download.
If this should go straight to the top of the download list.
if nothing went wrong and the download is started.
Will attempt to download this item asyncronously - allowing you to instantly react to its installation.
The ID of the file you download.
An optional callback
Allows to send a message to cancel the download anywhere during the process.
How often to call the progress function.
if downloaded and installed properly.
Utility function to fetch a single item. Internally this uses Ugc.FileQuery -
which you can use to query multiple items if you need to.
Suspends all workshop downloads.
Downloads will be suspended until you resume them by calling or when the game ends.
Resumes all workshop downloads.
Show the app's latest Workshop EULA to the user in an overlay window, where they can accept it or not.
Retrieve information related to the user's acceptance or not of the app's specific Workshop EULA.
Functions for accessing and manipulating Steam user information.
This is also where the APIs for Steam Voice are exposed.
Invoked 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.
Invoked 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.
Invoked when the client has lost connection to the Steam servers.
Real-time services will be disabled until a matching OnSteamServersConnected has been posted.
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.
Invoked whenever the users licenses (owned packages) changes.
Invoked when an auth ticket has been validated.
The first parameter is the of this user
The second is the that owns the game, which will be different from the first
if the game is being borrowed via Steam Family Sharing.
Used internally for .
Used internally for .
Invoked when a user has responded to a microtransaction authorization request.
( appid, orderid, user authorized )
Sent to your game in response to a steam://gamewebcallback/(appid)/command/stuff 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.
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.
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.
Returns true if we have voice data waiting to be read.
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.
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.
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.
Lazy version
Advanced and potentially fastest version - incase you know what you're doing
Retrieve an authentication ticket to be sent to the entity who wishes to authenticate you.
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 if the callback
times out or returns negatively.
Retrieve an authentication ticket to be sent to the entity who wishes to authenticate you.
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 if the callback
times out or returns negatively.
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.
Gets the Steam level of the user, as shown on their Steam community profile.
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 browser window.
NOTE: The resulting authorization cookie has an expiration time of one day, so it would be a good idea to request and visit a new auth URL every 12 hours.
Checks whether the current user has verified their phone number.
Checks whether the current user has Steam Guard two factor authentication enabled on their account.
Checks whether the user's phone number is used to uniquely identify them.
Checks whether the current user's phone number is awaiting (re)verification.
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.
If you get a null result from this it's probably because you're calling it too often.
This can fail if you don't have an encrypted ticket set for your app here https://partner.steamgames.com/apps/sdkauth/
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/
Get anti indulgence / duration control
Invoked when an achivement icon is loaded.
Invoked when the latests stats and achievements have been received
from the server.
Result of a request to store the user stats for a game.
Result of a request to store the achievements for a game, or an
"indicate progress" call. If both m_nCurProgress and m_nMaxProgress
are zero, that means the achievement has been fully unlocked.
Callback indicating that a user's stats have been unloaded
Get all available achievements.
Show the user a pop-up notification with the current progress toward an achievement.
Will return false if RequestCurrentStats has not completed and successfully returned
its callback, if the achievement doesn't exist/has unpublished changes in the app's
Steamworks Admin page, or if the achievement is unlocked.
Tries to get the number of players currently playing this game.
Or -1 if failed.
Send the changed stats and achievements data to the server for permanent storage.
If this fails then nothing is sent to the server. It's advisable to keep trying until the call is successful.
This call can be rate limited. Call frequency should be on the order of minutes, rather than seconds.You should only be calling this during major state changes such as the end of a round, the map changing, or the user leaving a server. This call is required to display the achievement unlock notification dialog though, so if you have called SetAchievement then it's advisable to call this soon after that.
If you have stats or achievements that you have saved locally but haven't uploaded with this function when your application process ends then this function will automatically be called.
You can find additional debug information written to the %steam_install%\logs\stats_log.txt file.
This function returns true upon success if :
RequestCurrentStats has completed and successfully returned its callback AND
the current game has stats associated with it in the Steamworks Partner backend, and those stats are published.
This call is no longer required as it is managed by the Steam client. The game stats and achievements
will be synchronized with Steam before the game process begins.
Asynchronously fetches global stats data, which is available for stats marked as
"aggregated" in the App Admin panel of the Steamworks website.
You must have called and it needs to return successfully via
its callback prior to calling this.
How many days of day-by-day history to retrieve in addition to the overall totals. The limit is 60.
indicates success, means you need to call first, means the remote call failed
Gets a leaderboard by name, it will create it if it's not yet created.
Leaderboards created with this function will not automatically show up in the Steam Community.
You must manually set the Community Name field in the App Admin panel of the Steamworks website.
As such it's generally recommended to prefer creating the leaderboards in the App Admin panel on
the Steamworks website and using FindLeaderboard unless you're expected to have a large amount of
dynamically created leaderboards.
Adds this amount to the named stat. Internally this calls Get() and adds
to that value. Steam doesn't provide a mechanism for atomically increasing
stats like this, this functionality is added here as a convenience.
Adds this amount to the named stat. Internally this calls Get() and adds
to that value. Steam doesn't provide a mechanism for atomically increasing
stats like this, this functionality is added here as a convenience.
Set a stat value. This will automatically call after a successful call.
Set a stat value. This will automatically call after a successful call.
Get an stat value.
Get a stat value.
Practically wipes the slate clean for this user. If is , will also wipe
any achievements too.
Interface which provides access to a range of miscellaneous utility functions
Invoked when the country of the user changed.
Invoked when running on a laptop and less than 10 minutes of battery is left, fires then every minute.
The parameter is the number of minutes left.
Invoked when Steam wants to shutdown.
Invoked when Big Picture gamepad text input has been closed. Parameter is if text was submitted, if cancelled etc.
Returns the number of seconds since the application was active.
Returns the number of seconds since the user last moved the mouse and/or provided other input.
Steam server time. Number of seconds since January 1, 1970, GMT (i.e unix time)
returns the 2 digit ISO 3166-1-alpha-2 format country code this client is running in (as looked up via an IP-to-location database)
e.g "US" or "UK".
Returns true if the image exists, and the buffer was successfully filled out.
Results are returned in RGBA format.
The destination buffer size should be 4 * height * width * sizeof(char).
returns the image in RGBA format.
Returns true if we're using a battery (ie, a laptop not plugged in).
Returns battery power [0-1].
Sets the position where the overlay instance for the currently calling game should show notifications.
This position is per-game and if this function is called from outside of a game context it will do nothing.
Returns true if the overlay is running and the user can access it. The overlay process could take a few seconds to
start and hook the game process, so this function will initially return false while the overlay is loading.
Normally this call is unneeded if your game has a constantly running frame loop that calls the
D3D Present API, or OGL SwapBuffers API every frame.
However, if you have a game that only refreshes the screen on an event driven basis then that can break
the overlay, as it uses your Present/SwapBuffers calls to drive it's internal frame loop and it may also
need to Present() to the screen any time an even needing a notification happens or when the overlay is
brought up over the game by a user. You can use this API to ask the overlay if it currently need a present
in that case, and then you can check for this periodically (roughly 33hz is desirable) and make sure you
refresh the screen with Present or SwapBuffers to allow the overlay to do it's work.
Asynchronous call to check if an executable file has been signed using the public key set on the signing tab
of the partner site, for example to refuse to load modified executable files.
Activates the Big Picture text input dialog which only supports gamepad input.
Returns previously entered text.
Returns the language the steam client is running in. You probably want
instead, this is for very special usage cases.
Returns if Steam itself is running in VR mode.
Sets the inset of the overlay notification from the corner specified by SetOverlayNotificationPosition.
returns if Steam and the Steam Overlay are running in Big Picture mode
Games much be launched through the Steam client to enable the Big Picture overlay. During development,
a game can be added as a non-steam game to the developers library to test this feature.
Ask Steam UI to create and render its OpenVR dashboard.
Gets or sets whether the HMD content will be streamed via Steam In-Home Streaming.
If this is set to , then the scene in the HMD headset will be streamed, and remote input will not be allowed.
If this is set to , then the application window will be streamed instead, and remote input will be allowed.
The default is unless "VRHeadsetStreaming" "0" is in the extended app info for a game
(this is useful for games that have asymmetric multiplayer gameplay).
Gets whether this steam client is a Steam China specific client (), or the global client ().
Initializes text filtering, loading dictionaries for the language the game is running in.
Users can customize the text filter behavior in their Steam Account preferences.
Filters the provided input message and places the filtered result into pchOutFilteredText,
using legally required filtering and additional filtering based on the context and user settings.
Gets whether or not Steam itself is running on the Steam Deck.
In game launchers that don't have controller support: You can call this to have
Steam Input translate the controller input into mouse/kb to navigate the launcher
Class for utilizing the Steam Video API.
Return if currently using Steam's live broadcasting
Returns the number of viewers that are watching the stream, or 0 if is .
Represents the ID of a Steam application.
Is the clan an official game group?
Asynchronously fetches the officer list for a given clan
Whether the request was successful or not
Reconfigure the controller to use the specified action set (ie 'Menu', 'Walk' or 'Drive')
This is cheap, and can be safely called repeatedly. It's often easier to repeatedly call it in
our state loops, instead of trying to place it in all of your state transitions.
Returns the current state of the supplied digital game action
Returns the current state of these supplied analog game action
Returns true if this is the local user
Return true if this is a friend
Returns true if you have this user blocked
Return true if this user is playing the game we're running
Returns true if this friend is online
Sometimes we don't know the user's name. This will wait until we have
downloaded the information on this user.
Returns true if this friend is marked as away
Returns true if this friend is marked as busy
Returns true if this friend is marked as snoozing
Returns the player's current Steam name.
Steam returns nicknames here if "Append nicknames to friends' names" is disabled in the Steam client.
Returns the nickname that was set for this Steam player, if any.
Steam will never return nicknames if "Append nicknames to friends' names" is disabled in the Steam client.
Returns the player's Steam name history.
Invite this friend to the game that we are playing
Sends a message to a Steam friend. Returns true if success
Tries to get download the latest user stats
True if successful, False if failure
Gets a user stat. Must call RequestUserStats first.
The name of the stat you want to get
Will return this value if not available
The value, or defult if not available
Gets a user stat. Must call RequestUserStats first.
The name of the stat you want to get
Will return this value if not available
The value, or defult if not available
Gets a user achievement state. Must call RequestUserStats first.
The name of the achievement you want to get
Will return this value if not available
The value, or defult if not available
Gets a the time this achievement was unlocked.
The name of the achievement you want to get
The time unlocked. If it wasn't unlocked, or you haven't downloaded the stats yet - will return DateTime.MinValue
Shortcut to call GetProperty( "name" )
Shortcut to call GetProperty( "description" )
Shortcut to call GetProperty( "icon_url" )
Shortcut to call GetProperty( "icon_url_large" )
Shortcut to call GetProperty( "price_category" )
Shortcut to call GetProperty( "type" )
Returns true if this is an item that generates an item, rather
than something that is actual an item
Shortcut to call GetProperty( "exchange" )
Get a list of exchanges that are available to make this item
Shortcut to call GetBoolProperty( "marketable" )
Shortcut to call GetBoolProperty( "tradable" )
Gets the property timestamp
Gets the property modified
Get a specific property by name
Read a raw property from the definition schema
Read a raw property from the definition schema
Gets a list of all properties on this item
Returns the price of this item in the local currency (SteamInventory.Currency)
If the price has been discounted, LocalPrice will differ from LocalBasePrice
(assumed, this isn't documented)
Return a list of recepies that contain this item
Only available if the result set was created with the getproperties
This item is account-locked and cannot be traded or given away.
This is an item status flag which is permanently attached to specific item instances
The item has been destroyed, traded away, expired, or otherwise invalidated.
This is an action confirmation flag which is only set one time, as part of a result set.
The item quantity has been decreased by 1 via ConsumeItem API.
This is an action confirmation flag which is only set one time, as part of a result set.
Consumes items from a user's inventory. If the quantity of the given item goes to zero, it is permanently removed.
Once an item is removed it cannot be recovered.This is not for the faint of heart - if your game implements item removal at all,
a high-friction UI confirmation process is highly recommended.ConsumeItem can be restricted to certain item definitions or fully
blocked via the Steamworks website to minimize support/abuse issues such as the classic "my brother borrowed my laptop and deleted all of my rare items".
Split stack into two items
Add x units of the target item to this item
Will try to return the date that this item was aquired. You need to have for the items
with their properties for this to work.
Tries to get the origin property. Need properties for this to work.
Will return a string like "market"
Small utility class to describe an item with a quantity
A structured description of an item exchange
The definition ID of the ingredient.
If we don't know about this item definition this might be null.
In which case, DefinitionId should still hold the correct id.
The amount of this item needed. Generally this will be 1.
The item that this will create.
The items, with quantity required to create this item.
Checks whether an inventory result handle belongs to the specified Steam ID.
This is important when using Deserialize, to verify that a remote player is not pretending to have a different user's inventory
Serialized result sets contain a short signature which can't be forged or replayed across different game sessions.
A result set can be serialized on the local client, transmitted to other players via your game networking, and
deserialized by the remote players.This is a secure way of preventing hackers from lying about posessing
rare/high-value items. Serializes a result set with signature bytes to an output buffer.The size of a serialized
result depends on the number items which are being serialized.When securely transmitting items to other players,
it is recommended to use GetItemsByID first to create a minimal result set.
Results have a built-in timestamp which will be considered "expired" after an hour has elapsed.See DeserializeResult
for expiration handling.
Gets the owner of the beacon.
Gets metadata related to the beacon.
Will attempt to join the party. If successful will return a connection string.
If failed, will return
When a user follows your beacon, Steam will reserve one of the open party slots for them, and send your game a ReservationNotification callback.
When that user joins your party, call this method to notify Steam that the user has joined successfully.
To cancel a reservation (due to timeout or user input), call this.
Steam will open a new reservation slot.
Note: The user may already be in-flight to your game, so it's possible they will still connect and try to join your party.
Turn off the beacon.
Used to set up the server.
The variables in here are all required to be set, and can't be changed once the server is created.
The version string is usually in the form x.x.x.x, and is used by the master server to detect when the server is out of date.
If you go into the dedicated server tab on steamworks you'll be able to server the latest version. If this version number is
less than that latest version then your server won't show.
This should be the same directory game where gets installed into. Just the folder name, not the whole path. I.e. "Rust", "Garrysmod".
The game description. Setting this to the full name of your game is recommended.
Is a dedicated server
If you pass MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE into usQueryPort, then it causes the game server API to use
"GameSocketShare" mode, which means that the game is responsible for sending and receiving UDP packets for the master
server updater.
More info about this here: https://partner.steamgames.com/doc/api/ISteamGameServer#HandleIncomingPacket
Represents the ID of a user or steam lobby.
Create a Normal Workshop item that can be subscribed to
Create a Collection
Add items using Item.AddDependency()
Workshop item that is meant to be voted on for the purpose of selling in-game
Workshop item that is meant to be managed by the game. It is queryable by the API, but isn't visible on the web browser.
Adds a key-value tag pair to an item.
Keys can map to multiple different values (1-to-many relationship).
Key names are restricted to alpha-numeric characters and the '_' character.
Both keys and values cannot exceed 255 characters in length. Key-value tags are searchable by exact match only.
To replace all values associated to one key use RemoveKeyValueTags then AddKeyValueTag.
Removes a key and all values associated to it.
You can remove up to 100 keys per item update.
If you need remove more tags than that you'll need to make subsequent item updates.
https://partner.steamgames.com/doc/features/workshop/implementation#Legal
The actual ID of this file
The given title of this item
The description of this item, in your local language if available
A list of tags for this item, all lowercase
A dictionary of key value tags for this item, only available from queries WithKeyValueTags(true)
App Id of the app that created this item
App Id of the app that will consume this item.
User who created this content
The bayesian average for up votes / total votes, between [0,1]
Time when the published item was created
Time when the published item was last updated
True if this is publically visible
True if this item is only visible by friends of the creator
True if this is only visible to the creator
True if this item has been banned
Whether the developer of this app has specifically flagged this item as accepted in the Workshop
The number of upvotes of this item
The number of downvotes of this item
Dependencies/children of this item or collection, available only from WithDependencies(true) queries
Additional previews of this item or collection, available only from WithAdditionalPreviews(true) queries
Start downloading this item.
If this returns false the item isn't getting downloaded.
If we're downloading, how big the total download is
If we're downloading, how much we've downloaded
If we're installed, how big is the install
If we're downloading our current progress as a delta betwen 0-1
A case insensitive check for tag
Allows the user to subscribe to this item
Allows the user to subscribe to download this item asyncronously
If CancellationToken is default then there is 60 seconds timeout
Progress will be set to 0-1
Allows the user to unsubscribe from this item
Adds item to user favorite list
Removes item from user favorite list
Allows the user to rate a workshop item up or down.
Gets the current users vote on the item
Return a URL to view this item online
The URl to view this item's changelog
The URL to view the comments on this item
The URL to discuss this item
The URL to view this items stats online
The URL to the preview image for this item
The metadata string for this item, only available from queries WithMetadata(true)
Edit this item
Found items must have at least one of the defined tags
Found items must have all defined tags
Set to false to disable, by default following stats are loaded: NumSubscriptions, NumFavorites, NumFollowers, NumUniqueSubscriptions, NumUniqueFavorites, NumUniqueFollowers, NumUniqueWebsiteViews, ReportScore, NumSecondsPlayed, NumPlaytimeSessions, NumComments, NumSecondsPlayedDuringTimePeriod, NumPlaytimeSessionsDuringTimePeriod
Returns the current Unix Epoch
Convert an epoch to a datetime
Convert a DateTime to a unix time
Returns a buffer. This will get returned and reused later on.
We shouldn't really be using this anymore.
Prevent unity from stripping shit we depend on
https://docs.unity3d.com/Manual/ManagedCodeStripping.html