diff options
| author | John Schoenick <[email protected]> | 2015-09-09 18:35:41 -0700 |
|---|---|---|
| committer | John Schoenick <[email protected]> | 2015-09-09 18:35:41 -0700 |
| commit | 0d8dceea4310fde5706b3ce1c70609d72a38efdf (patch) | |
| tree | c831ef32c2c801a5c5a80401736b52c7b5a528ec /mp/src/public/steam | |
| parent | Updated the SDK with the latest code from the TF and HL2 branches. (diff) | |
| download | source-sdk-2013-master.tar.xz source-sdk-2013-master.zip | |
Diffstat (limited to 'mp/src/public/steam')
21 files changed, 542 insertions, 518 deletions
diff --git a/mp/src/public/steam/isteamapps.h b/mp/src/public/steam/isteamapps.h index 7070e2e9..07005836 100644 --- a/mp/src/public/steam/isteamapps.h +++ b/mp/src/public/steam/isteamapps.h @@ -49,7 +49,7 @@ public: // Install/Uninstall control for optional DLC virtual void InstallDLC( AppId_t nAppID ) = 0; virtual void UninstallDLC( AppId_t nAppID ) = 0; - + // Request cd-key for yourself or owned DLC. If you are interested in this // data then make sure you provide us with a list of valid keys to be distributed // to users when they purchase the game, before the game ships. @@ -73,13 +73,18 @@ public: // but it is advised that you not param names beginning with an underscore for your own features. virtual const char *GetLaunchQueryParam( const char *pchKey ) = 0; + // get download progress for optional DLC + virtual bool GetDlcDownloadProgress( AppId_t nAppID, uint64 *punBytesDownloaded, uint64 *punBytesTotal ) = 0; + + // return the buildid of this app, may change at any time based on backend updates to the game + virtual int GetAppBuildId() = 0; #ifdef _PS3 // Result returned in a RegisterActivationCodeResponse_t callresult virtual SteamAPICall_t RegisterActivationCode( const char *pchActivationCode ) = 0; #endif }; -#define STEAMAPPS_INTERFACE_VERSION "STEAMAPPS_INTERFACE_VERSION006" +#define STEAMAPPS_INTERFACE_VERSION "STEAMAPPS_INTERFACE_VERSION007" // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) diff --git a/mp/src/public/steam/isteamclient.h b/mp/src/public/steam/isteamclient.h index 44c1df66..796d72d6 100644 --- a/mp/src/public/steam/isteamclient.h +++ b/mp/src/public/steam/isteamclient.h @@ -1,4 +1,4 @@ -//====== Copyright � 1996-2008, Valve Corporation, All rights reserved. ======= +//====== Copyright � 1996-2008, Valve Corporation, All rights reserved. ======= // // Purpose: Main interface for loading and accessing Steamworks API's from the // Steam client. @@ -40,7 +40,7 @@ #error ??? #endif -typedef struct +typedef struct ValvePackingSentinel_t { uint32 m_u32; uint64 m_u64; @@ -98,6 +98,8 @@ class ISteamController; class ISteamUGC; class ISteamAppList; class ISteamHTMLSurface; +class ISteamInventory; +class ISteamVideo; //----------------------------------------------------------------------------- // Purpose: Interface to creating a new steam instance, or to @@ -221,9 +223,16 @@ public: virtual void Set_SteamAPI_CPostAPIResultInProcess( SteamAPI_PostAPIResultInProcess_t func ) = 0; virtual void Remove_SteamAPI_CPostAPIResultInProcess( SteamAPI_PostAPIResultInProcess_t func ) = 0; virtual void Set_SteamAPI_CCheckCallbackRegisteredInProcess( SteamAPI_CheckCallbackRegistered_t func ) = 0; + + // inventory + virtual ISteamInventory *GetISteamInventory( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // Video + virtual ISteamVideo *GetISteamVideo( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; }; -#define STEAMCLIENT_INTERFACE_VERSION "SteamClient016" + +#define STEAMCLIENT_INTERFACE_VERSION "SteamClient017" //----------------------------------------------------------------------------- // Purpose: Base values for callback identifiers, each callback must @@ -275,6 +284,7 @@ enum { k_iClientReservedCallbacks = 4300 }; enum { k_iSteamReservedCallbacks = 4400 }; enum { k_iSteamHTMLSurfaceCallbacks = 4500 }; enum { k_iClientVideoCallbacks = 4600 }; +enum { k_iClientInventoryCallbacks = 4700 }; //----------------------------------------------------------------------------- // The CALLBACK macros are for client side callback logging enabled with diff --git a/mp/src/public/steam/isteamcontroller.h b/mp/src/public/steam/isteamcontroller.h index 6a97a6fc..5c3d01ab 100644 --- a/mp/src/public/steam/isteamcontroller.h +++ b/mp/src/public/steam/isteamcontroller.h @@ -11,7 +11,6 @@ #endif #include "isteamclient.h" -#include "steamcontrollerpublic.h" // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) @@ -26,13 +25,61 @@ #pragma pack( pop ) +#define STEAM_RIGHT_TRIGGER_MASK 0x0000001 +#define STEAM_LEFT_TRIGGER_MASK 0x0000002 +#define STEAM_RIGHT_BUMPER_MASK 0x0000004 +#define STEAM_LEFT_BUMPER_MASK 0x0000008 +#define STEAM_BUTTON_0_MASK 0x0000010 +#define STEAM_BUTTON_1_MASK 0x0000020 +#define STEAM_BUTTON_2_MASK 0x0000040 +#define STEAM_BUTTON_3_MASK 0x0000080 +#define STEAM_TOUCH_0_MASK 0x0000100 +#define STEAM_TOUCH_1_MASK 0x0000200 +#define STEAM_TOUCH_2_MASK 0x0000400 +#define STEAM_TOUCH_3_MASK 0x0000800 +#define STEAM_BUTTON_MENU_MASK 0x0001000 +#define STEAM_BUTTON_STEAM_MASK 0x0002000 +#define STEAM_BUTTON_ESCAPE_MASK 0x0004000 +#define STEAM_BUTTON_BACK_LEFT_MASK 0x0008000 +#define STEAM_BUTTON_BACK_RIGHT_MASK 0x0010000 +#define STEAM_BUTTON_LEFTPAD_CLICKED_MASK 0x0020000 +#define STEAM_BUTTON_RIGHTPAD_CLICKED_MASK 0x0040000 +#define STEAM_LEFTPAD_FINGERDOWN_MASK 0x0080000 +#define STEAM_RIGHTPAD_FINGERDOWN_MASK 0x0100000 +#define STEAM_JOYSTICK_BUTTON_MASK 0x0400000 + + +#pragma pack( push, 1 ) + +struct SteamControllerState001_t +{ + // If packet num matches that on your prior call, then the controller state hasn't been changed since + // your last call and there is no need to process it + uint32 unPacketNum; + + // bit flags for each of the buttons + uint64 ulButtons; + + // Left pad coordinates + short sLeftPadX; + short sLeftPadY; + + // Right pad coordinates + short sRightPadX; + short sRightPadY; + +}; + +#pragma pack( pop ) + +#define SteamControllerState_t SteamControllerState001_t + enum ESteamControllerPad { k_ESteamControllerPad_Left, k_ESteamControllerPad_Right }; - //----------------------------------------------------------------------------- // Purpose: Native Steam controller support API //----------------------------------------------------------------------------- diff --git a/mp/src/public/steam/isteamfriends.h b/mp/src/public/steam/isteamfriends.h index 16a2aa5a..60526edd 100644 --- a/mp/src/public/steam/isteamfriends.h +++ b/mp/src/public/steam/isteamfriends.h @@ -20,11 +20,11 @@ enum EFriendRelationship { k_EFriendRelationshipNone = 0, - k_EFriendRelationshipBlocked = 1, + k_EFriendRelationshipBlocked = 1, // this doesn't get stored; the user has just done an Ignore on an friendship invite k_EFriendRelationshipRequestRecipient = 2, k_EFriendRelationshipFriend = 3, k_EFriendRelationshipRequestInitiator = 4, - k_EFriendRelationshipIgnored = 5, + k_EFriendRelationshipIgnored = 5, // this is stored; the user has explicit blocked this other user from comments/chat/etc k_EFriendRelationshipIgnoredFriend = 6, k_EFriendRelationshipSuggested = 7, @@ -38,6 +38,12 @@ const int k_cchMaxFriendsGroupName = 64; // maximum number of groups a single user is allowed const int k_cFriendsGroupLimit = 100; +// friends group identifier type +typedef int16 FriendsGroupID_t; + +// invalid friends group identifier constant +const FriendsGroupID_t k_FriendsGroupID_Invalid = -1; + const int k_cEnumerateFollowersMax = 50; @@ -199,13 +205,27 @@ public: virtual const char *GetFriendPersonaName( CSteamID steamIDFriend ) = 0; // returns true if the friend is actually in a game, and fills in pFriendGameInfo with an extra details - virtual bool GetFriendGamePlayed( CSteamID steamIDFriend, FriendGameInfo_t *pFriendGameInfo ) = 0; + virtual bool GetFriendGamePlayed( CSteamID steamIDFriend, OUT_STRUCT() FriendGameInfo_t *pFriendGameInfo ) = 0; // accesses old friends names - returns an empty string when their are no more items in the history virtual const char *GetFriendPersonaNameHistory( CSteamID steamIDFriend, int iPersonaName ) = 0; + // friends steam level + virtual int GetFriendSteamLevel( CSteamID steamIDFriend ) = 0; // Returns nickname the current user has set for the specified player. Returns NULL if the no nickname has been set for that player. virtual const char *GetPlayerNickname( CSteamID steamIDPlayer ) = 0; + // friend grouping (tag) apis + // returns the number of friends groups + virtual int GetFriendsGroupCount() = 0; + // returns the friends group ID for the given index (invalid indices return k_FriendsGroupID_Invalid) + virtual FriendsGroupID_t GetFriendsGroupIDByIndex( int iFG ) = 0; + // returns the name for the given friends group (NULL in the case of invalid friends group IDs) + virtual const char *GetFriendsGroupName( FriendsGroupID_t friendsGroupID ) = 0; + // returns the number of members in a given friends group + virtual int GetFriendsGroupMembersCount( FriendsGroupID_t friendsGroupID ) = 0; + // gets up to nMembersCount members of the given friends group, if fewer exist than requested those positions' SteamIDs will be invalid + virtual void GetFriendsGroupMembersList( FriendsGroupID_t friendsGroupID, OUT_ARRAY_CALL(nMembersCount, GetFriendsGroupMembersCount, friendsGroupID ) CSteamID *pOutSteamIDMembers, int nMembersCount ) = 0; + // returns true if the specified user meets any of the criteria specified in iFriendFlags // iFriendFlags can be the union (binary or, |) of one or more k_EFriendFlags values virtual bool HasFriend( CSteamID steamIDFriend, int iFriendFlags ) = 0; @@ -218,7 +238,7 @@ public: // returns the most recent information we have about what's happening in a clan virtual bool GetClanActivityCounts( CSteamID steamIDClan, int *pnOnline, int *pnInGame, int *pnChatting ) = 0; // for clans a user is a member of, they will have reasonably up-to-date information, but for others you'll have to download the info to have the latest - virtual SteamAPICall_t DownloadClanActivityCounts( CSteamID *psteamIDClans, int cClansToRequest ) = 0; + virtual SteamAPICall_t DownloadClanActivityCounts( ARRAY_COUNT(cClansToRequest) CSteamID *psteamIDClans, int cClansToRequest ) = 0; // iterators for getting users in a chat room, lobby, game server or clan // note that large clans that cannot be iterated by the local user @@ -343,7 +363,7 @@ public: virtual int GetClanChatMemberCount( CSteamID steamIDClan ) = 0; virtual CSteamID GetChatMemberByIndex( CSteamID steamIDClan, int iUser ) = 0; virtual bool SendClanChatMessage( CSteamID steamIDClanChat, const char *pchText ) = 0; - virtual int GetClanChatMessage( CSteamID steamIDClanChat, int iMessage, void *prgchText, int cchTextMax, EChatEntryType *peChatEntryType, CSteamID *psteamidChatter ) = 0; + virtual int GetClanChatMessage( CSteamID steamIDClanChat, int iMessage, void *prgchText, int cchTextMax, EChatEntryType *peChatEntryType, OUT_STRUCT() CSteamID *psteamidChatter ) = 0; virtual bool IsClanChatAdmin( CSteamID steamIDClanChat, CSteamID steamIDUser ) = 0; // interact with the Steam (game overlay / desktop) @@ -363,7 +383,7 @@ public: virtual SteamAPICall_t EnumerateFollowingList( uint32 unStartIndex ) = 0; }; -#define STEAMFRIENDS_INTERFACE_VERSION "SteamFriends014" +#define STEAMFRIENDS_INTERFACE_VERSION "SteamFriends015" // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) diff --git a/mp/src/public/steam/isteamhtmlsurface.h b/mp/src/public/steam/isteamhtmlsurface.h index 80216fc9..c257164a 100644 --- a/mp/src/public/steam/isteamhtmlsurface.h +++ b/mp/src/public/steam/isteamhtmlsurface.h @@ -13,7 +13,7 @@ #include "isteamclient.h" typedef uint32 HHTMLBrowser; -const uint32 INVALID_HTTMLBROWSER = 0; +const uint32 INVALID_HTMLBROWSER = 0; //----------------------------------------------------------------------------- // Purpose: Functions for displaying HTML pages and interacting with them @@ -123,10 +123,10 @@ public: enum EHTMLKeyModifiers { - eHTMLKeyModifier_None = 0, - eHTMLKeyModifier_AltDown = 1 << 0, - eHTMLKeyModifier_CrtlDown = 1 << 1, - eHTMLKeyModifier_ShiftDown = 1 << 2, + k_eHTMLKeyModifier_None = 0, + k_eHTMLKeyModifier_AltDown = 1 << 0, + k_eHTMLKeyModifier_CtrlDown = 1 << 1, + k_eHTMLKeyModifier_ShiftDown = 1 << 2, }; // keyboard interactions, native keycode is the virtual key code value from your OS @@ -160,9 +160,15 @@ public: // set a webcookie for the hostname in question virtual void SetCookie( const char *pchHostname, const char *pchKey, const char *pchValue, const char *pchPath = "/", RTime32 nExpires = 0, bool bSecure = false, bool bHTTPOnly = false ) = 0; - // Zoom the current page by flZoom ( from 0.0 to 4.0, so to zoom to 120% use 1.2 ), zooming around point X,Y in the page (use 0,0 if you don't care) + // Zoom the current page by flZoom ( from 0.0 to 2.0, so to zoom to 120% use 1.2 ), zooming around point X,Y in the page (use 0,0 if you don't care) virtual void SetPageScaleFactor( HHTMLBrowser unBrowserHandle, float flZoom, int nPointX, int nPointY ) = 0; + // Enable/disable low-resource background mode, where javascript and repaint timers are throttled, resources are + // more aggressively purged from memory, and audio/video elements are paused. When background mode is enabled, + // all HTML5 video and audio objects will execute ".pause()" and gain the property "._steam_background_paused = 1". + // When background mode is disabled, any video or audio objects with that property will resume with ".play()". + virtual void SetBackgroundMode( HHTMLBrowser unBrowserHandle, bool bBackgroundMode ) = 0; + // CALLBACKS // // These set of functions are used as responses to callback requests @@ -182,7 +188,7 @@ public: virtual void FileLoadDialogResponse( HHTMLBrowser unBrowserHandle, const char **pchSelectedFiles ) = 0; }; -#define STEAMHTMLSURFACE_INTERFACE_VERSION "STEAMHTMLSURFACE_INTERFACE_VERSION_002" +#define STEAMHTMLSURFACE_INTERFACE_VERSION "STEAMHTMLSURFACE_INTERFACE_VERSION_003" // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) @@ -334,8 +340,8 @@ END_DEFINE_CALLBACK_6() //----------------------------------------------------------------------------- DEFINE_CALLBACK( HTML_LinkAtPosition_t, k_iSteamHTMLSurfaceCallbacks + 13 ) CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, uint32, x ) // -CALLBACK_MEMBER( 2, uint32, y ) // +CALLBACK_MEMBER( 1, uint32, x ) // NOTE - Not currently set +CALLBACK_MEMBER( 2, uint32, y ) // NOTE - Not currently set CALLBACK_MEMBER( 3, const char *, pchURL ) // CALLBACK_MEMBER( 4, bool, bInput ) // CALLBACK_MEMBER( 5, bool, bLiveLink ) // @@ -364,8 +370,8 @@ END_DEFINE_CALLBACK_2() //----------------------------------------------------------------------------- -// Purpose: show a Javascript confirmation dialog, call JSDialogResponse -// when the user dismisses this dialog (or right away to ignore it) +// Purpose: when received show a file open dialog +// then call FileLoadDialogResponse with the file(s) the user selected. //----------------------------------------------------------------------------- DEFINE_CALLBACK( HTML_FileOpenDialog_t, k_iSteamHTMLSurfaceCallbacks + 16 ) CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface @@ -375,55 +381,17 @@ END_DEFINE_CALLBACK_3() //----------------------------------------------------------------------------- -// Purpose: a popup item (i.e combo box) on the page needs rendering -//----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_ComboNeedsPaint_t, k_iSteamHTMLSurfaceCallbacks + 17 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, const char *, pBGRA ) // a pointer to the B8G8R8A8 data for this surface, valid until SteamAPI_RunCallbacks is next called -CALLBACK_MEMBER( 2, uint32, unWide ) // the total width of the pBGRA texture -CALLBACK_MEMBER( 3, uint32, unTall ) // the total height of the pBGRA texture -END_DEFINE_CALLBACK_4() - - -//----------------------------------------------------------------------------- -// Purpose: a popup (i.e combo box) wants to display -//----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_ShowPopup_t, k_iSteamHTMLSurfaceCallbacks + 18 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -END_DEFINE_CALLBACK_1() - - -//----------------------------------------------------------------------------- -// Purpose: a popup (i.e combo box) wants to hide -//----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_HidePopup_t, k_iSteamHTMLSurfaceCallbacks + 19 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -END_DEFINE_CALLBACK_1() - - -//----------------------------------------------------------------------------- -// Purpose: a popup (i.e combo box) wants to hide -//----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_SizePopup_t, k_iSteamHTMLSurfaceCallbacks + 20 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, uint32, unX ) // the x pos into the page to display the popup -CALLBACK_MEMBER( 2, uint32, unY ) // the y pos into the page to display the popup -CALLBACK_MEMBER( 3, uint32, unWide ) // the total width of the pBGRA texture -CALLBACK_MEMBER( 4, uint32, unTall ) // the total height of the pBGRA texture -END_DEFINE_CALLBACK_5() - - -//----------------------------------------------------------------------------- // Purpose: a new html window has been created //----------------------------------------------------------------------------- DEFINE_CALLBACK( HTML_NewWindow_t, k_iSteamHTMLSurfaceCallbacks + 21 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the current surface CALLBACK_MEMBER( 1, const char *, pchURL ) // the page to load CALLBACK_MEMBER( 2, uint32, unX ) // the x pos into the page to display the popup CALLBACK_MEMBER( 3, uint32, unY ) // the y pos into the page to display the popup CALLBACK_MEMBER( 4, uint32, unWide ) // the total width of the pBGRA texture CALLBACK_MEMBER( 5, uint32, unTall ) // the total height of the pBGRA texture -END_DEFINE_CALLBACK_6() +CALLBACK_MEMBER( 6, HHTMLBrowser, unNewWindow_BrowserHandle ) // the handle of the new window surface +END_DEFINE_CALLBACK_7() //----------------------------------------------------------------------------- diff --git a/mp/src/public/steam/isteamhttp.h b/mp/src/public/steam/isteamhttp.h index d68335d0..8fab537d 100644 --- a/mp/src/public/steam/isteamhttp.h +++ b/mp/src/public/steam/isteamhttp.h @@ -1,4 +1,4 @@ -//========= Copyright Valve Corporation, All rights reserved. ============// +//====== Copyright © 1996-2009, Valve Corporation, All rights reserved. ======= // // Purpose: interface to http client // @@ -17,6 +17,9 @@ typedef uint32 HTTPRequestHandle; #define INVALID_HTTPREQUEST_HANDLE 0 +typedef uint32 HTTPCookieContainerHandle; +#define INVALID_HTTPCOOKIE_HANDLE 0 + //----------------------------------------------------------------------------- // Purpose: interface to http client //----------------------------------------------------------------------------- @@ -25,8 +28,8 @@ class ISteamHTTP public: // Initializes a new HTTP request, returning a handle to use in further operations on it. Requires - // the method (GET or POST) and the absolute URL for the request. Only http requests (ie, not https) are - // currently supported, so this string must start with http:// or https:// and should look like http://store.steampowered.com/app/250/ + // the method (GET or POST) and the absolute URL for the request. Both http and https are supported, + // so this string must start with http:// or https:// and should look like http://store.steampowered.com/app/250/ // or such. virtual HTTPRequestHandle CreateHTTPRequest( EHTTPMethod eHTTPRequestMethod, const char *pchAbsoluteURL ) = 0; @@ -105,6 +108,35 @@ public: // have already been set for the request. Setting this raw body makes it the only contents for the post, the pchContentType // parameter will set the content-type header for the request so the server may know how to interpret the body. virtual bool SetHTTPRequestRawPostBody( HTTPRequestHandle hRequest, const char *pchContentType, uint8 *pubBody, uint32 unBodyLen ) = 0; + + // Creates a cookie container handle which you must later free with ReleaseCookieContainer(). If bAllowResponsesToModify=true + // than any response to your requests using this cookie container may add new cookies which may be transmitted with + // future requests. If bAllowResponsesToModify=false than only cookies you explicitly set will be sent. This API is just for + // during process lifetime, after steam restarts no cookies are persisted and you have no way to access the cookie container across + // repeat executions of your process. + virtual HTTPCookieContainerHandle CreateCookieContainer( bool bAllowResponsesToModify ) = 0; + + // Release a cookie container you are finished using, freeing it's memory + virtual bool ReleaseCookieContainer( HTTPCookieContainerHandle hCookieContainer ) = 0; + + // Adds a cookie to the specified cookie container that will be used with future requests. + virtual bool SetCookie( HTTPCookieContainerHandle hCookieContainer, const char *pchHost, const char *pchUrl, const char *pchCookie ) = 0; + + // Set the cookie container to use for a HTTP request + virtual bool SetHTTPRequestCookieContainer( HTTPRequestHandle hRequest, HTTPCookieContainerHandle hCookieContainer ) = 0; + + // Set the extra user agent info for a request, this doesn't clobber the normal user agent, it just adds the extra info on the end + virtual bool SetHTTPRequestUserAgentInfo( HTTPRequestHandle hRequest, const char *pchUserAgentInfo ) = 0; + + // Set that https request should require verified SSL certificate via machines certificate trust store + virtual bool SetHTTPRequestRequiresVerifiedCertificate( HTTPRequestHandle hRequest, bool bRequireVerifiedCertificate ) = 0; + + // Set an absolute timeout on the HTTP request, this is just a total time timeout different than the network activity timeout + // which can bump everytime we get more data + virtual bool SetHTTPRequestAbsoluteTimeoutMS( HTTPRequestHandle hRequest, uint32 unMilliseconds ) = 0; + + // Check if the reason the request failed was because we timed it out (rather than some harder failure) + virtual bool GetHTTPRequestWasTimedOut( HTTPRequestHandle hRequest, bool *pbWasTimedOut ) = 0; }; #define STEAMHTTP_INTERFACE_VERSION "STEAMHTTP_INTERFACE_VERSION002" @@ -136,6 +168,8 @@ struct HTTPRequestCompleted_t // Will be the HTTP status code value returned by the server, k_EHTTPStatusCode200OK is the normal // OK response, if you get something else you probably need to treat it as a failure. EHTTPStatusCode m_eStatusCode; + + uint32 m_unBodySize; // Same as GetHTTPResponseBodySize() }; diff --git a/mp/src/public/steam/isteammatchmaking.h b/mp/src/public/steam/isteammatchmaking.h index d6380076..e3be340d 100644 --- a/mp/src/public/steam/isteammatchmaking.h +++ b/mp/src/public/steam/isteammatchmaking.h @@ -201,7 +201,7 @@ public: // *pSteamIDUser is filled in with the CSteamID of the member // *pvData is filled in with the message itself // return value is the number of bytes written into the buffer - virtual int GetLobbyChatEntry( CSteamID steamIDLobby, int iChatID, CSteamID *pSteamIDUser, void *pvData, int cubData, EChatEntryType *peChatEntryType ) = 0; + virtual int GetLobbyChatEntry( CSteamID steamIDLobby, int iChatID, OUT_STRUCT() CSteamID *pSteamIDUser, void *pvData, int cubData, EChatEntryType *peChatEntryType ) = 0; // 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 @@ -217,7 +217,7 @@ public: // either the IP/Port or the steamID of the game server has to be valid, depending on how you want the clients to be able to connect virtual void SetLobbyGameServer( CSteamID steamIDLobby, uint32 unGameServerIP, uint16 unGameServerPort, CSteamID steamIDGameServer ) = 0; // returns the details of a game server set in a lobby - returns false if there is no game server set, or that lobby doesn't exist - virtual bool GetLobbyGameServer( CSteamID steamIDLobby, uint32 *punGameServerIP, uint16 *punGameServerPort, CSteamID *psteamIDGameServer ) = 0; + virtual bool GetLobbyGameServer( CSteamID steamIDLobby, uint32 *punGameServerIP, uint16 *punGameServerPort, OUT_STRUCT() CSteamID *psteamIDGameServer ) = 0; // set the limit on the # of users who can join the lobby virtual bool SetLobbyMemberLimit( CSteamID steamIDLobby, int cMaxMembers ) = 0; @@ -387,12 +387,12 @@ public: // Request a new list of servers of a particular type. These calls each correspond to one of the EMatchMakingType values. // Each call allocates a new asynchronous request object. // Request object must be released by calling ReleaseRequest( hServerListRequest ) - virtual HServerListRequest RequestInternetServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; + virtual HServerListRequest RequestInternetServerList( AppId_t iApp, ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; virtual HServerListRequest RequestLANServerList( AppId_t iApp, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; - virtual HServerListRequest RequestFriendsServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; - virtual HServerListRequest RequestFavoritesServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; - virtual HServerListRequest RequestHistoryServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; - virtual HServerListRequest RequestSpectatorServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; + virtual HServerListRequest RequestFriendsServerList( AppId_t iApp, ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; + virtual HServerListRequest RequestFavoritesServerList( AppId_t iApp, ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; + virtual HServerListRequest RequestHistoryServerList( AppId_t iApp, ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; + virtual HServerListRequest RequestSpectatorServerList( AppId_t iApp, ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; // Releases the asynchronous request object and cancels any pending query on it if there's a pending query in progress. // RefreshComplete callback is not posted when request is released. diff --git a/mp/src/public/steam/isteammusicremote.h b/mp/src/public/steam/isteammusicremote.h index fe083da5..ea29a7de 100644 --- a/mp/src/public/steam/isteammusicremote.h +++ b/mp/src/public/steam/isteammusicremote.h @@ -118,6 +118,9 @@ DEFINE_CALLBACK( MusicPlayerSelectsPlaylistEntry_t, k_iSteamMusicCallbacks + 13 CALLBACK_MEMBER(0, int, nID ) END_DEFINE_CALLBACK_1() +DEFINE_CALLBACK( MusicPlayerWantsPlayingRepeatStatus_t, k_iSteamMusicRemoteCallbacks + 14 ) + CALLBACK_MEMBER(0, int, m_nPlayingRepeatStatus ) +END_DEFINE_CALLBACK_1() #pragma pack( pop ) diff --git a/mp/src/public/steam/isteamremotestorage.h b/mp/src/public/steam/isteamremotestorage.h index c5a005f3..6853cd6f 100644 --- a/mp/src/public/steam/isteamremotestorage.h +++ b/mp/src/public/steam/isteamremotestorage.h @@ -88,24 +88,25 @@ enum EWorkshopFileType { k_EWorkshopFileTypeFirst = 0, - k_EWorkshopFileTypeCommunity = 0, - k_EWorkshopFileTypeMicrotransaction = 1, - k_EWorkshopFileTypeCollection = 2, - k_EWorkshopFileTypeArt = 3, - k_EWorkshopFileTypeVideo = 4, - k_EWorkshopFileTypeScreenshot = 5, - k_EWorkshopFileTypeGame = 6, - k_EWorkshopFileTypeSoftware = 7, - k_EWorkshopFileTypeConcept = 8, - k_EWorkshopFileTypeWebGuide = 9, - k_EWorkshopFileTypeIntegratedGuide = 10, - k_EWorkshopFileTypeMerch = 11, - k_EWorkshopFileTypeControllerBinding = 12, - k_EWorkshopFileTypeSteamworksAccessInvite = 13, - k_EWorkshopFileTypeSteamVideo = 14, + k_EWorkshopFileTypeCommunity = 0, // normal Workshop item that can be subscribed to + k_EWorkshopFileTypeMicrotransaction = 1, // Workshop item that is meant to be voted on for the purpose of selling in-game + k_EWorkshopFileTypeCollection = 2, // a collection of Workshop or Greenlight items + k_EWorkshopFileTypeArt = 3, // artwork + k_EWorkshopFileTypeVideo = 4, // external video + k_EWorkshopFileTypeScreenshot = 5, // screenshot + k_EWorkshopFileTypeGame = 6, // Greenlight game entry + k_EWorkshopFileTypeSoftware = 7, // Greenlight software entry + k_EWorkshopFileTypeConcept = 8, // Greenlight concept + k_EWorkshopFileTypeWebGuide = 9, // Steam web guide + k_EWorkshopFileTypeIntegratedGuide = 10, // application integrated guide + k_EWorkshopFileTypeMerch = 11, // Workshop merchandise meant to be voted on for the purpose of being sold + k_EWorkshopFileTypeControllerBinding = 12, // Steam Controller bindings + k_EWorkshopFileTypeSteamworksAccessInvite = 13, // internal + k_EWorkshopFileTypeSteamVideo = 14, // Steam video + k_EWorkshopFileTypeGameManagedItem = 15, // managed completely by the game, not the user, and not shown on the web // Update k_EWorkshopFileTypeMax if you add values. - k_EWorkshopFileTypeMax = 15 + k_EWorkshopFileTypeMax = 16 }; @@ -114,6 +115,7 @@ enum EWorkshopVote k_EWorkshopVoteUnvoted = 0, k_EWorkshopVoteFor = 1, k_EWorkshopVoteAgainst = 2, + k_EWorkshopVoteLater = 3, }; enum EWorkshopFileAction @@ -214,7 +216,7 @@ class ISteamRemoteStorage virtual bool GetUGCDownloadProgress( UGCHandle_t hContent, int32 *pnBytesDownloaded, int32 *pnBytesExpected ) = 0; // Gets metadata for a file after it has been downloaded. This is the same metadata given in the RemoteStorageDownloadUGCResult_t call result - virtual bool GetUGCDetails( UGCHandle_t hContent, AppId_t *pnAppID, char **ppchName, int32 *pnFileSizeInBytes, CSteamID *pSteamIDOwner ) = 0; + virtual bool GetUGCDetails( UGCHandle_t hContent, AppId_t *pnAppID, char **ppchName, int32 *pnFileSizeInBytes, OUT_STRUCT() CSteamID *pSteamIDOwner ) = 0; // After download, gets the content of the file. // Small files can be read all at once by calling this function with an offset of 0 and cubDataToRead equal to the size of the file. diff --git a/mp/src/public/steam/isteamugc.h b/mp/src/public/steam/isteamugc.h index 4bab58d6..6ac2a555 100644 --- a/mp/src/public/steam/isteamugc.h +++ b/mp/src/public/steam/isteamugc.h @@ -45,6 +45,7 @@ enum EUGCMatchingUGCType k_EUGCMatchingUGCType_IntegratedGuides = 9, k_EUGCMatchingUGCType_UsableInGame = 10, // ready-to-use items and integrated guides k_EUGCMatchingUGCType_ControllerBindings = 11, + k_EUGCMatchingUGCType_GameManagedItems = 12, // game managed items (not managed by users) }; // Different lists of published UGC for a user. @@ -89,6 +90,7 @@ enum EUGCQuery k_EUGCQuery_RankedByTotalVotesAsc = 9, k_EUGCQuery_RankedByVotesUp = 10, k_EUGCQuery_RankedByTextSearch = 11, + k_EUGCQuery_RankedByTotalUniqueSubscriptions = 12, }; enum EItemUpdateStatus @@ -101,8 +103,31 @@ enum EItemUpdateStatus k_EItemUpdateStatusCommittingChanges = 5 // The item update is committing all changes }; +enum EItemState +{ + k_EItemStateNone = 0, // item not tracked on client + k_EItemStateSubscribed = 1, // current user is subscribed to this item. Not just cached. + k_EItemStateLegacyItem = 2, // item was created with ISteamRemoteStorage + k_EItemStateInstalled = 4, // item is installed and usable (but maybe out of date) + k_EItemStateNeedsUpdate = 8, // items needs an update. Either because it's not installed yet or creator updated content + k_EItemStateDownloading = 16, // item update is currently downloading + k_EItemStateDownloadPending = 32, // DownloadItem() was called for this item, content isn't available until DownloadItemResult_t is fired +}; + +enum EItemStatistic +{ + k_EItemStatistic_NumSubscriptions = 0, + k_EItemStatistic_NumFavorites = 1, + k_EItemStatistic_NumFollowers = 2, + k_EItemStatistic_NumUniqueSubscriptions = 3, + k_EItemStatistic_NumUniqueFavorites = 4, + k_EItemStatistic_NumUniqueFollowers = 5, + k_EItemStatistic_NumUniqueWebsiteViews = 6, + k_EItemStatistic_ReportScore = 7, +}; const uint32 kNumUGCResultsPerPage = 50; +const uint32 k_cchDeveloperMetadataMax = 5000; // Details for a single published file/UGC struct SteamUGCDetails_t @@ -134,7 +159,8 @@ struct SteamUGCDetails_t uint32 m_unVotesUp; // number of votes up uint32 m_unVotesDown; // number of votes down float m_flScore; // calculated score - uint32 m_unNumChildren; // if m_eFileType == k_EWorkshopFileTypeCollection, then this number will be the number of children contained within the collection + // collection details + uint32 m_unNumChildren; }; //----------------------------------------------------------------------------- @@ -150,11 +176,22 @@ public: // Query for all matching UGC. Creator app id or consumer app id must be valid and be set to the current running app. unPage should start at 1. virtual UGCQueryHandle_t CreateQueryAllUGCRequest( EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage ) = 0; + // Query for the details of the given published file ids (the RequestUGCDetails call is deprecated and replaced with this) + virtual UGCQueryHandle_t CreateQueryUGCDetailsRequest( PublishedFileId_t *pvecPublishedFileID, uint32 unNumPublishedFileIDs ) = 0; + // Send the query to Steam virtual SteamAPICall_t SendQueryUGCRequest( UGCQueryHandle_t handle ) = 0; // Retrieve an individual result after receiving the callback for querying UGC virtual bool GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0; + virtual bool GetQueryUGCPreviewURL( UGCQueryHandle_t handle, uint32 index, char *pchURL, uint32 cchURLSize ) = 0; + virtual bool GetQueryUGCMetadata( UGCQueryHandle_t handle, uint32 index, char *pchMetadata, uint32 cchMetadatasize ) = 0; + virtual bool GetQueryUGCChildren( UGCQueryHandle_t handle, uint32 index, PublishedFileId_t* pvecPublishedFileID, uint32 cMaxEntries ) = 0; + virtual bool GetQueryUGCStatistic( UGCQueryHandle_t handle, uint32 index, EItemStatistic eStatType, uint32 *pStatValue ) = 0; + virtual uint32 GetQueryUGCNumAdditionalPreviews( UGCQueryHandle_t handle, uint32 index ) = 0; + virtual bool GetQueryUGCAdditionalPreview( UGCQueryHandle_t handle, uint32 index, uint32 previewIndex, char *pchURLOrVideoID, uint32 cchURLSize, bool *pbIsImage ) = 0; + virtual uint32 GetQueryUGCNumKeyValueTags( UGCQueryHandle_t handle, uint32 index ) = 0; + virtual bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint32 index, uint32 keyValueTagIndex, char *pchKey, uint32 cchKeySize, char *pchValue, uint32 cchValueSize ) = 0; // Release the request to free up memory, after retrieving results virtual bool ReleaseQueryUGCRequest( UGCQueryHandle_t handle ) = 0; @@ -162,8 +199,13 @@ public: // Options to set for querying UGC virtual bool AddRequiredTag( UGCQueryHandle_t handle, const char *pTagName ) = 0; virtual bool AddExcludedTag( UGCQueryHandle_t handle, const char *pTagName ) = 0; + virtual bool SetReturnKeyValueTags( UGCQueryHandle_t handle, bool bReturnKeyValueTags ) = 0; virtual bool SetReturnLongDescription( UGCQueryHandle_t handle, bool bReturnLongDescription ) = 0; + virtual bool SetReturnMetadata( UGCQueryHandle_t handle, bool bReturnMetadata ) = 0; + virtual bool SetReturnChildren( UGCQueryHandle_t handle, bool bReturnChildren ) = 0; + virtual bool SetReturnAdditionalPreviews( UGCQueryHandle_t handle, bool bReturnAdditionalPreviews ) = 0; virtual bool SetReturnTotalOnly( UGCQueryHandle_t handle, bool bReturnTotalOnly ) = 0; + virtual bool SetLanguage( UGCQueryHandle_t handle, const char *pchLanguage ) = 0; virtual bool SetAllowCachedResponse( UGCQueryHandle_t handle, uint32 unMaxAgeSeconds ) = 0; // Options only for querying user UGC @@ -173,8 +215,9 @@ public: virtual bool SetMatchAnyTag( UGCQueryHandle_t handle, bool bMatchAnyTag ) = 0; virtual bool SetSearchText( UGCQueryHandle_t handle, const char *pSearchText ) = 0; virtual bool SetRankedByTrendDays( UGCQueryHandle_t handle, uint32 unDays ) = 0; + virtual bool AddRequiredKeyValueTag( UGCQueryHandle_t handle, const char *pKey, const char *pValue ) = 0; - // Request full details for one piece of UGC + // DEPRECATED - Use CreateQueryUGCDetailsRequest call above instead! virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0; // Steam Workshop Creator API @@ -184,27 +227,49 @@ public: virtual bool SetItemTitle( UGCUpdateHandle_t handle, const char *pchTitle ) = 0; // change the title of an UGC item virtual bool SetItemDescription( UGCUpdateHandle_t handle, const char *pchDescription ) = 0; // change the description of an UGC item + virtual bool SetItemUpdateLanguage( UGCUpdateHandle_t handle, const char *pchLanguage ) = 0; // specify the language of the title or description that will be set + virtual bool SetItemMetadata( UGCUpdateHandle_t handle, const char *pchMetaData ) = 0; // change the metadata of an UGC item (max = k_cchDeveloperMetadataMax) virtual bool SetItemVisibility( UGCUpdateHandle_t handle, ERemoteStoragePublishedFileVisibility eVisibility ) = 0; // change the visibility of an UGC item virtual bool SetItemTags( UGCUpdateHandle_t updateHandle, const SteamParamStringArray_t *pTags ) = 0; // change the tags of an UGC item virtual bool SetItemContent( UGCUpdateHandle_t handle, const char *pszContentFolder ) = 0; // update item content from this local folder - virtual bool SetItemPreview( UGCUpdateHandle_t handle, const char *pszPreviewFile ) = 0; // change preview image file for this item. pszPreviewFile points to local image file + virtual bool SetItemPreview( UGCUpdateHandle_t handle, const char *pszPreviewFile ) = 0; // change preview image file for this item. pszPreviewFile points to local image file, which must be under 1MB in size + virtual bool RemoveItemKeyValueTags( UGCUpdateHandle_t handle, const char *pchKey ) = 0; // remove any existing key-value tags with the specified key + virtual bool AddItemKeyValueTag( UGCUpdateHandle_t handle, const char *pchKey, const char *pchValue ) = 0; // add new key-value tags for the item. Note that there can be multiple values for a tag. virtual SteamAPICall_t SubmitItemUpdate( UGCUpdateHandle_t handle, const char *pchChangeNote ) = 0; // commit update process started with StartItemUpdate() virtual EItemUpdateStatus GetItemUpdateProgress( UGCUpdateHandle_t handle, uint64 *punBytesProcessed, uint64* punBytesTotal ) = 0; // Steam Workshop Consumer API - virtual SteamAPICall_t SubscribeItem( PublishedFileId_t nPublishedFileID ) = 0; // subscript to this item, will be installed ASAP + virtual SteamAPICall_t SetUserItemVote( PublishedFileId_t nPublishedFileID, bool bVoteUp ) = 0; + virtual SteamAPICall_t GetUserItemVote( PublishedFileId_t nPublishedFileID ) = 0; + virtual SteamAPICall_t AddItemToFavorites( AppId_t nAppId, PublishedFileId_t nPublishedFileID ) = 0; + virtual SteamAPICall_t RemoveItemFromFavorites( AppId_t nAppId, PublishedFileId_t nPublishedFileID ) = 0; + virtual SteamAPICall_t SubscribeItem( PublishedFileId_t nPublishedFileID ) = 0; // subscribe to this item, will be installed ASAP virtual SteamAPICall_t UnsubscribeItem( PublishedFileId_t nPublishedFileID ) = 0; // unsubscribe from this item, will be uninstalled after game quits virtual uint32 GetNumSubscribedItems() = 0; // number of subscribed items virtual uint32 GetSubscribedItems( PublishedFileId_t* pvecPublishedFileID, uint32 cMaxEntries ) = 0; // all subscribed item PublishFileIDs - // Get info about the item on disk. If you are supporting items published through the legacy RemoteStorage APIs then *pbLegacyItem will be set to true - // and pchFolder will contain the full path to the file rather than the containing folder. - virtual bool GetItemInstallInfo( PublishedFileId_t nPublishedFileID, uint64 *punSizeOnDisk, char *pchFolder, uint32 cchFolderSize, bool *pbLegacyItem ) = 0; // returns true if item is installed - virtual bool GetItemUpdateInfo( PublishedFileId_t nPublishedFileID, bool *pbNeedsUpdate, bool *pbIsDownloading, uint64 *punBytesDownloaded, uint64 *punBytesTotal ) = 0; + // get EItemState flags about item on this client + virtual uint32 GetItemState( PublishedFileId_t nPublishedFileID ) = 0; + + // get info about currently installed content on disc for items that have k_EItemStateInstalled set + // if k_EItemStateLegacyItem is set, pchFolder contains the path to the legacy file itself (not a folder) + virtual bool GetItemInstallInfo( PublishedFileId_t nPublishedFileID, uint64 *punSizeOnDisk, char *pchFolder, uint32 cchFolderSize, uint32 *punTimeStamp ) = 0; + + // get info about pending update for items that have k_EItemStateNeedsUpdate set. punBytesTotal will be valid after download started once + virtual bool GetItemDownloadInfo( PublishedFileId_t nPublishedFileID, uint64 *punBytesDownloaded, uint64 *punBytesTotal ) = 0; + + // download new or update already installed item. If function returns true, wait for DownloadItemResult_t. If the item is already installed, + // then files on disk should not be used until callback received. If item is not subscribed to, it will be cached for some time. + // If bHighPriority is set, any other item download will be suspended and this item downloaded ASAP. + virtual bool DownloadItem( PublishedFileId_t nPublishedFileID, bool bHighPriority ) = 0; + + // game servers can set a specific workshop folder before issuing any UGC commands. + // This is helpful if you want to support multiple game servers running out of the same install folder + virtual bool BInitWorkshopForGameServer( DepotId_t unWorkshopDepotID, const char *pszFolder ) = 0; }; -#define STEAMUGC_INTERFACE_VERSION "STEAMUGC_INTERFACE_VERSION003" +#define STEAMUGC_INTERFACE_VERSION "STEAMUGC_INTERFACE_VERSION007" //----------------------------------------------------------------------------- // Purpose: Callback for querying UGC @@ -255,7 +320,7 @@ struct SubmitItemUpdateResult_t //----------------------------------------------------------------------------- -// Purpose: a new Workshop item has been installed +// Purpose: a Workshop item has been installed or updated //----------------------------------------------------------------------------- struct ItemInstalled_t { @@ -265,6 +330,52 @@ struct ItemInstalled_t }; +//----------------------------------------------------------------------------- +// Purpose: result of DownloadItem(), existing item files can be accessed again +//----------------------------------------------------------------------------- +struct DownloadItemResult_t +{ + enum { k_iCallback = k_iClientUGCCallbacks + 6 }; + AppId_t m_unAppID; + PublishedFileId_t m_nPublishedFileId; + EResult m_eResult; +}; + +//----------------------------------------------------------------------------- +// Purpose: result of AddItemToFavorites() or RemoveItemFromFavorites() +//----------------------------------------------------------------------------- +struct UserFavoriteItemsListChanged_t +{ + enum { k_iCallback = k_iClientUGCCallbacks + 7 }; + PublishedFileId_t m_nPublishedFileId; + EResult m_eResult; + bool m_bWasAddRequest; +}; + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to SetUserItemVote() +//----------------------------------------------------------------------------- +struct SetUserItemVoteResult_t +{ + enum { k_iCallback = k_iClientUGCCallbacks + 8 }; + PublishedFileId_t m_nPublishedFileId; + EResult m_eResult; + bool m_bVoteUp; +}; + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to GetUserItemVote() +//----------------------------------------------------------------------------- +struct GetUserItemVoteResult_t +{ + enum { k_iCallback = k_iClientUGCCallbacks + 9 }; + PublishedFileId_t m_nPublishedFileId; + EResult m_eResult; + bool m_bVotedUp; + bool m_bVotedDown; + bool m_bVoteSkipped; +}; + #pragma pack( pop ) #endif // ISTEAMUGC_H diff --git a/mp/src/public/steam/isteamuser.h b/mp/src/public/steam/isteamuser.h index a670849e..989b88e7 100644 --- a/mp/src/public/steam/isteamuser.h +++ b/mp/src/public/steam/isteamuser.h @@ -166,6 +166,18 @@ public: // gets the Steam Level of the user, as shown on their profile virtual int GetPlayerSteamLevel() = 0; + // 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. + // The result of this API call will be a StoreAuthURLResponse_t callback. + // 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 2: 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. + virtual SteamAPICall_t RequestStoreAuthURL( const char *pchRedirectURL ) = 0; + #ifdef _PS3 // Initiates PS3 Logon request using just PSN ticket. // @@ -205,7 +217,7 @@ public: }; -#define STEAMUSER_INTERFACE_VERSION "SteamUser017" +#define STEAMUSER_INTERFACE_VERSION "SteamUser018" // callbacks @@ -288,6 +300,15 @@ struct IPCFailure_t //----------------------------------------------------------------------------- +// Purpose: Signaled whenever licenses change +//----------------------------------------------------------------------------- +struct LicensesUpdated_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 25 }; +}; + + +//----------------------------------------------------------------------------- // callback for BeginAuthSession //----------------------------------------------------------------------------- struct ValidateAuthTicketResponse_t @@ -342,6 +363,16 @@ struct GameWebCallback_t char m_szURL[256]; }; +//----------------------------------------------------------------------------- +// Purpose: sent to your game in response to ISteamUser::RequestStoreAuthURL +//----------------------------------------------------------------------------- +struct StoreAuthURLResponse_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 65 }; + char m_szURL[512]; +}; + + #pragma pack( pop ) diff --git a/mp/src/public/steam/isteamuserstats.h b/mp/src/public/steam/isteamuserstats.h index c5847cf6..3a65691c 100644 --- a/mp/src/public/steam/isteamuserstats.h +++ b/mp/src/public/steam/isteamuserstats.h @@ -1,4 +1,4 @@ -//========= Copyright Valve Corporation, All rights reserved. ============// +//====== Copyright � 1996-2009, Valve Corporation, All rights reserved. ======= // // Purpose: interface to stats, achievements, and leaderboards // @@ -194,7 +194,9 @@ public: // as above, but downloads leaderboard entries for an arbitrary set of users - ELeaderboardDataRequest is k_ELeaderboardDataRequestUsers // if a user doesn't have a leaderboard entry, they won't be included in the result // a max of 100 users can be downloaded at a time, with only one outstanding call at a time - virtual SteamAPICall_t DownloadLeaderboardEntriesForUsers( SteamLeaderboard_t hSteamLeaderboard, CSteamID *prgUsers, int cUsers ) = 0; + METHOD_DESC(Downloads leaderboard entries for an arbitrary set of users - ELeaderboardDataRequest is k_ELeaderboardDataRequestUsers) + virtual SteamAPICall_t DownloadLeaderboardEntriesForUsers( SteamLeaderboard_t hSteamLeaderboard, + ARRAY_COUNT_D(cUsers, Array of users to retrieve) CSteamID *prgUsers, int cUsers ) = 0; // Returns data about a single leaderboard entry // use a for loop from 0 to LeaderboardScoresDownloaded_t::m_cEntryCount to get all the downloaded entries @@ -259,8 +261,8 @@ public: // So when called, pData[0] will be today, pData[1] will be yesterday, and pData[2] will be two days ago, // etc. cubData is the size in bytes of the pubData buffer. Returns the number of // elements actually set. - virtual int32 GetGlobalStatHistory( const char *pchStatName, int64 *pData, uint32 cubData ) = 0; - virtual int32 GetGlobalStatHistory( const char *pchStatName, double *pData, uint32 cubData ) = 0; + virtual int32 GetGlobalStatHistory( const char *pchStatName, ARRAY_COUNT(cubData) int64 *pData, uint32 cubData ) = 0; + virtual int32 GetGlobalStatHistory( const char *pchStatName, ARRAY_COUNT(cubData) double *pData, uint32 cubData ) = 0; #ifdef _PS3 // Call to kick off installation of the PS3 trophies. This call is asynchronous, and the results will be returned in a PS3TrophiesInstalled_t diff --git a/mp/src/public/steam/isteamutils.h b/mp/src/public/steam/isteamutils.h index 7f8d6bf0..54777d33 100644 --- a/mp/src/public/steam/isteamutils.h +++ b/mp/src/public/steam/isteamutils.h @@ -160,6 +160,9 @@ public: // returns true if Steam itself is running in VR mode virtual bool IsSteamRunningInVR() = 0; + + // Sets the inset of the overlay notification from the corner specified by SetOverlayNotificationPosition. + virtual void SetOverlayNotificationInset( int nHorizontalInset, int nVerticalInset ) = 0; }; #define STEAMUTILS_INTERFACE_VERSION "SteamUtils007" diff --git a/mp/src/public/steam/matchmakingtypes.h b/mp/src/public/steam/matchmakingtypes.h index df6a2d4f..08d5a966 100644 --- a/mp/src/public/steam/matchmakingtypes.h +++ b/mp/src/public/steam/matchmakingtypes.h @@ -64,6 +64,8 @@ enum EMatchMakingServerResponse class servernetadr_t { public: + + servernetadr_t() : m_usConnectionPort( 0 ), m_usQueryPort( 0 ), m_unIP( 0 ) {} void Init( unsigned int ip, uint16 usQueryPort, uint16 usConnectionPort ); #ifdef NETADR_H @@ -154,9 +156,9 @@ inline const char *servernetadr_t::ToString( uint32 unIP, uint16 usPort ) const static int nBuf = 0; unsigned char *ipByte = (unsigned char *)&unIP; #ifdef VALVE_BIG_ENDIAN - Q_snprintf (s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[0]), (int)(ipByte[1]), (int)(ipByte[2]), (int)(ipByte[3]), usPort ); + V_snprintf (s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[0]), (int)(ipByte[1]), (int)(ipByte[2]), (int)(ipByte[3]), usPort ); #else - Q_snprintf (s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[3]), (int)(ipByte[2]), (int)(ipByte[1]), (int)(ipByte[0]), usPort ); + V_snprintf (s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[3]), (int)(ipByte[2]), (int)(ipByte[1]), (int)(ipByte[0]), usPort ); #endif const char *pchRet = s[nBuf]; ++nBuf; diff --git a/mp/src/public/steam/steam_api.h b/mp/src/public/steam/steam_api.h index 9850cd7b..b6ab4edf 100644 --- a/mp/src/public/steam/steam_api.h +++ b/mp/src/public/steam/steam_api.h @@ -133,31 +133,56 @@ S_API ISteamPS3OverlayRender *S_CALLTYPE SteamPS3OverlayRender(); #endif #endif // VERSION_SAFE_STEAM_API_INTERFACES + //----------------------------------------------------------------------------------------------------------------------------------------------------------// -// steam callback helper functions +// steam callback and call-result helpers +// +// The following macros and classes are used to register your application for +// callbacks and call-results, which are delivered in a predictable manner. +// +// STEAM_CALLBACK macros are meant for use inside of a C++ class definition. +// They map a Steam notification callback directly to a class member function +// which is automatically prototyped as "void func( callback_type *pParam )". // -// The following classes/macros are used to be able to easily multiplex callbacks -// from the Steam API into various objects in the app in a thread-safe manner +// CCallResult is used with specific Steam APIs that return "result handles". +// The handle can be passed to a CCallResult object's Set function, along with +// an object pointer and member-function pointer. The member function will +// be executed once the results of the Steam API call are available. // -// These functors are triggered via the SteamAPI_RunCallbacks() function, mapping the callback -// to as many functions/objects as are registered to it +// CCallback and CCallbackManual classes can be used instead of STEAM_CALLBACK +// macros if you require finer control over registration and unregistration. +// +// Callbacks and call-results are queued automatically and are only +// delivered/executed when your application calls SteamAPI_RunCallbacks(). //----------------------------------------------------------------------------------------------------------------------------------------------------------// S_API void S_CALLTYPE SteamAPI_RunCallbacks(); -// functions used by the utility CCallback objects to receive callbacks +// Declares a callback member function plus a helper member variable which +// registers the callback on object creation and unregisters on destruction. +// The optional fourth 'var' param exists only for backwards-compatibility +// and can be ignored. +#define STEAM_CALLBACK( thisclass, func, .../*callback_type, [deprecated] var*/ ) \ + _STEAM_CALLBACK_SELECT( ( __VA_ARGS__, 4, 3 ), ( /**/, thisclass, func, __VA_ARGS__ ) ) + +// Declares a callback function and a named CCallbackManual variable which +// has Register and Unregister functions instead of automatic registration. +#define STEAM_CALLBACK_MANUAL( thisclass, func, callback_type, var ) \ + CCallbackManual< thisclass, callback_type > var; void func( callback_type *pParam ) + + +// Internal functions used by the utility CCallback objects to receive callbacks S_API void S_CALLTYPE SteamAPI_RegisterCallback( class CCallbackBase *pCallback, int iCallback ); S_API void S_CALLTYPE SteamAPI_UnregisterCallback( class CCallbackBase *pCallback ); -// functions used by the utility CCallResult objects to receive async call results +// Internal functions used by the utility CCallResult objects to receive async call results S_API void S_CALLTYPE SteamAPI_RegisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall ); S_API void S_CALLTYPE SteamAPI_UnregisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall ); //----------------------------------------------------------------------------- -// Purpose: base for callbacks, -// used only by CCallback, shouldn't be used directly +// Purpose: base for callbacks and call results - internal implementation detail //----------------------------------------------------------------------------- class CCallbackBase { @@ -174,6 +199,26 @@ protected: uint8 m_nCallbackFlags; int m_iCallback; friend class CCallbackMgr; + +private: + CCallbackBase( const CCallbackBase& ); + CCallbackBase& operator=( const CCallbackBase& ); +}; + +//----------------------------------------------------------------------------- +// Purpose: templated base for callbacks - internal implementation detail +//----------------------------------------------------------------------------- +template< int sizeof_P > +class CCallbackImpl : protected CCallbackBase +{ +public: + ~CCallbackImpl() { if ( m_nCallbackFlags & k_ECallbackFlagsRegistered ) SteamAPI_UnregisterCallback( this ); } + void SetGameserverFlag() { m_nCallbackFlags |= k_ECallbackFlagsGameServer; } + +protected: + virtual void Run( void *pvParam ) = 0; + virtual void Run( void *pvParam, bool /*bIOFailure*/, SteamAPICall_t /*hSteamAPICall*/ ) { Run( pvParam ); } + virtual int GetCallbackSizeBytes() { return sizeof_P; } }; @@ -235,7 +280,7 @@ private: m_hAPICall = k_uAPICallInvalid; // caller unregisters for us (m_pObj->*m_Func)( (P *)pvParam, false ); } - void Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall ) + virtual void Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall ) { if ( hSteamAPICall == m_hAPICall ) { @@ -243,7 +288,7 @@ private: (m_pObj->*m_Func)( (P *)pvParam, bIOFailure ); } } - int GetCallbackSizeBytes() + virtual int GetCallbackSizeBytes() { return sizeof( P ); } @@ -257,31 +302,24 @@ private: //----------------------------------------------------------------------------- // Purpose: maps a steam callback to a class member function -// template params: T = local class, P = parameter struct +// template params: T = local class, P = parameter struct, +// bGameserver = listen for gameserver callbacks instead of client callbacks //----------------------------------------------------------------------------- -template< class T, class P, bool bGameServer > -class CCallback : protected CCallbackBase +template< class T, class P, bool bGameserver = false > +class CCallback : public CCallbackImpl< sizeof( P ) > { public: - typedef void (T::*func_t)( P* ); + typedef void (T::*func_t)(P*); - // If you can't support constructing a callback with the correct parameters - // then uncomment the empty constructor below and manually call - // ::Register() for your object - // Or, just call the regular constructor with (NULL, NULL) - // CCallback() {} - - // constructor for initializing this object in owner's constructor - CCallback( T *pObj, func_t func ) : m_pObj( pObj ), m_Func( func ) + // NOTE: If you can't provide the correct parameters at construction time, you should + // use the CCallbackManual callback object (STEAM_CALLBACK_MANUAL macro) instead. + CCallback( T *pObj, func_t func ) : m_pObj( NULL ), m_Func( NULL ) { - if ( pObj && func ) - Register( pObj, func ); - } - - ~CCallback() - { - if ( m_nCallbackFlags & k_ECallbackFlagsRegistered ) - Unregister(); + if ( bGameserver ) + { + this->SetGameserverFlag(); + } + Register( pObj, func ); } // manual registration of the callback @@ -290,13 +328,9 @@ public: if ( !pObj || !func ) return; - if ( m_nCallbackFlags & k_ECallbackFlagsRegistered ) + if ( this->m_nCallbackFlags & CCallbackBase::k_ECallbackFlagsRegistered ) Unregister(); - if ( bGameServer ) - { - m_nCallbackFlags |= k_ECallbackFlagsGameServer; - } m_pObj = pObj; m_Func = func; // SteamAPI_RegisterCallback sets k_ECallbackFlagsRegistered @@ -309,38 +343,50 @@ public: SteamAPI_UnregisterCallback( this ); } - void SetGameserverFlag() { m_nCallbackFlags |= k_ECallbackFlagsGameServer; } protected: virtual void Run( void *pvParam ) { (m_pObj->*m_Func)( (P *)pvParam ); } - virtual void Run( void *pvParam, bool, SteamAPICall_t ) - { - (m_pObj->*m_Func)( (P *)pvParam ); - } - int GetCallbackSizeBytes() - { - return sizeof( P ); - } T *m_pObj; func_t m_Func; }; -// Allows you to defer registration of the callback -template< class T, class P, bool bGameServer > + +//----------------------------------------------------------------------------- +// Purpose: subclass of CCallback which allows default-construction in +// an unregistered state; you must call Register manually +//----------------------------------------------------------------------------- +template< class T, class P, bool bGameServer = false > class CCallbackManual : public CCallback< T, P, bGameServer > { public: CCallbackManual() : CCallback< T, P, bGameServer >( NULL, NULL ) {} + + // Inherits public Register and Unregister functions from base class }; -// utility macro for declaring the function and callback object together -#define STEAM_CALLBACK( thisclass, func, param, var ) CCallback< thisclass, param, false > var; void func( param *pParam ) -// same as above, but lets you defer the callback binding by calling Register later -#define STEAM_CALLBACK_MANUAL( thisclass, func, param, var ) CCallbackManual< thisclass, param, false > var; void func( param *pParam ) + +//----------------------------------------------------------------------------- +// The following macros are implementation details, not intended for public use +//----------------------------------------------------------------------------- +#define _STEAM_CALLBACK_AUTO_HOOK( thisclass, func, param ) +#define _STEAM_CALLBACK_HELPER( _1, _2, SELECTED, ... ) _STEAM_CALLBACK_##SELECTED +#define _STEAM_CALLBACK_SELECT( X, Y ) _STEAM_CALLBACK_HELPER X Y +#define _STEAM_CALLBACK_3( extra_code, thisclass, func, param ) \ + struct CCallbackInternal_ ## func : private CCallbackImpl< sizeof( param ) > { \ + CCallbackInternal_ ## func () { extra_code SteamAPI_RegisterCallback( this, param::k_iCallback ); } \ + CCallbackInternal_ ## func ( const CCallbackInternal_ ## func & ) { extra_code SteamAPI_RegisterCallback( this, param::k_iCallback ); } \ + CCallbackInternal_ ## func & operator=( const CCallbackInternal_ ## func & ) { return *this; } \ + private: virtual void Run( void *pvParam ) { _STEAM_CALLBACK_AUTO_HOOK( thisclass, func, param ) \ + thisclass *pOuter = reinterpret_cast<thisclass*>( reinterpret_cast<char*>(this) - offsetof( thisclass, m_steamcallback_ ## func ) ); \ + pOuter->func( reinterpret_cast<param*>( pvParam ) ); \ + } \ + } m_steamcallback_ ## func ; void func( param *pParam ) +#define _STEAM_CALLBACK_4( _, thisclass, func, param, var ) \ + CCallback< thisclass, param > var; void func( param *pParam ) #ifdef _WIN32 diff --git a/mp/src/public/steam/steam_gameserver.h b/mp/src/public/steam/steam_gameserver.h index 98e26a72..6b67da1d 100644 --- a/mp/src/public/steam/steam_gameserver.h +++ b/mp/src/public/steam/steam_gameserver.h @@ -59,6 +59,7 @@ S_API ISteamUtils *SteamGameServerUtils(); S_API ISteamNetworking *SteamGameServerNetworking(); S_API ISteamGameServerStats *SteamGameServerStats(); S_API ISteamHTTP *SteamGameServerHTTP(); +S_API ISteamUGC *SteamGameServerUGC(); #endif S_API void SteamGameServer_Shutdown(); @@ -67,9 +68,21 @@ S_API void SteamGameServer_RunCallbacks(); S_API bool SteamGameServer_BSecure(); S_API uint64 SteamGameServer_GetSteamID(); -#define STEAM_GAMESERVER_CALLBACK( thisclass, func, param, var ) CCallback< thisclass, param, true > var; void func( param *pParam ) + +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +// These macros are similar to the STEAM_CALLBACK_* macros in steam_api.h, but only trigger for gameserver callbacks +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +#define STEAM_GAMESERVER_CALLBACK( thisclass, func, /*callback_type, [deprecated] var*/... ) \ + _STEAM_CALLBACK_SELECT( ( __VA_ARGS__, GS, 3 ), ( this->SetGameserverFlag();, thisclass, func, __VA_ARGS__ ) ) + +#define STEAM_GAMESERVER_CALLBACK_MANUAL( thisclass, func, callback_type, var ) \ + CCallbackManual< thisclass, callback_type, true > var; void func( callback_type *pParam ) + +#define _STEAM_CALLBACK_GS( _, thisclass, func, param, var ) \ + CCallback< thisclass, param, true > var; void func( param *pParam ) + //----------------------------------------------------------------------------------------------------------------------------------------------------------// // steamclient.dll private wrapper functions // @@ -101,6 +114,7 @@ public: ISteamNetworking *SteamGameServerNetworking() { return m_pSteamGameServerNetworking; } ISteamGameServerStats *SteamGameServerStats() { return m_pSteamGameServerStats; } ISteamHTTP *SteamHTTP() { return m_pSteamHTTP; } + ISteamUGC *SteamUGC() { return m_pSteamUGC; } private: ISteamGameServer *m_pSteamGameServer; @@ -108,6 +122,7 @@ private: ISteamNetworking *m_pSteamGameServerNetworking; ISteamGameServerStats *m_pSteamGameServerStats; ISteamHTTP *m_pSteamHTTP; + ISteamUGC *m_pSteamUGC; }; inline CSteamGameServerAPIContext::CSteamGameServerAPIContext() @@ -122,6 +137,7 @@ inline void CSteamGameServerAPIContext::Clear() m_pSteamGameServerNetworking = NULL; m_pSteamGameServerStats = NULL; m_pSteamHTTP = NULL; + m_pSteamUGC = NULL; } S_API ISteamClient *g_pSteamClientGameServer; @@ -154,6 +170,10 @@ inline bool CSteamGameServerAPIContext::Init() if ( !m_pSteamHTTP ) return false; + m_pSteamUGC = g_pSteamClientGameServer->GetISteamUGC( hSteamUser, hSteamPipe, STEAMUGC_INTERFACE_VERSION ); + if ( !m_pSteamUGC ) + return false; + return true; } diff --git a/mp/src/public/steam/steamclientpublic.h b/mp/src/public/steam/steamclientpublic.h index f5998599..4e952dc7 100644 --- a/mp/src/public/steam/steamclientpublic.h +++ b/mp/src/public/steam/steamclientpublic.h @@ -114,6 +114,17 @@ enum EResult k_EResultAccountLoginDeniedThrottle = 87, // login attempt failed, try to throttle response to possible attacker k_EResultTwoFactorCodeMismatch = 88, // two factor code mismatch k_EResultTwoFactorActivationCodeMismatch = 89, // activation code for two-factor didn't match + k_EResultAccountAssociatedToMultiplePartners = 90, // account has been associated with multiple partners + k_EResultNotModified = 91, // data not modified + k_EResultNoMobileDevice = 92, // the account does not have a mobile device associated with it + k_EResultTimeNotSynced = 93, // the time presented is out of range or tolerance + k_EResultSmsCodeFailed = 94, // SMS code failure (no match, none pending, etc.) + k_EResultAccountLimitExceeded = 95, // Too many accounts access this resource + k_EResultAccountActivityLimitExceeded = 96, // Too many changes to this account + k_EResultPhoneActivityLimitExceeded = 97, // Too many changes to this phone + k_EResultRefundToWallet = 98, // Cannot refund to payment method, must use wallet + k_EResultEmailSendFailure = 99, // Cannot send an email + k_EResultNotSettled = 100, // Can't perform operation till payment has settled }; // Error codes for use with the voice functions @@ -127,11 +138,13 @@ enum EVoiceResult k_EVoiceResultDataCorrupted = 5, k_EVoiceResultRestricted = 6, k_EVoiceResultUnsupportedCodec = 7, + k_EVoiceResultReceiverOutOfDate = 8, + k_EVoiceResultReceiverDidNotAnswer = 9, }; // Result codes to GSHandleClientDeny/Kick -typedef enum +enum EDenyReason { k_EDenyInvalid = 0, k_EDenyInvalidVersion = 1, @@ -149,14 +162,14 @@ typedef enum k_EDenySteamResponseTimedOut = 13, k_EDenySteamValidationStalled = 14, k_EDenySteamOwnerLeftGuestUser = 15, -} EDenyReason; +}; // return type of GetAuthSessionTicket typedef uint32 HAuthTicket; const HAuthTicket k_HAuthTicketInvalid = 0; // results from BeginAuthSession -typedef enum +enum EBeginAuthSessionResult { k_EBeginAuthSessionResultOK = 0, // Ticket is valid for this game and this steamID. k_EBeginAuthSessionResultInvalidTicket = 1, // Ticket is not valid. @@ -164,10 +177,10 @@ typedef enum k_EBeginAuthSessionResultInvalidVersion = 3, // Ticket is from an incompatible interface version k_EBeginAuthSessionResultGameMismatch = 4, // Ticket is not for this game k_EBeginAuthSessionResultExpiredTicket = 5, // Ticket has expired -} EBeginAuthSessionResult; +}; // Callback values for callback ValidateAuthTicketResponse_t which is a response to BeginAuthSession -typedef enum +enum EAuthSessionResponse { k_EAuthSessionResponseOK = 0, // Steam has verified the user is online, the ticket is valid and ticket has not been reused. k_EAuthSessionResponseUserNotConnectedToSteam = 1, // The user in question is not connected to steam @@ -179,15 +192,15 @@ typedef enum k_EAuthSessionResponseAuthTicketInvalidAlreadyUsed = 7, // This ticket has already been used, it is not valid. k_EAuthSessionResponseAuthTicketInvalid = 8, // This ticket is not from a user instance currently connected to steam. k_EAuthSessionResponsePublisherIssuedBan = 9, // The user is banned for this game. The ban came via the web api and not VAC -} EAuthSessionResponse; +}; // results from UserHasLicenseForApp -typedef enum +enum EUserHasLicenseForAppResult { k_EUserHasLicenseResultHasLicense = 0, // User has a license for specified app k_EUserHasLicenseResultDoesNotHaveLicense = 1, // User does not have a license for the specified app k_EUserHasLicenseResultNoAuth = 2, // User has not been authenticated -} EUserHasLicenseForAppResult; +}; // Steam account types @@ -244,6 +257,7 @@ enum EAppOwnershipFlags k_EAppOwnershipFlags_LicensePermanent = 0x0800, // permanent license, not borrowed, or guest or freeweekend etc k_EAppOwnershipFlags_LicenseRecurring = 0x1000, // Recurring license, user is charged periodically k_EAppOwnershipFlags_LicenseCanceled = 0x2000, // Mark as canceled, but might be still active if recurring + k_EAppOwnershipFlags_AutoGrant = 0x4000, // Ownership is based on any kind of autogrant license }; @@ -262,8 +276,8 @@ enum EAppType k_EAppType_Guide = 0x040, // game guide, PDF etc k_EAppType_Driver = 0x080, // hardware driver updater (ATI, Razor etc) k_EAppType_Config = 0x100, // hidden app used to config Steam features (backpack, sales, etc) - k_EAppType_Film = 0x200, // A Movie (feature film) - k_EAppType_TVSeries = 0x400, // A TV or other video series which will have episodes and perhaps seasons + k_EAppType_Hardware = 0x200, // a hardware device (Steam Machine, Steam Controller, Steam Link, etc.) + // 0x400 is up for grabs here k_EAppType_Video = 0x800, // A video component of either a Film or TVSeries (may be the feature, an episode, preview, making-of, etc) k_EAppType_Plugin = 0x1000, // Plug-in types for other Apps k_EAppType_Music = 0x2000, // Music files @@ -313,6 +327,7 @@ enum EChatEntryType k_EChatEntryTypeHistoricalChat = 11, // a chat message from user's chat history or offilne message k_EChatEntryTypeReserved1 = 12, k_EChatEntryTypeReserved2 = 13, + k_EChatEntryTypeLinkBlocked = 14, // a link was removed by the chat filter. }; @@ -394,6 +409,27 @@ enum ENotificationPosition }; +//----------------------------------------------------------------------------- +// Purpose: Broadcast upload result details +//----------------------------------------------------------------------------- +enum EBroadcastUploadResult +{ + k_EBroadcastUploadResultNone = 0, // broadcast state unknown + k_EBroadcastUploadResultOK = 1, // broadcast was good, no problems + k_EBroadcastUploadResultInitFailed = 2, // broadcast init failed + k_EBroadcastUploadResultFrameFailed = 3, // broadcast frame upload failed + k_EBroadcastUploadResultTimeout = 4, // broadcast upload timed out + k_EBroadcastUploadResultBandwidthExceeded = 5, // broadcast send too much data + k_EBroadcastUploadResultLowFPS = 6, // broadcast FPS too low + k_EBroadcastUploadResultMissingKeyFrames = 7, // broadcast sending not enough key frames + k_EBroadcastUploadResultNoConnection = 8, // broadcast client failed to connect to relay + k_EBroadcastUploadResultRelayFailed = 9, // relay dropped the upload + k_EBroadcastUploadResultSettingsChanged = 10, // the client changed broadcast settings + k_EBroadcastUploadResultMissingAudio = 11, // client failed to send audio data + k_EBroadcastUploadResultTooFarBehind = 12, // clients was too slow uploading +}; + + #pragma pack( push, 1 ) #define CSTEAMID_DEFINED @@ -896,10 +932,10 @@ public: m_gameID.m_nType = k_EGameIDTypeGameMod; char rgchModDir[MAX_PATH]; - Q_FileBase( pchModPath, rgchModDir, sizeof( rgchModDir ) ); + V_FileBase( pchModPath, rgchModDir, sizeof( rgchModDir ) ); CRC32_t crc32; CRC32_Init( &crc32 ); - CRC32_ProcessBuffer( &crc32, rgchModDir, Q_strlen( rgchModDir ) ); + CRC32_ProcessBuffer( &crc32, rgchModDir, V_strlen( rgchModDir ) ); CRC32_Final( &crc32 ); // set the high-bit on the mod-id @@ -916,8 +952,8 @@ public: CRC32_t crc32; CRC32_Init( &crc32 ); - CRC32_ProcessBuffer( &crc32, pchExePath, Q_strlen( pchExePath ) ); - CRC32_ProcessBuffer( &crc32, pchAppName, Q_strlen( pchAppName ) ); + CRC32_ProcessBuffer( &crc32, pchExePath, V_strlen( pchExePath ) ); + CRC32_ProcessBuffer( &crc32, pchAppName, V_strlen( pchAppName ) ); CRC32_Final( &crc32 ); // set the high-bit on the mod-id @@ -937,7 +973,7 @@ public: CRC32_t crc32; CRC32_Init( &crc32 ); const char *pchFileId = vstFileID.Render(); - CRC32_ProcessBuffer( &crc32, pchFileId, Q_strlen( pchFileId ) ); + CRC32_ProcessBuffer( &crc32, pchFileId, V_strlen( pchFileId ) ); CRC32_Final( &crc32 ); // set the high-bit on the mod-id diff --git a/mp/src/public/steam/steamcontrollerpublic.h b/mp/src/public/steam/steamcontrollerpublic.h deleted file mode 100644 index 327ea46a..00000000 --- a/mp/src/public/steam/steamcontrollerpublic.h +++ /dev/null @@ -1,79 +0,0 @@ -//========= Copyright � 1996-2013, Valve LLC, All rights reserved. ============ -// -// Purpose: Controller related public types/constants -// -//============================================================================= - -#ifndef STEAMCONTROLLERPUBLIC_H -#define STEAMCONTROLLERPUBLIC_H -#ifdef _WIN32 -#pragma once -#endif - - -#if defined( STEAM ) || defined( ISTEAMCONTROLLER_H ) -// This file should only be included by the Steam build or directly from -// isteamcontroller.h. -#include "steamtypes.h" -#else -#include <stdint.h> -typedef uint32_t uint32; -#ifdef __C51__ -typedef uint8_t uint64[8]; -#else -typedef uint64_t uint64; -#endif -#endif - -#pragma pack(1) - -// Safe to add new bitfields at the end of this list for new buttons/actions, -// but never re-use or re-number an existing flag as old client code will be -// confused. -#define STEAM_RIGHT_TRIGGER_MASK 0x0000000000000001l -#define STEAM_LEFT_TRIGGER_MASK 0x0000000000000002l -#define STEAM_RIGHT_BUMPER_MASK 0x0000000000000004l -#define STEAM_LEFT_BUMPER_MASK 0x0000000000000008l -#define STEAM_BUTTON_0_MASK 0x0000000000000010l -#define STEAM_BUTTON_1_MASK 0x0000000000000020l -#define STEAM_BUTTON_2_MASK 0x0000000000000040l -#define STEAM_BUTTON_3_MASK 0x0000000000000080l -#define STEAM_TOUCH_0_MASK 0x0000000000000100l -#define STEAM_TOUCH_1_MASK 0x0000000000000200l -#define STEAM_TOUCH_2_MASK 0x0000000000000400l -#define STEAM_TOUCH_3_MASK 0x0000000000000800l -#define STEAM_BUTTON_MENU_MASK 0x0000000000001000l -#define STEAM_BUTTON_STEAM_MASK 0x0000000000002000l -#define STEAM_BUTTON_ESCAPE_MASK 0x0000000000004000l -#define STEAM_BUTTON_BACK_LEFT_MASK 0x0000000000008000l -#define STEAM_BUTTON_BACK_RIGHT_MASK 0x0000000000010000l -#define STEAM_BUTTON_LEFTPAD_CLICKED_MASK 0x0000000000020000l -#define STEAM_BUTTON_RIGHTPAD_CLICKED_MASK 0x0000000000040000l -#define STEAM_LEFTPAD_FINGERDOWN_MASK 0x0000000000080000l -#define STEAM_RIGHTPAD_FINGERDOWN_MASK 0x0000000000100000l - -// Only add fields to the end of this struct, or if you need to change it in a larger -// way add a new message id and new struct completely so as to not break old clients. -typedef struct -{ - // If packet num matches that on your prior call, then the controller state hasn't been changed since - // your last call and there is no need to process it - uint32 unPacketNum; - - // bit flags for each of the buttons - uint64 ulButtons; - - // Left pad coordinates - short sLeftPadX; - short sLeftPadY; - - // Right pad coordinates - short sRightPadX; - short sRightPadY; - -} SteamControllerState_t; - -#pragma pack() - -#endif // STEAMCONTROLLERPUBLIC_H - diff --git a/mp/src/public/steam/steamhttpenums.h b/mp/src/public/steam/steamhttpenums.h index 11a4a03a..e15171f4 100644 --- a/mp/src/public/steam/steamhttpenums.h +++ b/mp/src/public/steam/steamhttpenums.h @@ -64,7 +64,7 @@ enum EHTTPStatusCode // Error codes k_EHTTPStatusCode400BadRequest = 400, - k_EHTTPStatusCode401Unauthorized = 401, + k_EHTTPStatusCode401Unauthorized = 401, // You probably want 403 or something else. 401 implies you're sending a WWW-Authenticate header and the client can sent an Authorization header in response. k_EHTTPStatusCode402PaymentRequired = 402, // This is reserved for future HTTP specs, not really supported by clients k_EHTTPStatusCode403Forbidden = 403, k_EHTTPStatusCode404NotFound = 404, @@ -81,6 +81,7 @@ enum EHTTPStatusCode k_EHTTPStatusCode415UnsupportedMediaType = 415, k_EHTTPStatusCode416RequestedRangeNotSatisfiable = 416, k_EHTTPStatusCode417ExpectationFailed = 417, + k_EHTTPStatusCode4xxUnknown = 418, // 418 is reserved, so we'll use it to mean unknown k_EHTTPStatusCode429TooManyRequests = 429, // Server error codes @@ -90,6 +91,7 @@ enum EHTTPStatusCode k_EHTTPStatusCode503ServiceUnavailable = 503, k_EHTTPStatusCode504GatewayTimeout = 504, k_EHTTPStatusCode505HTTPVersionNotSupported = 505, + k_EHTTPStatusCode5xxUnknown = 599, }; #endif // STEAMHTTPENUMS_H
\ No newline at end of file diff --git a/mp/src/public/steam/steamtypes.h b/mp/src/public/steam/steamtypes.h index c3320a10..22ce3e61 100644 --- a/mp/src/public/steam/steamtypes.h +++ b/mp/src/public/steam/steamtypes.h @@ -84,6 +84,25 @@ typedef unsigned int uintp; #endif // else _WIN32 +#ifdef __clang__ +# define CLANG_ATTR(ATTR) __attribute__((annotate( ATTR ))) +#else +# define CLANG_ATTR(ATTR) +#endif + +#define METHOD_DESC(DESC) CLANG_ATTR( "desc:" #DESC ";" ) +#define IGNOREATTR() CLANG_ATTR( "ignore" ) +#define OUT_STRUCT() CLANG_ATTR( "out_struct: ;" ) +#define OUT_ARRAY_CALL(COUNTER,FUNCTION,PARAMS) CLANG_ATTR( "out_array_call:" #COUNTER "," #FUNCTION "," #PARAMS ";" ) +#define OUT_ARRAY_COUNT(COUNTER, DESC) CLANG_ATTR( "out_array_count:" #COUNTER ";desc:" #DESC ) +#define ARRAY_COUNT(COUNTER) CLANG_ATTR( "array_count:" #COUNTER ";" ) +#define ARRAY_COUNT_D(COUNTER, DESC) CLANG_ATTR( "array_count:" #COUNTER ";desc:" #DESC ) +#define BUFFER_COUNT(COUNTER) CLANG_ATTR( "buffer_count:" #COUNTER ";" ) +#define OUT_BUFFER_COUNT(COUNTER) CLANG_ATTR( "out_buffer_count:" #COUNTER ";" ) +#define OUT_STRING_COUNT(COUNTER) CLANG_ATTR( "out_string_count:" #COUNTER ";" ) +#define DESC(DESC) CLANG_ATTR("desc:" #DESC ";") + + const int k_cubSaltSize = 8; typedef uint8 Salt_t[ k_cubSaltSize ]; @@ -98,12 +117,13 @@ typedef uint64 GID_t; const GID_t k_GIDNil = 0xffffffffffffffffull; // For convenience, we define a number of types that are just new names for GIDs -typedef GID_t JobID_t; // Each Job has a unique ID +typedef uint64 JobID_t; // Each Job has a unique ID typedef GID_t TxnID_t; // Each financial transaction has a unique ID const GID_t k_TxnIDNil = k_GIDNil; const GID_t k_TxnIDUnknown = 0; +const JobID_t k_JobIDNil = 0xffffffffffffffffull; // this is baked into client messages and interfaces as an int, // make sure we never break this. @@ -111,6 +131,8 @@ typedef uint32 PackageId_t; const PackageId_t k_uPackageIdFreeSub = 0x0; const PackageId_t k_uPackageIdInvalid = 0xFFFFFFFF; +typedef uint32 BundleId_t; +const BundleId_t k_uBundleIdInvalid = 0; // this is baked into client messages and interfaces as an int, // make sure we never break this. diff --git a/mp/src/public/steam/steamvr.h b/mp/src/public/steam/steamvr.h deleted file mode 100644 index be62fc86..00000000 --- a/mp/src/public/steam/steamvr.h +++ /dev/null @@ -1,261 +0,0 @@ -#pragma once - -#include <stdint.h> - -namespace vr -{ - -#if defined(__linux__) || defined(__APPLE__) - // The 32-bit version of gcc has the alignment requirement for uint64 and double set to - // 4 meaning that even with #pragma pack(8) these types will only be four-byte aligned. - // The 64-bit version of gcc has the alignment requirement for these types set to - // 8 meaning that unless we use #pragma pack(4) our structures will get bigger. - // The 64-bit structure packing has to match the 32-bit structure packing for each platform. -#pragma pack( push, 4 ) -#else -#pragma pack( push, 8 ) -#endif - - -// right-handed system -// +y is up -// +x is to the right -// -z is going away from you -// Distance unit is meters -struct HmdMatrix34_t -{ - float m[3][4]; -}; - -struct HmdMatrix44_t -{ - float m[4][4]; -}; - - -/** Used to return the post-distortion UVs for each color channel. -* UVs range from 0 to 1 with 0,0 in the upper left corner of the -* source render target. The 0,0 to 1,1 range covers a single eye. */ -struct DistortionCoordinates_t -{ - float rfRed[2]; - float rfGreen[2]; - float rfBlue[2]; -}; - - -enum Hmd_Eye -{ - Eye_Left = 0, - Eye_Right = 1 -}; - -enum GraphicsAPIConvention -{ - API_DirectX = 0, // Normalized Z goes from 0 at the viewer to 1 at the far clip plane - API_OpenGL = 1, // Normalized Z goes from 1 at the viewer to -1 at the far clip plane -}; - -enum HmdTrackingResult -{ - TrackingResult_Uninitialized = 1, - - TrackingResult_Calibrating_InProgress = 100, - TrackingResult_Calibrating_OutOfRange = 101, - - TrackingResult_Running_OK = 200, - TrackingResult_Running_OutOfRange = 201, -}; - -class IHmd -{ -public: - - - // ------------------------------------ - // Display Methods - // ------------------------------------ - - /** Size and position that the window needs to be on the VR display. */ - virtual void GetWindowBounds( int32_t *pnX, int32_t *pnY, uint32_t *pnWidth, uint32_t *pnHeight ) = 0; - - /** Suggested size for the intermediate render target that the distortion pulls from. */ - virtual void GetRecommendedRenderTargetSize( uint32_t *pnWidth, uint32_t *pnHeight ) = 0; - - /** Gets the viewport in the frame buffer to draw the output of the distortion into */ - virtual void GetEyeOutputViewport( Hmd_Eye eEye, uint32_t *pnX, uint32_t *pnY, uint32_t *pnWidth, uint32_t *pnHeight ) = 0; - - /** The projection matrix for the specified eye */ - virtual HmdMatrix44_t GetProjectionMatrix( Hmd_Eye eEye, float fNearZ, float fFarZ, GraphicsAPIConvention eProjType ) = 0; - - /** The components necessary to build your own projection matrix in case your - * application is doing something fancy like infinite Z */ - virtual void GetProjectionRaw( Hmd_Eye eEye, float *pfLeft, float *pfRight, float *pfTop, float *pfBottom ) = 0; - - /** Returns the result of the distortion function for the specified eye and input UVs. UVs go from 0,0 in - * the upper left of that eye's viewport and 1,1 in the lower right of that eye's viewport. */ - virtual DistortionCoordinates_t ComputeDistortion( Hmd_Eye eEye, float fU, float fV ) = 0; - - /** Returns the transform from eye space to the head space. Eye space is the per-eye flavor of head - * space that provides stereo disparity. Instead of Model * View * Projection the sequence is Model * View * Eye^-1 * Projection. - * Normally View and Eye^-1 will be multiplied together and treated as View in your application. - */ - virtual HmdMatrix34_t GetHeadFromEyePose( Hmd_Eye eEye ) = 0; - - /** For use in simple VR apps, this method returns the concatenation of the - * tracking pose and the eye matrix to get a full view matrix for each eye. - * This is ( GetEyeMatrix() ) * (GetWorldFromHeadPose() ^ -1 ) */ - virtual bool GetViewMatrix( float fSecondsFromNow, HmdMatrix44_t *pMatLeftView, HmdMatrix44_t *pMatRightView, HmdTrackingResult *peResult ) = 0; - - /** [D3D9 Only] - * Returns the adapter index that the user should pass into CreateDevice to set up D3D9 in such - * a way that it can go full screen exclusive on the HMD. Returns -1 if there was an error. - */ - virtual int32_t GetD3D9AdapterIndex() = 0; - - /** [D3D10/11 Only] - * Returns the adapter index and output index that the user should pass into EnumAdapters adn EnumOutputs - * to create the device and swap chain in DX10 and DX11. If an error occurs both indices will be set to -1. - */ - virtual void GetDXGIOutputInfo( int32_t *pnAdapterIndex, int32_t *pnAdapterOutputIndex ) = 0; - - /** [Windows Only] - * Notifies the system that the VR output will appear in a particular window. - */ - virtual void AttachToWindow( void *hWnd ) = 0; - - // ------------------------------------ - // Tracking Methods - // ------------------------------------ - - /** The pose that the tracker thinks that the HMD will be in at the specified - * number of seconds into the future. Pass 0 to get the current state. - * - * This is roughly analogous to the inverse of the view matrix in most applications, though - * many games will need to do some additional rotation or translation on top of the rotation - * and translation provided by the head pose. - * - * If this function returns true the pose has been populated with a pose that can be used by the application. - * Check peResult for details about the pose, including messages that should be displayed to the user. - */ - virtual bool GetTrackerFromHeadPose( float fPredictedSecondsFromNow, HmdMatrix34_t *pmPose, HmdTrackingResult *peResult ) = 0; - - /** Passes back the pose matrix from the last successful call to GetWorldFromHeadPose(). Returns true if that matrix is - * valid (because there has been a previous successful pose.) */ - virtual bool GetLastTrackerFromHeadPose( HmdMatrix34_t *pmPose ) = 0; - - /** Returns true if the tracker for this HMD will drift the Yaw component of its pose over time regardless of - * actual head motion. This is true for gyro-based trackers with no ground truth. */ - virtual bool WillDriftInYaw() = 0; - - /** Sets the zero pose for the tracker coordinate system. After this call all WorldFromHead poses will be relative - * to the pose whenever this was called. The new zero coordinate system will not change the fact that the Y axis is - * up in the real world, so the next pose returned from GetWorldFromHeadPose after a call to ZeroTracker may not be - * exactly an identity matrix. */ - virtual void ZeroTracker() = 0; - - /** Returns the zero pose for the tracker coordinate system. If the tracker has never had a valid pose, this - * will be an identity matrix. */ - virtual HmdMatrix34_t GetTrackerZeroPose() = 0; - - // ------------------------------------ - // Administrative methods - // ------------------------------------ - - /** The ID of the driver this HMD uses as a UTF-8 string. Returns the length of the ID in bytes. If - * the buffer is not large enough to fit the ID an empty string will be returned. In general, 128 bytes - * will be enough to fit any ID. */ - virtual uint32_t GetDriverId( char *pchBuffer, uint32_t unBufferLen ) = 0; - - /** The ID of this display within its driver this HMD uses as a UTF-8 string. Returns the length of the ID in bytes. If - * the buffer is not large enough to fit the ID an empty string will be returned. In general, 128 bytes - * will be enough to fit any ID. */ - virtual uint32_t GetDisplayId( char *pchBuffer, uint32_t unBufferLen ) = 0; -}; - -static const char * const IHmd_Version = "IHmd_005"; - -/** error codes returned by Vr_Init */ -enum HmdError -{ - HmdError_None = 0, - - HmdError_Init_InstallationNotFound = 100, - HmdError_Init_InstallationCorrupt = 101, - HmdError_Init_VRClientDLLNotFound = 102, - HmdError_Init_FileNotFound = 103, - HmdError_Init_FactoryNotFound = 104, - HmdError_Init_InterfaceNotFound = 105, - HmdError_Init_InvalidInterface = 106, - HmdError_Init_UserConfigDirectoryInvalid = 107, - HmdError_Init_HmdNotFound = 108, - HmdError_Init_NotInitialized = 109, - - HmdError_Driver_Failed = 200, - HmdError_Driver_Unknown = 201, - HmdError_Driver_HmdUnknown = 202, - HmdError_Driver_NotLoaded = 203, - - HmdError_IPC_ServerInitFailed = 300, - HmdError_IPC_ConnectFailed = 301, - HmdError_IPC_SharedStateInitFailed = 302, - - HmdError_VendorSpecific_UnableToConnectToOculusRuntime = 1000, - -}; - - -// figure out how to import from the VR API dll -#if defined(_WIN32) - -#ifdef VR_API_EXPORT -#define VR_INTERFACE extern "C" __declspec( dllexport ) -#else -#define VR_INTERFACE extern "C" __declspec( dllimport ) -#endif - -#elif defined(GNUC) || defined(COMPILER_GCC) - -#ifdef VR_API_EXPORT -#define VR_INTERFACE extern "C" __attribute__((visibility("default"))) -#else -#define VR_INTERFACE extern "C" -#endif - -#else -#error "Unsupported Platform." -#endif - - - - -/** Finds the active installation of the VR API and initializes it. The priority for figuring -* out where to load vrclient from are: -* 1. The convar "VR_OVERRIDE", which should contain an absolute path to the root of -* an vr API directory. -* 2. The pchVROverride argument. This should be an absolute path or a path relative to -* the current executable. -* 3. The path "./vr" relative to the current executable's path. -* -* Each of these paths are to the "root" of the VR API install. That's the directory with -* the "drivers" directory and a platform (i.e. "win32") directory in it, not the directory with the DLL itself. -*/ -VR_INTERFACE IHmd *VR_Init( HmdError *peError ); - -/** unloads vrclient.dll. Any interface pointers from the interface are -* invalid after this point */ -VR_INTERFACE void VR_Shutdown( ); - -/** Returns true if there is an HMD attached. This check is as lightweight as possible and -* can be called outside of VR_Init/VR_Shutdown. It should be used when an application wants -* to know if initializing VR is a possibility but isn't ready to take that step yet. -*/ -VR_INTERFACE bool VR_IsHmdPresent(); - -/** Returns the string version of an HMD error. This function may be called outside of VR_Init()/VR_Shutdown(). */ -VR_INTERFACE const char *VR_GetStringForHmdError( HmdError error ); - -#pragma pack( pop ) - - -}
\ No newline at end of file |