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 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 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. 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. True if unlocked Should hold the unlock time if State is true 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 can use GetIconAsync if you want to wait for the image to be downloaded. Gets the icon of the achievement, waits for it to load if we have to Returns the fraction (0-1) of users who have unlocked the specified achievement, or -1 if no data available. Make this achievement earned Reset this achievement to not achieved 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 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 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 Try to join this room. Will return RoomEnter.Success 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 true if the invite is successfully sent, whether or not the target responds returns false if the local user is not connected to the Steam servers returns the number of users in the specified lobby Returns current members. Need to be in the lobby to see the users. Get data associated with this lobby Get 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 the the chat room this isn't exposed because there's no way to read raw bytes atm, and I figure people can send json if they want something more advanced 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 false 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 false Max members able to join this lobby. Cannot be over 250. Can only be set by the owner [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. 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 Tags a user as being visible in the screenshot Tags a user as being visible in the screenshot Tags a user as being visible in 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 Find out the status of an asynchronous inventory result handle. Copies the contents of a result set into a flat array. The specific contents of the result set depend on which query which was used. Returns the server time at which the result was generated. Compare against the value of IClientUtils::GetServerRealTime() to determine age. Returns true if the result belongs to the target steam ID or false if the result does not. This is important when using DeserializeResult to verify that a remote player is not pretending to have a different users inventory. Destroys a result handle and frees all associated memory. Captures the entire state of the current users Steam inventory. Captures the state of a subset of the current users Steam inventory identified by an array of item instance IDs. GrantPromoItems() checks the list of promotional items for which the user may be eligible and grants the items (one time only). ConsumeItem() removes items from the inventory permanently. Deprecated method. Playtime accounting is performed on the Steam servers. Playtime credit must be consumed and turned into item drops by your game. LoadItemDefinitions triggers the automatic load and refresh of item definitions. Downloads leaderboard entries for an arbitrary set of users - ELeaderboardDataRequest is k_ELeaderboardDataRequestUsers 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. 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 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 Checks if the active user is subscribed to the current App ID Check if user borrowed this game via Family Sharing, If true, call GetAppOwner() to get the lender SteamID Checks if the license owned by the user provides low violence depots. Low violence depots are useful for copies sold in countries that have content restrictions Checks whether the current App ID license is for Cyber Cafes. CChecks if 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. Checks if the active user is subscribed to a specified AppId. Only use this if you need to check ownership of another game related to yours, a demo for example. Checks if the user owns a specific DLC and if the DLC is installed Returns the time of the purchase of the app 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/Uninstall control for optional DLC Install/Uninstall control for optional DLC Returns null if we're not on a beta branch, else the name of the branch Allows you to 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 use MarkContentCorrupt to force a verify, show a message to the user, and then quit. Gets a list of all installed depots for a given App ID in mount order Gets the install folder for a specific AppID. 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 may not actually be owned by the current user, they may have it left over from a free weekend, etc. 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. Gets the download progress for optional DLC. Gets the buildid of this app, may 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. Currently provides: 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. Initialize the steam client. If asyncCallbacks is false you need to call RunCallbacks manually every frame. Checks if the current user's Steam client is connected to the Steam servers. If it's not then 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 NULL. this is the same name as on the users community profile page gets the status of the current user returns the appID 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 Undocumented Parental Settings Called when chat message has been received from a friend. You'll need to turn on ListenForFriendsMessages to recieve this. (friend, msgtype, message) called when a friends' status changes Called 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 Posted when game overlay activates or deactivates the game can use this to be pause or resume single player games Called 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 Called 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 Callback indicating updated data about friends rich presence information The dialog to open. 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 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. You shouldn't really need to call this because it get called by RunCallbacks on SteamClient 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. Return 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. Undocumented Parental Settings 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 OnDefinitionsUpdated at which point Definitions should be set. Will call LoadItemDefinitions 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. Functions for clients to access matchmaking services, favorites, and to operate on game lobbies Maximum number of characters a lobby metadata key can be Someone invited you to a lobby You joined a lobby You created a lobby A game server has been associated with the lobby The lobby metadata has changed The lobby member metadata has changed The lobby member joined The lobby member left the room The lobby member left the room The lobby member was kicked. The 3rd param is the user that kicked them. The lobby member was banned. The 3rd param is the user that banned them. A chat message was recieved from a member of a lobby Creates a new invisible lobby. Call lobby.SetPublic to take it online. Attempts to directly join the specified lobby Get a list of servers that are on your favorites list Get a list of servers that you have added to your play history Functions 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 Playback status changed Volume changed, parameter is new volume Checks if Steam Music is enabled true if a song is currently playing, paused, or queued up to play; otherwise false. Gets the current status of the Steam Music player Have the Steam Music player play the previous song. Have the Steam Music player skip to the next song Gets/Sets the current volume of the Steam Music player This SteamId wants to send you a message. You should respond by calling AcceptP2PSessionWithUser if you want to recieve their messages Called 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 OnP2PSessionRequest 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 OnP2PSessionRequest callback will be posted 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. 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 SocketManager 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 ISocketManager. 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) Connect to a relay server Undocumented Parental Settings A function to receive debug network information on. This will do nothing unless you set DebugLevel to something other than None. 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) Get Debug Information via OnDebugOutput event Except when debugging, you should only use NetDebugOutput.Msg or NetDebugOutput.Warning. 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. The list of possible Party beacon locations has changed The list of active beacons may have changed Functions that provide information about Steam Remote Play sessions, streaming your game content to another computer or to a Steam Link app or hardware. Called when a session is connected Called when a session becomes disconnected Get 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 false if it's out of bounds Invite a friend to Remote Play Together This returns false if the invite can't be sent Undocumented Parental Settings Creates a new file, writes the bytes to the file, and then closes the file. If the target file already exists, it is overwritten Opens a binary file, reads the contents of the file into a byte array, and then closes the file. Checks whether the specified file exists. Checks if a specific file is persisted in the steam cloud. Gets the specified file's last modified date/time. Gets the specified files size in bytes. 0 if not exists. Deletes the file from remote storage, but leaves it on the local disk and remains accessible from the API. Deletes a file from the local disk, and propagates that delete to the cloud. Number of bytes total Number of bytes used Number of bytes remaining until your quota is used returns true if IsCloudEnabledForAccount AND IsCloudEnabledForApp 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. Get a list of filenames synchronized by Steam Cloud Undocumented Parental Settings A screenshot has been requested by the user from the Steam screenshot hotkey. This will only be called if Hooked is true, in which case Steam will not take the screenshot itself. A screenshot successfully written or otherwise added to the library and can now be tagged. 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 ScreenshotRequested 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 ScreenshotRequested_t callback will be sent if the user presses the hotkey or when TriggerScreenshot is called, and then the game is expected to call WriteScreenshot or AddScreenshotToLibrary in response. Provides the core of the Steam Game Servers API User has been authed or rejected Called when a connections 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) Disconnected from Steam Initialize the steam server. If asyncCallbacks is false you need to call RunCallbacks 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. Log onto Steam anonymously. Log onto Steam anonymously. Returns true if the server is connected and registered with the Steam master server You should have called LogOnAnonymous 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 null for the first few seconds after initialization. Enable or disable heartbeats, which are sent regularly to the master server. Enabled by default. Set heartbeat interval, if automatic heartbeats are enabled. You can leave this at the 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 will return fail these stats will only be auto-updated for clients playing on the server Set the named stat for this user. Setting stats should follow the rules you defined in Steamworks. Set the named stat for this user. Setting stats should follow the rules you defined in Steamworks. 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. 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. Unlocks the specified achievement for the specified user. Must have called Refresh on a steamid first. Remember to use Commit after use. Resets the unlock status of an achievement for the specified user. Must have called Refresh on a steamid first. Remember to use Commit after use. Return true 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 function. The callback will let you know if your action succeeded, but most of the time you can fire and forget. Functions for accessing and manipulating Steam user information. This is also where the APIs for Steam Voice are exposed. Posted after Download call Start downloading this item. You'll get notified of completion via OnDownloadItemResult. The ID of the file you want to download If true this should go straight to the top of the download list true 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 want to download An optional callback Allows you to send a message to cancel the download anywhere during the process How often to call the progress function true if downloaded and installed correctly Utility function to fetch a single item. Internally this uses Ugc.FileQuery - which you can use to query multiple items if you need to. Functions for accessing and manipulating Steam user information. This is also where the APIs for Steam Voice are exposed. 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. 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. Called if 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. Called whenever the users licenses (owned packages) changes. 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 Used internally for GetAuthSessionTicketAsync Called when a user has responded to a microtransaction authorization request. ( appid, orderid, user authorized ) 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. 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. Retrieve a 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 null 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 called when the achivement icon is loaded called 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 the 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. Asynchronously request the user's current stats and achievements from the server. You must always call this first to get the initial status of stats and achievements. Only after the resulting callback comes back can you start calling the rest of the stats and achievement functions for the current user. 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 RequestCurrentStats 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. OK indicates success, InvalidState means you need to call RequestCurrentStats first, Fail 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 StoreStats() after a successful call unless you pass false as the last argument. Set a stat value. This will automatically call StoreStats() after a successful call unless you pass false as the last argument. Get a Int stat value Get a float stat value Practically wipes the slate clean for this user. If includeAchievements is true, will wipe any achievements too. Interface which provides access to a range of miscellaneous utility functions The country of the user changed Fired 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 Called when Steam wants to shutdown Big Picture gamepad text input has been closed. Parameter is true if text was submitted, false 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 etc 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 Apps.CurrentGameLanguage instead, this is for very special usage cases returns true if Steam itself is running in VR mode Sets the inset of the overlay notification from the corner specified by SetOverlayNotificationPosition returns true 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 SteamUI to create and render its OpenVR dashboard Set whether the HMD content will be streamed via Steam In-Home Streaming If this is set to true, then the scene in the HMD headset will be streamed, and remote input will not be allowed. If this is set to false, then the application window will be streamed instead, and remote input will be allowed. The default is true unless "VRHeadsetStreaming" "0" is in the extended appinfo for a game. (this is useful for games that have asymmetric multiplayer gameplay) Returns whether this steam client is a Steam China specific client, vs the global client Undocumented Parental Settings Return true if currently using Steam's live broadcasting If we're broadcasting, will return the number of live viewers 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 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. Creator of the beacon Creator of the beacon Will attempt to join the party. If successful will return a connection string. If failed, will return null 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 OnReservationCompleted 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 Set the Steam quert port 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 Create a Normal Workshop item that can be subscribed to Workshop item that is meant to be voted on for the purpose of selling in-game 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 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 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 Edit this item Found items must have at least one of the defined tags Found items must have all defined tags 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. Prevent unity from stripping shit we depend on https://docs.unity3d.com/Manual/ManagedCodeStripping.html