Commits

Ryan Stecker committed 8a9e5a2

Knowledge is power.

  • Participants
  • Parent commits 384e606

Comments (0)

Files changed (26)

File Open Steamworks/CGameID.h

 
 	struct GameID_t
 	{
+#ifdef VALVE_BIG_ENDIAN
+		unsigned int m_nModID : 32;
+		unsigned int m_nType : 8;
+		unsigned int m_nAppID : 24;
+#else
 		unsigned int m_nAppID : 24;
 		unsigned int m_nType : 8;
 		unsigned int m_nModID : 32;
+#endif
 	};
 
 	union

File Open Steamworks/CSteamID.h

 	CSteamID( uint32 unAccountID, unsigned int unAccountInstance, EUniverse eUniverse, EAccountType eAccountType )
 	{
 #if defined(_SERVER) && defined(Assert)
-		Assert( ! ( ( k_EAccountTypeIndividual == eAccountType ) && ( 1 != unAccountInstance ) ) );	// enforce that for individual accounts, instance is always 1
+		Assert( ! ( ( k_EAccountTypeIndividual == eAccountType ) && ( unAccountInstance > k_unSteamUserConsoleInstance ) ) );	// enforce that for individual accounts, instance is always 1
 #endif // _SERVER
 		InstancedSet( unAccountID, unAccountInstance, eUniverse, eAccountType );
 	}
 		}
 		else
 		{
-			m_steamid.m_comp.m_unAccountInstance = 1;
+			// by default we pick the desktop instance
+			m_steamid.m_comp.m_unAccountInstance = k_unSteamUserDesktopInstance;
 		}
 	}
 
 	//-----------------------------------------------------------------------------
 	void FullSet( uint64 ulIdentifier, EUniverse eUniverse, EAccountType eAccountType )
 	{
-		m_steamid.m_comp.m_unAccountID = ( ulIdentifier & 0xFFFFFFFF );						// account ID is low 32 bits
-		m_steamid.m_comp.m_unAccountInstance = ( ( ulIdentifier >> 32 ) & 0xFFFFF );			// account instance is next 20 bits
+		m_steamid.m_comp.m_unAccountID = ( ulIdentifier & k_unSteamAccountIDMask );						// account ID is low 32 bits
+		m_steamid.m_comp.m_unAccountInstance = ( ( ulIdentifier >> 32 ) & k_unSteamAccountInstanceMask );			// account instance is next 20 bits
 		m_steamid.m_comp.m_EUniverse = eUniverse;
 		m_steamid.m_comp.m_EAccountType = eAccountType;
 	}
 	//-----------------------------------------------------------------------------
 	void SetFromSteam2( TSteamGlobalUserID *pTSteamGlobalUserID, EUniverse eUniverse )
 	{
-		m_steamid.m_comp.m_unAccountID = pTSteamGlobalUserID->m_SteamLocalUserID.Split.Low32bits * 2 +
+		m_steamid.m_comp.m_unAccountID = pTSteamGlobalUserID->m_SteamLocalUserID.Split.Low32bits * 2 + 
 			pTSteamGlobalUserID->m_SteamLocalUserID.Split.High32bits;
 		m_steamid.m_comp.m_EUniverse = eUniverse;		// set the universe
 		m_steamid.m_comp.m_EAccountType = k_EAccountTypeIndividual; // Steam 2 accounts always map to account type of individual
-		m_steamid.m_comp.m_unAccountInstance = 1;	// individual accounts always have an account instance ID of 1
+		m_steamid.m_comp.m_unAccountInstance = k_unSteamUserDesktopInstance; // Steam2 only knew desktop instances
 	}
 
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
 	bool BIndividualAccount() const
 	{
-		return m_steamid.m_comp.m_EAccountType == k_EAccountTypeIndividual;
+		return m_steamid.m_comp.m_EAccountType == k_EAccountTypeIndividual || m_steamid.m_comp.m_EAccountType == k_EAccountTypeConsoleUser;
 	}
 
 
 		return m_steamid.m_comp.m_EAccountType == k_EAccountTypeAnonUser;
 	}
 
+	//-----------------------------------------------------------------------------
+	// Purpose: Is this a faked up Steam ID for a PSN friend account?
+	//-----------------------------------------------------------------------------
+	bool BConsoleUserAccount() const
+	{
+		return m_steamid.m_comp.m_EAccountType == k_EAccountTypeConsoleUser;
+	}
+
 
 	// simple accessors
 	void SetAccountID( uint32 unAccountID )		{ m_steamid.m_comp.m_unAccountID = unAccountID; }
+	void SetAccountInstance( uint32 unInstance ){ m_steamid.m_comp.m_unAccountInstance = unInstance; }
+	void ClearIndividualInstance()				{ if ( BIndividualAccount() ) m_steamid.m_comp.m_unAccountInstance = 0; }
+	bool HasNoIndividualInstance() const		{ return BIndividualAccount() && (m_steamid.m_comp.m_unAccountInstance==0); }
 	uint32 GetAccountID() const					{ return m_steamid.m_comp.m_unAccountID; }
 	uint32 GetUnAccountInstance() const			{ return m_steamid.m_comp.m_unAccountInstance; }
 	EAccountType GetEAccountType() const		{ return ( EAccountType ) m_steamid.m_comp.m_EAccountType; }
 	{
 		struct SteamIDComponent_t
 		{
+#ifdef VALVE_BIG_ENDIAN
+			EUniverse			m_EUniverse : 8;	// universe this account belongs to
+			unsigned int		m_EAccountType : 4;			// type of account - can't show as EAccountType, due to signed / unsigned difference
+			unsigned int		m_unAccountInstance : 20;	// dynamic instance ID
 			uint32				m_unAccountID : 32;			// unique account identifier
-			unsigned int		m_unAccountInstance : 20;	// dynamic instance ID (used for multiseat type accounts only)
+#else
+			uint32				m_unAccountID : 32;			// unique account identifier
+			unsigned int		m_unAccountInstance : 20;	// dynamic instance ID
 			unsigned int		m_EAccountType : 4;			// type of account - can't show as EAccountType, due to signed / unsigned difference
 			EUniverse			m_EUniverse : 8;	// universe this account belongs to
+#endif
 		} m_comp;
 
 		uint64 m_unAll64Bits;
 
 	if ( m_steamid.m_comp.m_EAccountType == k_EAccountTypeIndividual )
 	{
-		if ( m_steamid.m_comp.m_unAccountID == 0 || m_steamid.m_comp.m_unAccountInstance != 1 )
+		if ( m_steamid.m_comp.m_unAccountID == 0 || m_steamid.m_comp.m_unAccountInstance > k_unSteamUserConsoleInstance )
 			return false;
 	}
 
 }
 
 // generic invalid CSteamID
-const CSteamID k_steamIDNil;
+#define k_steamIDNil CSteamID()
 
 // This steamID comes from a user game connection to an out of date GS that hasnt implemented the protocol
 // to provide its steamID
-const CSteamID k_steamIDOutofDateGS( 0, 0, k_EUniverseInvalid, k_EAccountTypeInvalid );
+#define k_steamIDOutofDateGS CSteamID( 0, 0, k_EUniverseInvalid, k_EAccountTypeInvalid )
 // This steamID comes from a user game connection to an sv_lan GS
-const CSteamID k_steamIDLanModeGS( 0, 0, k_EUniversePublic, k_EAccountTypeInvalid );
+#define k_steamIDLanModeGS CSteamID( 0, 0, k_EUniversePublic, k_EAccountTypeInvalid )
 // This steamID can come from a user game connection to a GS that has just booted but hasnt yet even initialized
 // its steam3 component and started logging on.
-const CSteamID k_steamIDNotInitYetGS( 1, 0, k_EUniverseInvalid, k_EAccountTypeInvalid );
+#define k_steamIDNotInitYetGS CSteamID( 1, 0, k_EUniverseInvalid, k_EAccountTypeInvalid )
 // This steamID can come from a user game connection to a GS that isn't using the steam authentication system but still
 // wants to support the "Join Game" option in the friends list
-const CSteamID k_steamIDNonSteamGS( 2, 0, k_EUniverseInvalid, k_EAccountTypeInvalid );
+#define k_steamIDNonSteamGS CSteamID( 2, 0, k_EUniverseInvalid, k_EAccountTypeInvalid )
 
 
 #ifdef STEAM

File Open Steamworks/EAccountType.h

 	k_EAccountTypeContentServer = 6,	// content server
 	k_EAccountTypeClan = 7,
 	k_EAccountTypeChat = 8,
-	k_EAccountTypeP2PSuperSeeder = 9,	// a fake steamid used by superpeers to seed content to users of Steam P2P stuff
+	k_EAccountTypeConsoleUser = 9,		// Fake SteamID for local PSN account on PS3 or Live account on 360, etc.
 	k_EAccountTypeAnonUser = 10,
 
 	// Max of 16 items in this field

File Open Steamworks/EResult.h

 	k_EResultOK	= 1,							// success
 	k_EResultFail = 2,							// generic failure 
 	k_EResultNoConnection = 3,					// no/failed network connection
-//	k_EResultNoConnectionRetry = 4,				// OBSOLETE - removed
+	//	k_EResultNoConnectionRetry = 4,				// OBSOLETE - removed
 	k_EResultInvalidPassword = 5,				// password/ticket is invalid
 	k_EResultLoggedInElsewhere = 6,				// same user logged in elsewhere
 	k_EResultInvalidProtocolVer = 7,			// protocol version is incorrect
 	k_EResultAdministratorOK = 46,				// allowed to take this action, but only because requester is admin
 	k_EResultContentVersion = 47,				// A Version mismatch in content transmitted within the Steam protocol.
 	k_EResultTryAnotherCM = 48,					// The current CM can't service the user making a request, user should try another.
-	k_EResultPasswordRequiredToKickSession = 49,		// You are already logged in elsewhere, this cached credential login has failed.
+	k_EResultPasswordRequiredToKickSession = 49,// You are already logged in elsewhere, this cached credential login has failed.
 	k_EResultAlreadyLoggedInElsewhere = 50,		// You are already logged in elsewhere, you must wait
-	k_EResultSuspended = 51,
-	k_EResultCancelled = 52,
-	k_EResultDataCorruption = 53,
-	k_EResultDiskFull = 54,
-	k_EResultRemoteCallFailed = 55,
+	k_EResultSuspended = 51,					// Long running operation (content download) suspended/paused
+	k_EResultCancelled = 52,					// Operation canceled (typically by user: content download)
+	k_EResultDataCorruption = 53,				// Operation canceled because data is ill formed or unrecoverable
+	k_EResultDiskFull = 54,						// Operation canceled - not enough disk space.
+	k_EResultRemoteCallFailed = 55,				// an remote call or IPC call failed
+	k_EResultPasswordUnset = 56,				// Password could not be verified as it's unset server side
+	k_EResultPSNAccountUnlinked = 57,			// Attempt to logon from a PS3 failed because the PSN online id is not linked to a Steam account
+	k_EResultPSNTicketInvalid = 58,				// PSN ticket was invalid
+	k_EResultPSNAccountAlreadyLinked = 59,		// PSN account is already linked to some other account, must explicitly request to replace/delete the link first
+	k_EResultRemoteFileConflict = 60,			// The sync cannot resume due to a conflict between the local and remote files
+	k_EResultIllegalPassword = 61,				// The requested new password is not legal
+	k_EResultSameAsPreviousValue = 62,			// new value is the same as the old one ( secret question and answer )
+	k_EResultAccountLogonDenied = 63,			// account login denied due to 2nd factor authentication failure
+	k_EResultCannotUseOldPassword = 64,			// The requested new password is not legal
+	k_EResultInvalidLoginAuthCode = 65,			// account login denied due to auth code invalid
+	k_EResultAccountLogonDeniedNoMail = 66,		// account login denied due to 2nd factor auth failure - and no mail has been sent
+	k_EResultHardwareNotCapableOfIPT = 67,		// 
+	k_EResultIPTInitError = 68,					// 
 
 } EResult;
 

File Open Steamworks/FriendsCommon.h

 	k_EChatActionResultVoiceSlotsFull = 10,
 } EChatActionResult;
 
+//-----------------------------------------------------------------------------
+// Purpose: user restriction flags
+//-----------------------------------------------------------------------------
+typedef enum EUserRestriction
+{
+	k_nUserRestrictionNone		= 0,	// no known chat/content restriction
+	k_nUserRestrictionUnknown	= 1,	// we don't know yet (user offline)
+	k_nUserRestrictionAnyChat	= 2,	// user is not allowed to (or can't) send/recv any chat
+	k_nUserRestrictionVoiceChat	= 4,	// user is not allowed to (or can't) send/recv voice chat
+	k_nUserRestrictionGroupChat	= 8,	// user is not allowed to (or can't) send/recv group chat
+	k_nUserRestrictionRating	= 16,	// user is too young according to rating in current region
+} EUserRestriction;
+
+
+// size limits on Rich Presence data
+enum { k_cchMaxRichPresenceKeys = 20 };
+enum { k_cchMaxRichPresenceKeyLength = 64 };
+enum { k_cchMaxRichPresenceValueLength = 256 };
+
 
 #pragma pack( push, 8 )
 //-----------------------------------------------------------------------------
 	bool m_bIgnored;
 };
 
-struct RichPresenceJoinRequested_t
+//-----------------------------------------------------------------------------
+// Purpose: marks the return of a request officer list call
+//-----------------------------------------------------------------------------
+struct ClanOfficerListResponse_t
+{
+	enum { k_iCallback = k_iSteamFriendsCallbacks + 35 };
+	CSteamID m_steamIDClan;
+	int m_cOfficers;
+	uint8 m_bSuccess;
+};
+
+//-----------------------------------------------------------------------------
+// Purpose: callback indicating updated data about friends rich presence information
+//-----------------------------------------------------------------------------
+struct FriendRichPresenceUpdate_t
+{
+	enum { k_iCallback = k_iSteamFriendsCallbacks + 36 };
+	CSteamID m_steamIDFriend;	// friend who's rich presence has changed
+	AppId_t m_nAppID;			// the appID of the game (should always be the current game)
+};
+
+//-----------------------------------------------------------------------------
+// Purpose: 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
+//-----------------------------------------------------------------------------
+struct GameRichPresenceJoinRequested_t
 {
 	enum { k_iCallback = k_iSteamFriendsCallbacks + 37 };
-
-	CSteamID m_ulSteamID;
-	char szUnk[512];
+	CSteamID m_steamIDFriend;		// the friend they did the join via (will be invalid if not directly via a friend)
+	char m_rgchConnect[k_cchMaxRichPresenceValueLength];
 };
 
 struct FriendProfileInfoReceived_t

File Open Steamworks/HTTPCommon.h

 #define CLIENTHTTP_INTERFACE_VERSION "CLIENTHTTP_INTERFACE_VERSION001"
 #define STEAMHTTP_INTERFACE_VERSION_001 "STEAMHTTP_INTERFACE_VERSION001"
 
+
+typedef uint32 HTTPRequestHandle;
+#define INVALID_HTTPREQUEST_HANDLE		0
+
+
+// This enum is used in client API methods, do not re-number existing values.
 typedef enum EHTTPMethod
 {
 	k_EHTTPMethodInvalid = 0,
-	k_EHTTPMethodGET = 1,
-	k_EHTTPMethodHEAD = 2,
-	k_EHTTPMethodPOST = 3,
+	k_EHTTPMethodGET,
+	k_EHTTPMethodHEAD,
+	k_EHTTPMethodPOST,
+
+	// The remaining HTTP methods are not yet supported, per rfc2616 section 5.1.1 only GET and HEAD are required for 
+	// a compliant general purpose server.  We'll likely add more as we find uses for them.
+
+	// k_EHTTPMethodOPTIONS,
+	// k_EHTTPMethodPUT,
+	// k_EHTTPMethodDELETE,
+	// k_EHTTPMethodTRACE,
+	// k_EHTTPMethodCONNECT
 } EHTTPMethod;
 
 
+// HTTP Status codes that the server can send in response to a request, see rfc2616 section 10.3 for descriptions
+// of each of these.
 typedef enum EHTTPStatusCode
 {
-	k_EHTTPStatusCodeInvalid = 0,
-	k_EHTTPStatusCode100Continue = 100,
-	k_EHTTPStatusCode101SwitchingProtocols = 101,
-	k_EHTTPStatusCode200OK = 200,
-	k_EHTTPStatusCode201Created = 201,
-	k_EHTTPStatusCode202Accepted = 202,
-	k_EHTTPStatusCode203NonAuthoritative = 203,
-	k_EHTTPStatusCode204NoContent = 204,
-	k_EHTTPStatusCode205ResetContent = 205,
-	k_EHTTPStatusCode206PartialContent = 206,
-	k_EHTTPStatusCode300MultipleChoices = 300,
-	k_EHTTPStatusCode301MovedPermanently = 301,
-	k_EHTTPStatusCode302Found = 302,
-	k_EHTTPStatusCode303SeeOther = 303,
-	k_EHTTPStatusCode304NotModified = 304,
-	k_EHTTPStatusCode305UseProxy = 305,
-	k_EHTTPStatusCode307TemporaryRedirect = 307,
-	k_EHTTPStatusCode400BadRequest = 400,
-	k_EHTTPStatusCode401Unauthorized = 401,
-	k_EHTTPStatusCode402PaymentRequired = 402,
-	k_EHTTPStatusCode403Forbidden = 403,
-	k_EHTTPStatusCode404NotFound = 404,
-	k_EHTTPStatusCode405MethodNotAllowed = 405,
-	k_EHTTPStatusCode406NotAcceptable = 406,
-	k_EHTTPStatusCode407ProxyAuthRequired = 407,
-	k_EHTTPStatusCode408RequestTimeout = 408,
-	k_EHTTPStatusCode409Conflict = 409,
-	k_EHTTPStatusCode410Gone = 410,
-	k_EHTTPStatusCode411LengthRequired = 411,
-	k_EHTTPStatusCode412PreconditionFailed = 412,
-	k_EHTTPStatusCode413RequestEntityTooLarge = 413,
-	k_EHTTPStatusCode414RequestURITooLong = 414,
-	k_EHTTPStatusCode415UnsupportedMediaType = 415,
+	// Invalid status code (this isn't defined in HTTP, used to indicate unset in our code)
+	k_EHTTPStatusCodeInvalid =					0,
+
+	// Informational codes
+	k_EHTTPStatusCode100Continue =				100,
+	k_EHTTPStatusCode101SwitchingProtocols =	101,
+
+	// Success codes
+	k_EHTTPStatusCode200OK =					200,
+	k_EHTTPStatusCode201Created =				201,
+	k_EHTTPStatusCode202Accepted =				202,
+	k_EHTTPStatusCode203NonAuthoritative =		203,
+	k_EHTTPStatusCode204NoContent =				204,
+	k_EHTTPStatusCode205ResetContent =			205,
+	k_EHTTPStatusCode206PartialContent =		206,
+
+	// Redirection codes
+	k_EHTTPStatusCode300MultipleChoices =		300,
+	k_EHTTPStatusCode301MovedPermanently =		301,
+	k_EHTTPStatusCode302Found =					302,
+	k_EHTTPStatusCode303SeeOther =				303,
+	k_EHTTPStatusCode304NotModified =			304,
+	k_EHTTPStatusCode305UseProxy =				305,
+	//k_EHTTPStatusCode306Unused =				306, (used in old HTTP spec, now unused in 1.1)
+	k_EHTTPStatusCode307TemporaryRedirect =		307,
+
+	// Error codes
+	k_EHTTPStatusCode400BadRequest =			400,
+	k_EHTTPStatusCode401Unauthorized =			401,
+	k_EHTTPStatusCode402PaymentRequired =		402, // This is reserved for future HTTP specs, not really supported by clients
+	k_EHTTPStatusCode403Forbidden =				403,
+	k_EHTTPStatusCode404NotFound =				404,
+	k_EHTTPStatusCode405MethodNotAllowed =		405,
+	k_EHTTPStatusCode406NotAcceptable =			406,
+	k_EHTTPStatusCode407ProxyAuthRequired =		407,
+	k_EHTTPStatusCode408RequestTimeout =		408,
+	k_EHTTPStatusCode409Conflict =				409,
+	k_EHTTPStatusCode410Gone =					410,
+	k_EHTTPStatusCode411LengthRequired =		411,
+	k_EHTTPStatusCode412PreconditionFailed =	412,
+	k_EHTTPStatusCode413RequestEntityTooLarge =	413,
+	k_EHTTPStatusCode414RequestURITooLong =		414,
+	k_EHTTPStatusCode415UnsupportedMediaType =	415,
 	k_EHTTPStatusCode416RequestedRangeNotSatisfiable = 416,
-	k_EHTTPStatusCode417ExpectationFailed = 417,
-	k_EHTTPStatusCode500InternalServerError = 500,
-	k_EHTTPStatusCode501NotImplemented = 501,
-	k_EHTTPStatusCode502BadGateway = 502,
-	k_EHTTPStatusCode503ServiceUnavailable = 503,
-	k_EHTTPStatusCode504GatewayTimeout = 504,
+	k_EHTTPStatusCode417ExpectationFailed =		417,
+
+	// Server error codes
+	k_EHTTPStatusCode500InternalServerError =	500,
+	k_EHTTPStatusCode501NotImplemented =		501,
+	k_EHTTPStatusCode502BadGateway =			502,
+	k_EHTTPStatusCode503ServiceUnavailable =	503,
+	k_EHTTPStatusCode504GatewayTimeout =		504,
 	k_EHTTPStatusCode505HTTPVersionNotSupported = 505,
 } EHTTPStatusCode;
 
 
+struct HTTPRequestCompleted_t
+{
+	enum { k_iCallback = k_iClientHTTPCallbacks + 1 };
+
+	// Handle value for the request that has completed.
+	HTTPRequestHandle m_hRequest;
+
+	// Context value that the user defined on the request that this callback is associated with, 0 if
+	// no context value was set.
+	uint64 m_ulContextValue;
+
+	// This will be true if we actually got any sort of response from the server (even an error).  
+	// It will be false if we failed due to an internal error or client side network failure.
+	bool m_bRequestSuccessful;
+
+	// 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;
+};
+
+
 #endif // HTTPCOMMON_H

File Open Steamworks/ISteamAppTicket001.h

 #include "SteamTypes.h"
 #include "AppTicketCommon.h"
 
+//-----------------------------------------------------------------------------
+// Purpose: hand out a reasonable "future proof" view of an app ownership ticket
+// the raw (signed) buffer, and indices into that buffer where the appid and 
+// steamid are located.  the sizes of the appid and steamid are implicit in 
+// (each version of) the interface - currently uin32 appid and uint64 steamid
+//-----------------------------------------------------------------------------
 abstract_class ISteamAppTicket001
 {
 public:
-	virtual uint32 GetAppOwnershipTicketData( uint32 nAppID, void *pvBuffer, uint32 cbBufferLength, uint32*, uint32*, uint32* ticket_length, uint32* signature_length ) = 0;
+    virtual uint32 GetAppOwnershipTicketData( uint32 nAppID, void *pvBuffer, uint32 cbBufferLength, uint32 *piAppId, uint32 *piSteamId, uint32 *piSignature, uint32 *pcbSignature ) = 0;
 };
 
 #endif // ISTEAMAPPTICKET001_H

File Open Steamworks/ISteamApps004.h

 abstract_class ISteamApps004
 {
 public:
-	virtual bool IsSubscribed() = 0;
-	virtual bool IsLowViolence() = 0;
-	virtual bool IsCybercafe() = 0;
-	virtual bool IsVACBanned() = 0;
+	virtual bool BIsSubscribed() = 0;
+	virtual bool BIsLowViolence() = 0;
+	virtual bool BIsCybercafe() = 0;
+	virtual bool BIsVACBanned() = 0;
 	virtual const char *GetCurrentGameLanguage() = 0;
 	virtual const char *GetAvailableGameLanguages() = 0;
 
 	// only use this member if you need to check ownership of another game related to yours, a demo for example
-	virtual bool IsSubscribedApp( AppId_t appID ) = 0;
+	virtual bool BIsSubscribedApp( AppId_t appID ) = 0;
 
 	// Takes AppID of DLC and checks if the user owns the DLC & if the DLC is installed
-	virtual bool IsDlcInstalled( AppId_t appID ) = 0;
+	virtual bool BIsDlcInstalled( AppId_t appID ) = 0;
 
-	virtual uint32 GetEarliestPurchaseUnixTime( AppId_t appID ) = 0;
-	virtual bool IsSubscribedFromFreeWeekend() = 0;
+	// returns the Unix time of the purchase of the app
+	virtual uint32 GetEarliestPurchaseUnixTime( AppId_t nAppID ) = 0;
 
+	// 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
+	virtual bool BIsSubscribedFromFreeWeekend() = 0;
+	// Returns the number of DLC pieces for the running app
 	virtual int GetDLCCount() = 0;
-	virtual bool GetDLCDataByIndex(int iIndex, AppId_t* pAppID, bool *, char *, int) = 0;
 
-	virtual void InstallDLC( AppId_t appID ) = 0;
-	virtual void UninstallDLC( AppId_t appID ) = 0;
+	// Returns metadata for DLC by index, of range [0, GetDLCCount()]
+	virtual bool BGetDLCDataByIndex( int iDLC, AppId_t *pAppID, bool *pbAvailable, char *pchName, int cchNameBufferSize ) = 0;
+
+	// Install/Uninstall control for optional DLC
+	virtual void InstallDLC( AppId_t nAppID ) = 0;
+	virtual void UninstallDLC( AppId_t nAppID ) = 0;
 };
 
 

File Open Steamworks/ISteamClient010.h

 	// callbacks will occur directly after the API function is called that generated the warning or message
 	virtual void SetWarningMessageHook( SteamAPIWarningMessageHook_t pFunction ) = 0;
 
-	virtual bool ShutdownIfAllPipesClosed() = 0;
+	// Trigger global shutdown for the DLL
+	virtual bool BShutdownIfAllPipesClosed() = 0;
 };
 
 

File Open Steamworks/ISteamFriends009.h

 	// like all the other interface functions that return a char *, it's important that this pointer is not saved
 	// off; it will eventually be free'd or re-allocated
 	virtual const char *GetPersonaName() = 0;
-	
+
 	// sets the player name, stores it on the server and publishes the changes to all friends who are online
 	virtual void SetPersonaName( const char *pchPersonaName ) = 0;
 
 	// friend iteration
 	// takes a set of k_EFriendFlags, and returns the number of users the client knows about who meet that criteria
 	// then GetFriendByIndex() can then be used to return the id's of each of those users
-	virtual int GetFriendCount( EFriendFlags eFriendFlags ) = 0;
+	virtual int GetFriendCount( int iFriendFlags ) = 0;
 
 	// returns the steamID of a user
 	// iFriend is a index of range [0, GetFriendCount())
 	// returns the name another user - guaranteed to not be NULL.
 	// same rules as GetFriendPersonaState() apply as to whether or not the user knowns the name of the other user
 	// note that on first joining a lobby, chat room or game server the local user will not known the name of the other users automatically; that information will arrive asyncronously
+	// 
 	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 
 
 	// 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, EFriendFlags eFriendFlags ) = 0;
+	virtual bool HasFriend( CSteamID steamIDFriend, int iFriendFlags ) = 0;
 
 	// clan (group) iteration and access functions
 	virtual int GetClanCount() = 0;
 	virtual void SetInGameVoiceSpeaking( CSteamID steamIDUser, bool bSpeaking ) = 0;
 
 	// activates the game overlay, with an optional dialog to open 
-	// valid options are "Friends", "Community", "Players", "Settings", "LobbyInvite", "OfficialGameGroup"
+	// valid options are "Friends", "Community", "Players", "Settings", "LobbyInvite", "OfficialGameGroup", "Stats", "Achievements"
 	virtual void ActivateGameOverlay( const char *pchDialog ) = 0;
 
 	// activates game overlay to a specific place
 	// valid options are
 	//		"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 
+	//		"stats" - opens the overlay web browser to the specified user's stats
+	//		"achievements" - opens the overlay web browser to the specified user's achievements
 	virtual void ActivateGameOverlayToUser( const char *pchDialog, CSteamID steamID ) = 0;
 
 	// activates game overlay web browser directly to the specified URL
 	// You can also use ActivateGameOverlay( "LobbyInvite" ) to allow the user to create invitations for their current public lobby.
 	virtual void ActivateGameOverlayInviteDialog( CSteamID steamIDLobby ) = 0;
 
-	// gets the avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set
+	// gets the small (32x32) avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set
 	virtual int GetSmallFriendAvatar( CSteamID steamIDFriend ) = 0;
+
+	// gets the medium (64x64) avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set
 	virtual int GetMediumFriendAvatar( CSteamID steamIDFriend ) = 0;
+
+	// gets the large (184x184) avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set
+	// returns -1 if this image has yet to be loaded, in this case wait for a AvatarImageLoaded_t callback and then call this again
 	virtual int GetLargeFriendAvatar( CSteamID steamIDFriend ) = 0;
 
-	virtual bool RequestUserInformation( CSteamID steamID, bool bUnk1 ) = 0;
+	// requests information about a user - persona name & avatar
+	// if bRequireNameOnly is set, then the avatar of a user isn't downloaded 
+	// - it's a lot slower to download avatars and churns the local cache, so if you don't need avatars, don't request them
+	// if returns true, it means that data is being requested, and a PersonaStateChanged_t callback will be posted when it's retrieved
+	// if returns false, it means that we already have all the details about that user, and functions can be called immediately
+	virtual bool RequestUserInformation( CSteamID steamIDUser, bool bRequireNameOnly ) = 0;
 
-	virtual SteamAPICall_t RequestClanOfficerList( CSteamID clanId ) = 0;
-	virtual CSteamID GetClanOwner( CSteamID clanId ) = 0;
-	virtual int GetClanOfficerCount( CSteamID clanId ) = 0;
-	virtual CSteamID GetClanOfficerByIndex( CSteamID clanId, int iIndex ) = 0;
+	// requests information about a clan officer list
+	// when complete, data is returned in ClanOfficerListResponse_t call result
+	// this makes available the calls below
+	// you can only ask about clans that a user is a member of
+	// note that this won't download avatars automatically; if you get an officer,
+	// and no avatar image is available, call RequestUserInformation( steamID, false ) to download the avatar
+	virtual SteamAPICall_t RequestClanOfficerList( CSteamID steamIDClan ) = 0;
 
-	virtual unknown_ret GetUserRestrictions() = 0;
+	// iteration of clan officers - can only be done when a RequestClanOfficerList() call has completed
 
-	virtual bool SetRichPresence( const char *szKey, const char *szValue ) = 0;
+	// returns the steamID of the clan owner
+	virtual CSteamID GetClanOwner( CSteamID steamIDClan ) = 0;
+	// returns the number of officers in a clan (including the owner)
+	virtual int GetClanOfficerCount( CSteamID steamIDClan ) = 0;
+	// returns the steamID of a clan officer, by index, of range [0,GetClanOfficerCount)
+	virtual CSteamID GetClanOfficerByIndex( CSteamID steamIDClan, int iOfficer ) = 0;
+	// if current user is chat restricted, he can't send or receive any text/voice chat messages.
+	// the user can't see custom avatars. But the user can be online and send/recv game invites.
+	// a chat restricted user can't add friends or join any groups.
+	virtual uint32 GetUserRestrictions() = 0;
+
+	// Rich Presence data is automatically shared between friends who are in the same game
+	// Each user has a set of Key/Value pairs
+	// Up to 20 different keys can be set
+	// There are two magic keys:
+	//		"status"  - a UTF-8 string that will show up in the 'view game info' dialog in the Steam friends list
+	//		"connect" - a UTF-8 string that contains the command-line for how a friend can connect to a game
+	// GetFriendRichPresence() returns an empty string "" if no value is set
+	// SetRichPresence() to a NULL or an empty string deletes the key
+	// You can iterate the current set of keys for a friend with GetFriendRichPresenceKeyCount()
+	// and GetFriendRichPresenceKeyByIndex() (typically only used for debugging)
+	virtual bool SetRichPresence( const char *pchKey, const char *pchValue ) = 0;
 	virtual void ClearRichPresence() = 0;
-	virtual const char* GetFriendRichPresence( CSteamID steamIDFriend, const char *szKey ) = 0;
-	virtual int32 GetFriendRichPresenceKeyCount( CSteamID steamIDFriend ) = 0;
-	virtual const char* GetFriendRichPresenceKeyByIndex( CSteamID steamIDFriend, int32 iIndex ) = 0;
+	virtual const char *GetFriendRichPresence( CSteamID steamIDFriend, const char *pchKey ) = 0;
+	virtual int GetFriendRichPresenceKeyCount( CSteamID steamIDFriend ) = 0;
+	virtual const char *GetFriendRichPresenceKeyByIndex( CSteamID steamIDFriend, int iKey ) = 0;
 
-	virtual bool InviteUserToGame( CSteamID steamID, const char *szUnk ) = 0;
+	// rich invite support
+	// if the target accepts the invite, the pchConnectString gets added to the command-line for launching the game
+	// if the game is already running, a GameRichPresenceJoinRequested_t callback is posted containing the connect string
+	// invites can only be sent to friends
+	virtual bool InviteUserToGame( CSteamID steamIDFriend, const char *pchConnectString ) = 0;
 
+	// recently-played-with friends iteration
+	// this iterates the entire list of users recently played with, across games
+	// GetFriendCoplayTime() returns as a unix time
 	virtual int GetCoplayFriendCount() = 0;
-	virtual CSteamID GetCoplayFriend( int32 iIndex ) = 0;
-	virtual RTime32 GetFriendCoplayTime( CSteamID steamID ) = 0;
-	virtual AppId_t GetFriendCoplayGame( CSteamID steamID ) = 0;
+	virtual CSteamID GetCoplayFriend( int iCoplayFriend ) = 0;
+	virtual int GetFriendCoplayTime( CSteamID steamIDFriend ) = 0;
+	virtual AppId_t GetFriendCoplayGame( CSteamID steamIDFriend ) = 0;
 
 };
 

File Open Steamworks/ISteamGameServer010.h

 abstract_class ISteamGameServer010
 {
 public:
-
 	// connection functions
 	virtual void LogOn() = 0;
 	virtual void LogOff() = 0;
 
 	// status functions
-	virtual bool LoggedOn() = 0;
-	virtual bool Secure() = 0; 
+	virtual bool BLoggedOn() = 0;
+	virtual bool BSecure() = 0; 
 	virtual CSteamID GetSteamID() = 0;
 
 	// Handles receiving a new connection from a Steam user.  This call will ask the Steam
 	// account being logged into multiple servers, showing who is currently on a server, etc.
 	virtual void SendUserDisconnect( CSteamID steamIDUser ) = 0;
 
-
 	// Update the data to be displayed in the server browser and matchmaking interfaces for a user
 	// currently connected to the server.  For regular users you must call this after you receive a
 	// GSUserValidationSuccess callback.
 	// 
 	// Return Value: true if successful, false if failure (ie, steamIDUser wasn't for an active player)
-	virtual bool UpdateUserData( CSteamID steamIDUser, const char *pchPlayerName, uint32 uScore ) = 0;
+	virtual bool BUpdateUserData( CSteamID steamIDUser, const char *pchPlayerName, uint32 uScore ) = 0;
 
 	// You shouldn't need to call this as it is called internally by SteamGameServer_Init() and can only be called once.
 	//
 	//			
 	// bugbug jmccaskey - figure out how to remove this from the API and only expose via SteamGameServer_Init... or make this actually used,
 	// and stop calling it in SteamGameServer_Init()?
-	virtual bool SetServerType( uint32 unServerFlags, uint32 unGameIP, uint16 unGamePort, uint16 unSpectatorPort, uint16 usQueryPort, const char *pchGameDir, const char *pchVersion, bool bLANMode ) = 0;
+	virtual bool BSetServerType( uint32 unServerFlags, uint32 unGameIP, uint16 unGamePort, 
+		uint16 unSpectatorPort, uint16 usQueryPort, const char *pchGameDir, const char *pchVersion, bool bLANMode ) = 0;
 
 	// Updates server status values which shows up in the server browser and matchmaking APIs
-	virtual void UpdateServerStatus( int cPlayers, int cPlayersMax, int cBotPlayers, const char *pchServerName, const char *pSpectatorServerName, const char *pchMapName ) = 0;
+	virtual void UpdateServerStatus( int cPlayers, int cPlayersMax, int cBotPlayers, 
+		const char *pchServerName, const char *pSpectatorServerName, 
+		const char *pchMapName ) = 0;
 
 	// This can be called if spectator goes away or comes back (passing 0 means there is no spectator server now).
 	virtual void UpdateSpectatorPort( uint16 unSpectatorPort ) = 0;
 	// to determine if the user owns downloadable content specified by the provided AppID.
 	virtual EUserHasLicenseForAppResult UserHasLicenseForApp( CSteamID steamID, AppId_t appID ) = 0;
 
-	// Retrieve ticket to be sent to the entity who wishes to authenticate you. 
+	// New auth system APIs - do not mix with the old auth system APIs.
+	// ----------------------------------------------------------------
+
+	// Retrieve ticket to be sent to the entity who wishes to authenticate you ( using BeginAuthSession API ). 
 	// pcbTicket retrieves the length of the actual ticket.
 	virtual HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket ) = 0;
 
-	// Authenticate ticket from entity steamID to be sure it is valid and isnt reused
+	// Authenticate ticket ( from GetAuthSessionTicket ) from entity steamID to be sure it is valid and isnt reused
 	// Registers for callbacks if the entity goes offline or cancels the ticket ( see ValidateAuthTicketResponse_t callback and EAuthSessionResponse )
 	virtual EBeginAuthSessionResult BeginAuthSession( const void *pAuthTicket, int cbAuthTicket, CSteamID steamID ) = 0;
 

File Open Steamworks/ISteamHTTP001.h

 abstract_class ISteamHTTP001
 {
 public:
-	virtual HTTPRequestHandle CreateHTTPRequest( EHTTPMethod eHTTPRequestMethod, char *pchAbsoluteURL ) = 0;
-	
+
+	// 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/ 
+	// or such.
+	virtual HTTPRequestHandle CreateHTTPRequest( EHTTPMethod eHTTPRequestMethod, const char *pchAbsoluteURL ) = 0;
+
+	// Set a context value for the request, which will be returned in the HTTPRequestCompleted_t callback after
+	// sending the request.  This is just so the caller can easily keep track of which callbacks go with which request data.
 	virtual bool SetHTTPRequestContextValue( HTTPRequestHandle hRequest, uint64 ulContextValue ) = 0;
+
+	// Set a timeout in seconds for the HTTP request, must be called prior to sending the request.  Default
+	// timeout is 60 seconds if you don't call this.  Returns false if the handle is invalid, or the request
+	// has already been sent.
 	virtual bool SetHTTPRequestNetworkActivityTimeout( HTTPRequestHandle hRequest, uint32 unTimeoutSeconds ) = 0;
-	virtual bool SetHTTPRequestHeaderValue( HTTPRequestHandle hRequest, char *pchHeaderName, char *pchHeaderValue ) = 0;
-	virtual bool SetHTTPRequestGetOrPostParameter( HTTPRequestHandle hRequest, char *pchParamName, char *pchParamValue ) = 0;
-	
+
+	// Set a request header value for the request, must be called prior to sending the request.  Will 
+	// return false if the handle is invalid or the request is already sent.
+	virtual bool SetHTTPRequestHeaderValue( HTTPRequestHandle hRequest, const char *pchHeaderName, const char *pchHeaderValue ) = 0;
+
+	// Set a GET or POST parameter value on the request, which is set will depend on the EHTTPMethod specified
+	// when creating the request.  Must be called prior to sending the request.  Will return false if the 
+	// handle is invalid or the request is already sent.
+	virtual bool SetHTTPRequestGetOrPostParameter( HTTPRequestHandle hRequest, const char *pchParamName, const char *pchParamValue ) = 0;
+
+	// Sends the HTTP request, will return false on a bad handle, otherwise use SteamCallHandle to wait on
+	// asyncronous response via callback.
+	//
+	// Note: If the user is in offline mode in Steam, then this will add a only-if-cached cache-control 
+	// header and only do a local cache lookup rather than sending any actual remote request.
 	virtual bool SendHTTPRequest( HTTPRequestHandle hRequest, SteamAPICall_t *pCallHandle ) = 0;
+
+	// Defers a request you have sent, the actual HTTP client code may have many requests queued, and this will move
+	// the specified request to the tail of the queue.  Returns false on invalid handle, or if the request is not yet sent.
 	virtual bool DeferHTTPRequest( HTTPRequestHandle hRequest ) = 0;
+
+	// Prioritizes a request you have sent, the actual HTTP client code may have many requests queued, and this will move
+	// the specified request to the head of the queue.  Returns false on invalid handle, or if the request is not yet sent.
 	virtual bool PrioritizeHTTPRequest( HTTPRequestHandle hRequest ) = 0;
-	
-	virtual bool GetHTTPResponseHeaderSize( HTTPRequestHandle hRequest, char *pchHeaderName, uint32 *unResponseHeaderSize ) = 0;
-	virtual bool GetHTTPResponseHeaderValue( HTTPRequestHandle hRequest, char *pchHeaderName, uint8 *pHeaderValueBuffer, uint32 uBufferSize ) = 0;
+
+	// Checks if a response header is present in a HTTP response given a handle from HTTPRequestCompleted_t, also 
+	// returns the size of the header value if present so the caller and allocate a correctly sized buffer for
+	// GetHTTPResponseHeaderValue.
+	virtual bool GetHTTPResponseHeaderSize( HTTPRequestHandle hRequest, const char *pchHeaderName, uint32 *unResponseHeaderSize ) = 0;
+
+	// Gets header values from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the
+	// header is not present or if your buffer is too small to contain it's value.  You should first call 
+	// BGetHTTPResponseHeaderSize to check for the presence of the header and to find out the size buffer needed.
+	virtual bool GetHTTPResponseHeaderValue( HTTPRequestHandle hRequest, const char *pchHeaderName, uint8 *pHeaderValueBuffer, uint32 unBufferSize ) = 0;
+
+	// Gets the size of the body data from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the 
+	// handle is invalid.
 	virtual bool GetHTTPResponseBodySize( HTTPRequestHandle hRequest, uint32 *unBodySize ) = 0;
+
+	// Gets the body data from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the 
+	// handle is invalid or if the provided buffer is not the correct size.  Use BGetHTTPResponseBodySize first to find out
+	// the correct buffer size to use.
 	virtual bool GetHTTPResponseBodyData( HTTPRequestHandle hRequest, uint8 *pBodyDataBuffer, uint32 unBufferSize ) = 0;
-	
+
+	// Releases an HTTP response handle, should always be called to free resources after receiving a HTTPRequestCompleted_t
+	// callback and finishing using the response.
 	virtual bool ReleaseHTTPRequest( HTTPRequestHandle hRequest ) = 0;
-	virtual bool GetHTTPDownloadProgressPct( HTTPRequestHandle hRequest, float * pflProgress ) = 0;
+
+	// Gets progress on downloading the body for the request.  This will be zero unless a response header has already been
+	// received which included a content-length field.  For responses that contain no content-length it will report
+	// zero for the duration of the request as the size is unknown until the connection closes.
+	virtual bool GetHTTPDownloadProgressPct( HTTPRequestHandle hRequest, float *pflPercentOut ) = 0;
 };
 
 #endif // ISTEAMHTTP001_H

File Open Steamworks/ISteamRemoteStorage004.h

 abstract_class ISteamRemoteStorage004
 {
 public:
-	virtual bool FileWrite( const char *pchFile, const void *pvData, int32 cubData ) = 0;
-	virtual int32 FileRead( const char *pchFile, void *pvData, int32 cubDataToRead ) = 0;
-	
-	virtual bool FileForget( const char *pchFile ) = 0;
-	virtual bool FileDelete( const char *pchFile ) = 0;
+	// NOTE
+	//
+	// Filenames are case-insensitive, and will be converted to lowercase automatically.
+	// So "foo.bar" and "Foo.bar" are the same file, and if you write "Foo.bar" then
+	// iterate the files, the filename returned will be "foo.bar".
+	//
+
+	// file operations
+	virtual bool	FileWrite( const char *pchFile, const void *pvData, int32 cubData ) = 0;
+	virtual int32	FileRead( const char *pchFile, void *pvData, int32 cubDataToRead ) = 0;
+	virtual bool	FileForget( const char *pchFile ) = 0;
+	virtual bool	FileDelete( const char *pchFile ) = 0;
 	virtual SteamAPICall_t FileShare( const char *pchFile ) = 0;
+	virtual bool	SetSyncPlatforms( const char *pchFile, ERemoteStoragePlatform eRemoteStoragePlatform ) = 0;
 
-	virtual bool SetSyncPlatforms( const char *pchFile, int iUnk ) = 0;
+	// file information
+	virtual bool	FileExists( const char *pchFile ) = 0;
+	virtual bool	FilePersisted( const char *pchFile ) = 0;
+	virtual int32	GetFileSize( const char *pchFile ) = 0;
+	virtual int64	GetFileTimestamp( const char *pchFile ) = 0;
+	virtual ERemoteStoragePlatform GetSyncPlatforms( const char *pchFile ) = 0;
 
-	virtual bool FileExists( const char *pchFile ) = 0;
-	virtual bool FilePersisted( const char *pchFile ) = 0;
-	virtual int32 GetFileSize( const char *pchFile ) = 0;
-	virtual int64 GetFileTimestamp( const char *pchFile ) = 0;
-
-	virtual int GetSyncPlatforms( const char *pchFile ) = 0;
-
+	// iteration
 	virtual int32 GetFileCount() = 0;
 	virtual const char *GetFileNameAndSize( int iFile, int32 *pnFileSizeInBytes ) = 0;
 
+	// configuration management
 	virtual bool GetQuota( int32 *pnTotalBytes, int32 *puAvailableBytes ) = 0;
+	virtual bool IsCloudEnabledForAccount() = 0;
+	virtual bool IsCloudEnabledForApp() = 0;
+	virtual void SetCloudEnabledForApp( bool bEnabled ) = 0;
 
-	virtual bool IsCloudEnabledForAccount() = 0;
-	virtual bool IsCloudEnabledThisApp() = 0;
-	virtual bool SetCloudEnabledThisApp( bool bEnable ) = 0;
+	// user generated content
+	virtual SteamAPICall_t UGCDownload( UGCHandle_t hContent ) = 0;
+	virtual bool	GetUGCDetails( UGCHandle_t hContent, AppId_t *pnAppID, char **ppchName, int32 *pnFileSizeInBytes, CSteamID *pSteamIDOwner ) = 0;
+	virtual int32	UGCRead( UGCHandle_t hContent, void *pvData, int32 cubDataToRead ) = 0;
 
-	virtual SteamAPICall_t UGCDownload( unsigned long long ) = 0;
-	virtual bool GetUGCDetails( unsigned long long, unsigned int *, char **, int *, CSteamID * ) = 0;
-	virtual int32 UGCRead( unsigned long long, void *, int ) = 0;
-	virtual int32 GetCachedUGCCount() = 0;
-	virtual uint64 GetCachedUGCHandle( int ) = 0;
+	// user generated content iteration
+	virtual int32	GetCachedUGCCount() = 0;
+	virtual	UGCHandle_t GetCachedUGCHandle( int32 iCachedContent ) = 0;
 };
 
 #endif // ISTEAMREMOTESTORAGE004_H

File Open Steamworks/ISteamUser016.h

 	// Legacy functions
 
 	// used by only a few games to track usage events
-	virtual void TrackAppUsageEvent( CGameID gameID, EAppUsageEvent eAppUsageEvent, const char *pchExtraInfo = "" ) = 0;
+	virtual void TrackAppUsageEvent( CGameID gameID, int eAppUsageEvent, const char *pchExtraInfo = "" ) = 0;
 
 	// get the local storage folder for current Steam account to write application data, e.g. save games, configs etc.
 	// this will usually be something like "C:\Progam Files\Steam\userdata\<SteamID>\<AppID>\local"
 	// This provides both the compressed and uncompressed data. Please note that the uncompressed
 	// data is not the raw feed from the microphone: data may only be available if audible 
 	// levels of speech are detected.
-	virtual EVoiceResult GetAvailableVoice(uint32 *pcbCompressed, uint32 *pcbUncompressed,uint32 nSamplesPerSec ) = 0;
+	// nUncompressedVoiceDesiredSampleRate is necessary to know the number of bytes to return in pcbUncompressed - can be set to 0 if you don't need uncompressed (the usual case)
+	virtual EVoiceResult GetAvailableVoice(uint32 *pcbCompressed, uint32 *pcbUncompressed, uint32 nUncompressedVoiceDesiredSampleRate) = 0;
 
 	// Gets the latest voice data from the microphone. Compressed data is an arbitrary format, and is meant to be handed back to 
 	// DecompressVoice() for playback later as a binary blob. Uncompressed data is 16-bit, signed integer, 11025Hz PCM format.
 	// You must grab both compressed and uncompressed here at the same time, if you want both.
 	// Matching data that is not read during this call will be thrown away.
 	// GetAvailableVoice() can be used to determine how much data is actually available.
-	virtual EVoiceResult GetVoice( bool bWantCompressed, void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten, bool bWantUncompressed, void *pUncompressedDestBuffer, uint32 cbUncompressedDestBufferSize, uint32 *nUncompressBytesWritten, uint32 nSamplesPerSec ) = 0;
+	virtual EVoiceResult GetVoice( bool bWantCompressed, void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten, bool bWantUncompressed, void *pUncompressedDestBuffer, uint32 cbUncompressedDestBufferSize, uint32 *nUncompressBytesWritten, uint32 nUncompressedVoiceDesiredSampleRate ) = 0;
 
 	// Decompresses a chunk of compressed data produced by GetVoice().
 	// nBytesWritten is set to the number of bytes written to pDestBuffer unless the return value is k_EVoiceResultBufferTooSmall.
 	// In that case, nBytesWritten is set to the size of the buffer required to decompress the given
 	// data. The suggested buffer size for the destination buffer is 22 kilobytes.
-	virtual EVoiceResult DecompressVoice( void *pCompressed, uint32 cbCompressed, void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten, uint32 nSamplesPerSec ) = 0;
+	// The output format of the data is 16-bit signed at the requested samples per second.
+	virtual EVoiceResult DecompressVoice( const void *pCompressed, uint32 cbCompressed, void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten, uint32 nDesiredSampleRate ) = 0;
 
+	// This returns the frequency of the voice data as it's stored internally; calling DecompressVoice() with this size will yield the best results
 	virtual uint32 GetVoiceOptimalSampleRate() = 0;
 
 	// Retrieve ticket to be sent to the entity who wishes to authenticate you. 
 	// to determine if the user owns downloadable content specified by the provided AppID.
 	virtual EUserHasLicenseForAppResult UserHasLicenseForApp( CSteamID steamID, AppId_t appID ) = 0;
 
+	// returns true if this users looks like they are behind a NAT device. Only valid once the user has connected to steam 
+	// (i.e a SteamServersConnected_t has been issued) and may not catch all forms of NAT.
+	virtual bool BIsBehindNAT() = 0;
 
-	virtual bool IsBehindNAT() = 0;
-	
-	virtual bool AdvertiseGame( CSteamID steamIDGameServer, uint32 unIPServer , uint16 usPortServer ) = 0;
+	// set data to be replicated to friends so that they can join your game
+	// CSteamID steamIDGameServer - the steamID of the game server, received from the game server by the client
+	// uint32 unIPServer, uint16 usPortServer - the IP address of the game server
+	virtual void AdvertiseGame( CSteamID steamIDGameServer, uint32 unIPServer, uint16 usPortServer ) = 0;
 
-	virtual SteamAPICall_t RequestEncryptedAppTicket(const void *pUserData, int cbUserData) = 0;
-	virtual bool GetEncryptedAppTicket(void *pTicket, int cbMaxTicket, uint32 *pcbTicket) = 0;
+	// Requests a ticket encrypted with an app specific shared key
+	// pDataToInclude, cbDataToInclude will be encrypted into the ticket
+	// ( This is asynchronous, you must wait for the ticket to be completed by the server )
+	virtual SteamAPICall_t RequestEncryptedAppTicket( void *pDataToInclude, int cbDataToInclude ) = 0;
+
+	// retrieve a finished ticket
+	virtual bool GetEncryptedAppTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket ) = 0;
 };
 
 #endif // ISTEAMUSER016_H

File Open Steamworks/ISteamUserStats010.h

 	virtual bool SetAchievement( const char *pchName ) = 0;
 	virtual bool ClearAchievement( const char *pchName ) = 0;
 
-	// most likely a bool return here
-	virtual bool GetAchievementAndUnlockTime( const char *pchName, bool *pbAchieved, RTime32 *prtTime ) = 0;
+	// Get the achievement status, and the time it was unlocked if unlocked.
+	// If the return value is true, but the unlock time is zero, that means it was unlocked before Steam 
+	// began tracking achievement unlock times (December 2009). Time is seconds since January 1, 1970.
+	virtual bool GetAchievementAndUnlockTime( const char *pchName, bool *pbAchieved, uint32 *punUnlockTime ) = 0;
 
 	// Store the current data on the server, will get a callback when set
 	// And one callback for every new achievement
+	//
+	// If the callback has a result of k_EResultInvalidParam, one or more stats 
+	// uploaded has been rejected, either because they broke constraints
+	// or were out of date. In this case the server sends back updated values.
+	// The stats should be re-iterated to keep in sync.
 	virtual bool StoreStats() = 0;
 
-	// Gets the icon of the achievement, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set
+	// Achievement / GroupAchievement metadata
+
+	// Gets the icon of the achievement, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set. 
+	// A return value of 0 may indicate we are still fetching data, and you can wait for the UserAchievementIconFetched_t callback
+	// which will notify you when the bits are ready. If the callback still returns zero, then there is no image set for the
+	// specified achievement.
 	virtual int GetAchievementIcon( const char *pchName ) = 0;
-	// Get general attributes (display name / text, etc) for an Achievement
+	// Get general attributes (display name, desc, etc) for an Achievement
 	virtual const char *GetAchievementDisplayAttribute( const char *pchName, const char *pchKey ) = 0;
 
 	// Achievement progress - triggers an AchievementProgress callback, that is all.
 	// these stats won't be auto-updated; you'll need to call RequestUserStats() again to refresh any data
 	virtual SteamAPICall_t RequestUserStats( CSteamID steamIDUser ) = 0;
 
-
 	// requests stat information for a user, usable after a successful call to RequestUserStats()
 	virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, int32 *pData ) = 0;
 	virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, float *pData ) = 0;
 	virtual bool GetUserAchievement( CSteamID steamIDUser, const char *pchName, bool *pbAchieved ) = 0;
-	virtual bool GetUserAchievementAndUnlockTime( CSteamID steamIDUser, const char *pchName, bool *pbAchieved, RTime32 *prtTime ) = 0;
+	// See notes for GetAchievementAndUnlockTime above
+	virtual bool GetUserAchievementAndUnlockTime( CSteamID steamIDUser, const char *pchName, bool *pbAchieved, uint32 *punUnlockTime ) = 0;
 
 	// Reset stats 
 	virtual bool ResetAllStats( bool bAchievementsToo ) = 0;
 
-
 	// Leaderboard functions
 
 	// asks the Steam back-end for a leaderboard by name, and will create it if it's not yet
 	// This call is asynchronous, with the result returned in LeaderboardFindResult_t
 	virtual SteamAPICall_t FindLeaderboard( const char *pchLeaderboardName ) = 0;
 
-
 	// returns the name of a leaderboard
 	virtual const char *GetLeaderboardName( SteamLeaderboard_t hSteamLeaderboard ) = 0;
 
 	//   e.g. DownloadLeaderboardEntries( hLeaderboard, k_ELeaderboardDataRequestGlobalAroundUser, -3, 3 ) will return 7 rows, 3 before the user, 3 after
 	// k_ELeaderboardDataRequestFriends requests all the rows for friends of the current user 
 	virtual SteamAPICall_t DownloadLeaderboardEntries( SteamLeaderboard_t hSteamLeaderboard, ELeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd ) = 0;
-
-	virtual SteamAPICall_t DownloadLeaderboardEntriesForUsers( SteamLeaderboard_t hSteamLeaderboard, CSteamID *, int ) = 0;
+	// 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;
 
 	// Returns data about a single leaderboard entry
 	// use a for loop from 0 to LeaderboardScoresDownloaded_t::m_cEntryCount to get all the downloaded entries
 
 	// Uploads a user score to the Steam back-end.
 	// This call is asynchronous, with the result returned in LeaderboardScoreUploaded_t
-	// If the score passed in is no better than the existing score this user has in the leaderboard, then the leaderboard will not be updated.
 	// Details are extra game-defined information regarding how the user got that score
 	// pScoreDetails points to an array of int32's, cScoreDetailsCount is the number of int32's in the list
-	virtual SteamAPICall_t UploadLeaderboardScore( SteamLeaderboard_t hSteamLeaderboard, ELeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int32 nScore, int32 *pScoreDetails, int cScoreDetailsCount ) = 0;
+	virtual SteamAPICall_t UploadLeaderboardScore( SteamLeaderboard_t hSteamLeaderboard, ELeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int32 nScore, const int32 *pScoreDetails, int cScoreDetailsCount ) = 0;
 
-	virtual SteamAPICall_t AttachLeaderboardUGC( SteamLeaderboard_t hSteamLeaderboard, uint64 Unk1 ) = 0;
+	// Attaches a piece of user generated content the user's entry on a leaderboard.
+	// hContent is a handle to a piece of user generated content that was shared using ISteamUserRemoteStorage::FileShare().
+	// This call is asynchronous, with the result returned in LeaderboardUGCSet_t.
+	virtual SteamAPICall_t AttachLeaderboardUGC( SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC ) = 0;
 
 	// Retrieves the number of players currently playing your game (online + offline)
 	// This call is asynchronous, with the result returned in NumberOfCurrentPlayers_t
 	virtual SteamAPICall_t GetNumberOfCurrentPlayers() = 0;
 
-	virtual uint32 GetNumAchievedAchievements( CGameID nGameID ) = 0;
-	virtual uint32 GetLastAchievementUnlocked( CGameID nGameID ) = 0;
-	virtual SteamAPICall_t RequestGlobalAchievementPercentages( CGameID nGameID ) = 0;
-	virtual uint32 GetMostAchievedAchievementInfo( CGameID nGameID, char *a, uint32 b, float *c, bool *d ) = 0;
-	virtual uint32 GetNextMostAchievedAchievementInfo( CGameID nGameID, int a, char *b, uint32 c, float *d, bool *f ) = 0;
-	virtual bool GetAchievementAchievedPercent( CGameID nGameID, char  const*, float * ) = 0;
+	// Requests that Steam fetch data on the percentage of players who have received each achievement
+	// for the game globally.
+	// This call is asynchronous, with the result returned in GlobalAchievementPercentagesReady_t.
+	virtual SteamAPICall_t RequestGlobalAchievementPercentages() = 0;
 
-	virtual SteamAPICall_t RequestGlobalStats( CGameID nGameID, int ) = 0;
-	virtual bool GetGlobalStat( CGameID nGameID, char const* pchName, long long * ) = 0;
-	virtual bool GetGlobalStat( CGameID nGameID, char const* pchName, double * ) = 0;
-	virtual uint32 GetGlobalStatHistory( CGameID nGameID, char const* pchName, long long *, unsigned int ) = 0;
-	virtual uint32 GetGlobalStatHistory( CGameID nGameID, char const* pchName, double *, unsigned int ) = 0;
+	// Get the info on the most achieved achievement for the game, returns an iterator index you can use to fetch
+	// the next most achieved afterwards.  Will return -1 if there is no data on achievement 
+	// percentages (ie, you haven't called RequestGlobalAchievementPercentages and waited on the callback).
+	virtual int GetMostAchievedAchievementInfo( char *pchName, uint32 unNameBufLen, float *pflPercent, bool *pbAchieved ) = 0;
+
+	// Get the info on the next most achieved achievement for the game. Call this after GetMostAchievedAchievementInfo or another
+	// GetNextMostAchievedAchievementInfo call passing the iterator from the previous call. Returns -1 after the last
+	// achievement has been iterated.
+	virtual int GetNextMostAchievedAchievementInfo( int iIteratorPrevious, char *pchName, uint32 unNameBufLen, float *pflPercent, bool *pbAchieved ) = 0;
+
+	// Returns the percentage of users who have achieved the specified achievement.
+	virtual bool GetAchievementAchievedPercent( const char *pchName, float *pflPercent ) = 0;
+
+	// Requests global stats data, which is available for stats marked as "aggregated".
+	// This call is asynchronous, with the results returned in GlobalStatsReceived_t.
+	// nHistoryDays specifies how many days of day-by-day history to retrieve in addition
+	// to the overall totals. The limit is 60.
+	virtual SteamAPICall_t RequestGlobalStats( int nHistoryDays ) = 0;
+
+	// Gets the lifetime totals for an aggregated stat
+	virtual bool GetGlobalStat( const char *pchStatName, int64 *pData ) = 0;
+	virtual bool GetGlobalStat( const char *pchStatName, double *pData ) = 0;
+
+	// Gets history for an aggregated stat. pData will be filled with daily values, starting with today.
+	// 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;
 };
 
 #endif // ISTEAMUSERSTATS010_H

File Open Steamworks/ISteamUtils005.h

 	// refresh the screen with Present or SwapBuffers to allow the overlay to do it's work.
 	virtual bool BOverlayNeedsPresent() = 0;
 
-	// Asynchronous call to check if file is signed, result is returned in CheckFileSignature_t
+	// 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.  
+	// The result is returned in CheckFileSignature_t.
+	//   k_ECheckFileSignatureNoSignaturesFoundForThisApp - This app has not been configured on the signing tab of the partner site to enable this function.
+	//   k_ECheckFileSignatureNoSignaturesFoundForThisFile - This file is not listed on the signing tab for the partner site.
+	//   k_ECheckFileSignatureFileNotFound - The file does not exist on disk.
+	//   k_ECheckFileSignatureInvalidSignature - The file exists, and the signing tab has been set for this file, but the file is either not signed or the signature does not match.
+	//   k_ECheckFileSignatureValidSignature - The file is signed and the signature is valid.
 	virtual SteamAPICall_t CheckFileSignature( const char *szFileName ) = 0;
 };
 

File Open Steamworks/MatchMakingKeyValuePair.h

 	MatchMakingKeyValuePair_t( const char *pchKey, const char *pchValue )
 	{
 		strncpy( m_szKey, pchKey, sizeof(m_szKey) ); // this is a public header, use basic c library string funcs only!
+		m_szKey[ sizeof( m_szKey ) - 1 ] = '\0';
 		strncpy( m_szValue, pchValue, sizeof(m_szValue) );
+		m_szValue[ sizeof( m_szValue ) - 1 ] = '\0';
 	}
 #endif
 

File Open Steamworks/MatchmakingCommon.h

 
 
 
+// lobby search filter tools
 typedef enum ELobbyComparison
 {
 	k_ELobbyComparisonEqualToOrLessThan = -2,
 	k_ELobbyComparisonNotEqual = 3,
 } ELobbyComparison;
 
+
+// lobby search distance
 typedef enum ELobbyDistanceFilter
 {
-	k_ELobbyDistanceFilterClose = 0,
-	k_ELobbyDistanceFilterDefault = 1,
-	k_ELobbyDistanceFilterFar = 2,
-	k_ELobbyDistanceFilterWorldwide = 3,
+	k_ELobbyDistanceFilterClose,		// only lobbies in the same immediate region will be returned
+	k_ELobbyDistanceFilterDefault,		// only lobbies in the same region or close, but looking further if the current region has infrequent lobby activity (the default)
+	k_ELobbyDistanceFilterFar,			// for games that don't have many latency requirements, will return lobbies about half-way around the globe
+	k_ELobbyDistanceFilterWorldwide,	// no filtering, will match lobbies as far as India to NY (not recommended, expect multiple seconds of latency between the clients)
 } ELobbyDistanceFilter;
 
 

File Open Steamworks/NetworkingCommon.h

 	k_EP2PSessionErrorTimeout = 4,					// target isn't responding, perhaps not calling AcceptP2PSessionWithUser()
 	// corporate firewalls can also block this (NAT traversal is not firewall traversal)
 	// make sure that UDP ports 3478, 4379, and 4380 are open in an outbound direction
-
+	k_EP2PSessionErrorMax = 5
 } EP2PSessionError;
 
 // describes how the socket is currently connected
 
 
 
+#pragma pack( push, 8 )
+
 // connection state to a specified user, returned by GetP2PSessionState()
 // this is under-the-hood info about what's going on with a SendP2PPacket(), shouldn't be needed except for debuggin
 struct P2PSessionState_t
 };
 
 
-#pragma pack( push, 8 )
 // callback notification - status of a socket has changed
 struct SocketStatusCallback_t
 { 

File Open Steamworks/RemoteStorageCommon.h

 	k_EScreenshotPrivacyStatePublic = 8,
 } EScreenshotPrivacyState;
 
+typedef enum ERemoteStoragePlatform
+{
+	k_ERemoteStoragePlatformNone		= 0,
+	k_ERemoteStoragePlatformWindows		= (1 << 0),
+	k_ERemoteStoragePlatformOSX			= (1 << 1 ),
+	k_ERemoteStoragePlatformPS3			= (1 << 2),
+	k_ERemoteStoragePlatformReserved1	= (1 << 3),
+	k_ERemoteStoragePlatformReserved2	= (1 << 4),
+
+	k_ERemoteStoragePlatformAll = 0xffffffff
+} ERemoteStoragePlatform;
+
+// Ways to handle a synchronization conflict
+typedef enum EResolveConflict
+{
+	k_EResolveConflictKeepClient = 1,		// The local version of each file will be used to overwrite the server version
+	k_EResolveConflictKeepServer = 2,		// The server version of each file will be used to overwrite the local version
+} EResolveConflict;
+
 
 #pragma pack( push, 8 )
-struct FileShareResult_t
-{ 
-	enum { k_iCallback = k_iClientRemoteStorageCallbacks + 7 };
 
-	int32 unk1;
-	int32 unk2;
-	int32 unk3;
-	int32 unk4;
+//-----------------------------------------------------------------------------
+// Purpose: sent when the local file cache is fully synced with the server for an app
+//          That means that an application can be started and has all latest files
+//-----------------------------------------------------------------------------
+struct RemoteStorageAppSyncedClient_t
+{
+	enum { k_iCallback = k_iClientRemoteStorageCallbacks + 1 };
+	AppId_t m_nAppID;
+	EResult m_eResult;
+	int m_unNumDownloads;
 };
 
-struct ScreenshotBatchResult_t
-{ 
-	enum { k_iCallback = k_iClientRemoteStorageCallbacks + 12 };
+//-----------------------------------------------------------------------------
+// Purpose: sent when the server is fully synced with the local file cache for an app
+//          That means that we can shutdown Steam and our data is stored on the server
+//-----------------------------------------------------------------------------
+struct RemoteStorageAppSyncedServer_t
+{
+	enum { k_iCallback = k_iClientRemoteStorageCallbacks + 2 };
+	AppId_t m_nAppID;
+	EResult m_eResult;
+	int m_unNumUploads;
+};
 
+//-----------------------------------------------------------------------------
+// Purpose: Status of up and downloads during a sync session
+//       
+//-----------------------------------------------------------------------------
+struct RemoteStorageAppSyncProgress_t
+{
+	enum { k_iCallback = k_iClientRemoteStorageCallbacks + 3 };
+	char m_rgchCurrentFile[260];				// Current file being transferred
+	AppId_t m_nAppID;							// App this info relates to
+	uint32 m_uBytesTransferredThisChunk;		// Bytes transferred this chunk
+	double m_dAppPercentComplete;				// Percent complete that this app's transfers are
+	bool m_bUploading;							// if false, downloading
+};
+
+
+//-----------------------------------------------------------------------------
+// Purpose: Sent after a conflict resolution attempt.
+//-----------------------------------------------------------------------------
+struct RemoteStorageConflictResolution_t
+{
+	enum { k_iCallback = k_iClientRemoteStorageCallbacks + 6 };
+	AppId_t m_nAppID;
 	EResult m_eResult;
 };
 
+//-----------------------------------------------------------------------------
+// Purpose: The result of a call to FileShare()
+//-----------------------------------------------------------------------------
+struct RemoteStorageFileShareResult_t
+{
+	enum { k_iCallback = k_iClientRemoteStorageCallbacks + 7 };
+	EResult m_eResult;			// The result of the operation
+	UGCHandle_t m_hFile;		// The handle that can be shared with users and features
+};
+
+//-----------------------------------------------------------------------------
+// Purpose: The result of a call to UGCDownload()
+//-----------------------------------------------------------------------------
+struct RemoteStorageDownloadUGCResult_t
+{
+	enum { k_iCallback = k_iClientRemoteStorageCallbacks + 8 };
+	EResult m_eResult;				// The result of the operation.
+	UGCHandle_t m_hFile;			// The handle to the file that was attempted to be downloaded.
+	AppId_t m_nAppID;				// ID of the app that created this file.
+	int32 m_nSizeInBytes;			// The size of the file that was downloaded, in bytes.
+	char *m_pchFileName;			// The name of the file that was downloaded. This pointer is
+	// not guaranteed to be valid indefinitely.
+	uint64 m_ulSteamIDOwner;		// Steam ID of the user who created this content.
+};
+
 #pragma pack( pop )
 
 

File Open Steamworks/SteamTypes.h

 typedef void (*SteamFreeLastCallbackFn)( int hpipe );
 typedef bool (*SteamGetAPICallResultFn)( int hpipe, uint64 hSteamAPICall, void* pCallback, int cubCallback, int iCallbackExpected, bool* pbFailed );
 
+//-----------------------------------------------------------------------------
+// Purpose: Passed as argument to SteamAPI_UseBreakpadCrashHandler to enable optional callback
+//  just before minidump file is captured after a crash has occurred.  (Allows app to append additional comment data to the dump, etc.)
+//-----------------------------------------------------------------------------
+typedef void (*PFNPreMinidumpCallback)(void *context);
+
+//-----------------------------------------------------------------------------
+// Purpose: Used by ICrashHandler interfaces to reference particular installed crash handlers
+//-----------------------------------------------------------------------------
+typedef void *BREAKPAD_HANDLE;
+#define BREAKPAD_INVALID_HANDLE (BREAKPAD_HANDLE)0 
+
 const int k_cubDigestSize = 20;							// CryptoPP::SHA::DIGESTSIZE
 const int k_cubSaltSize   = 8;
 
 typedef void (*PFNLegacyKeyRegistration)( const char *pchCDKey, const char *pchInstallPath );
 typedef bool (*PFNLegacyKeyInstalled)();
 
-const int k_unSteamAccountIDMask = 0xFFFFFFFF;
-const int k_unSteamAccountInstanceMask = 0x000FFFFF;
+const unsigned int k_unSteamAccountIDMask = 0xFFFFFFFF;
+const unsigned int k_unSteamAccountInstanceMask = 0x000FFFFF;
+// we allow 2 simultaneous user account instances right now, 1= desktop, 2 = console, 0 = all
+const unsigned int k_unSteamUserDesktopInstance = 1;	 
+const unsigned int k_unSteamUserConsoleInstance = 2;
 
 // Special flags for Chat accounts - they go in the top 8 bits
 // of the steam ID's "instance", leaving 12 for the actual instances
 	// Max of 8 flags
 };
 
+// A handle to a piece of user generated content
+typedef uint64 UGCHandle_t;
+const UGCHandle_t k_UGCHandleInvalid = 0xffffffffffffffffull;
+
 #define STEAM_USING_FILESYSTEM							(0x00000001)
 #define STEAM_USING_LOGGING								(0x00000002)
 #define STEAM_USING_USERID								(0x00000004)

File Open Steamworks/Steamclient.h

 
 
 //----------------------------------------------------------------------------------------------------------------------------------------------------------//
-//  Steam API setup & shutdown
+//	Steam API setup & shutdown
 //
-//  These functions manage loading, initializing and shutdown of the steamclient.dll
+//	These functions manage loading, initializing and shutdown of the steamclient.dll
 //
 //----------------------------------------------------------------------------------------------------------------------------------------------------------//
 
-// S_API void STEAM_CALL SteamAPI_Init(); (see below)
-S_API void STEAM_CALL SteamAPI_Shutdown();
+// S_API void SteamAPI_Init(); (see below)
+S_API void SteamAPI_Shutdown();
 
 // checks if a local Steam client is running 
-S_API bool STEAM_CALL SteamAPI_IsSteamRunning();
+S_API bool SteamAPI_IsSteamRunning();
 
 // Detects if your executable was launched through the Steam client, and restarts your game through 
 // the client if necessary. The Steam client will be started if it is not running.
 //
 // NOTE: This function should be used only if you are using CEG or not using Steam's DRM. Once applied
 //       to your executable, Steam's DRM will handle restarting through Steam if necessary.
-S_API bool STEAM_CALL SteamAPI_RestartAppIfNecessary( uint32 unOwnAppID );
-
+S_API bool SteamAPI_RestartAppIfNecessary( uint32 unOwnAppID );
 
 // crash dump recording functions
-S_API void STEAM_CALL SteamAPI_WriteMiniDump( uint32 uStructuredExceptionCode, void* pvExceptionInfo, uint32 uBuildID );
-S_API void STEAM_CALL SteamAPI_SetMiniDumpComment( const char *pchMsg );
+S_API void SteamAPI_WriteMiniDump( uint32 uStructuredExceptionCode, void* pvExceptionInfo, uint32 uBuildID );
+S_API void SteamAPI_SetMiniDumpComment( const char *pchMsg );
 
 // this should be called before the game initialized the steam APIs
 // pchDate should be of the format "Mmm dd yyyy" (such as from the __DATE__ macro )
 // pchTime should be of the format "hh:mm:ss" (such as from the __TIME__ macro )
-S_API void STEAM_CALL SteamAPI_UseBreakpadCrashHandler( char const *pchVersion, char const *pchDate, char const *pchTime );
+// bFullMemoryDumps (Win32 only) -- writes out a uuid-full.dmp in the client/dumps folder
+// pvContext-- can be NULL, will be the void * context passed into m_pfnPreMinidumpCallback
+// PFNPreMinidumpCallback m_pfnPreMinidumpCallback   -- optional callback which occurs just before a .dmp file is written during a crash.  Applications can hook this to allow adding additional information into the .dmp comment stream.
+S_API void SteamAPI_UseBreakpadCrashHandler( char const *pchVersion, char const *pchDate, char const *pchTime, bool bFullMemoryDumps, void *pvContext, PFNPreMinidumpCallback m_pfnPreMinidumpCallback );
+S_API void SteamAPI_SetBreakpadAppID( uint32 unAppID );
 
 // interface pointers, configured by SteamAPI_Init()
 S_API_UNSAFE ISteamClient009* STEAM_CALL SteamClient();
 // sets whether or not Steam_RunCallbacks() should do a try {} catch (...) {} around calls to issuing callbacks
 S_API void STEAM_CALL SteamAPI_SetTryCatchCallbacks( bool bTryCatchCallbacks );
 
-S_API void STEAM_CALL SteamAPI_RunCallbacks();
+S_API void SteamAPI_RunCallbacks();
+
+
 
 // functions used by the utility CCallback objects to receive callbacks
-S_API void STEAM_CALL SteamAPI_RegisterCallback( class CCallbackBase *pCallback, int iCallback );
-S_API void STEAM_CALL SteamAPI_UnregisterCallback( class CCallbackBase *pCallback );
+S_API void SteamAPI_RegisterCallback( class CCallbackBase *pCallback, int iCallback );
+S_API void SteamAPI_UnregisterCallback( class CCallbackBase *pCallback );
 // functions used by the utility CCallResult objects to receive async call results
-S_API void STEAM_CALL SteamAPI_RegisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall );
-S_API void STEAM_CALL SteamAPI_UnregisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall );
+S_API void SteamAPI_RegisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall );
+S_API void SteamAPI_UnregisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall );
 //----------------------------------------------------------------------------------------------------------------------------------------------------------//
 //	steamclient.dll private wrapper functions
 //
 S_API void STEAM_CALL SteamContentServer_Shutdown();
 S_API void STEAM_CALL SteamContentServer_RunCallbacks();
 
+
+// Purpose: utilities to decode/decrypt a ticket from the
+// ISteamUser::RequestEncryptedAppTicket, ISteamUser::GetEncryptedAppTicket API
+// 
+// To use: declare CSteamEncryptedAppTicket, then call BDecryptTicket
+// if BDecryptTicket returns true, other accessors are valid
+static const int k_nSteamEncryptedAppTicketSymmetricKeyLen = 32;				
+
+
+S_API bool SteamEncryptedAppTicket_BDecryptTicket( const uint8 *rgubTicketEncrypted, uint32 cubTicketEncrypted,
+												  uint8 *rgubTicketDecrypted, uint32 *pcubTicketDecrypted,
+												  const uint8 rgubKey[k_nSteamEncryptedAppTicketSymmetricKeyLen], int cubKey );
+
+S_API bool SteamEncryptedAppTicket_BIsTicketForApp( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted, AppId_t nAppID );
+
+S_API RTime32 SteamEncryptedAppTicket_GetTicketIssueTime( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted );
+
+S_API void SteamEncryptedAppTicket_GetTicketSteamID( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted, CSteamID *psteamID );
+
+S_API AppId_t SteamEncryptedAppTicket_GetTicketAppID( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted );
+
+S_API bool SteamEncryptedAppTicket_BUserOwnsAppInTicket( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted, AppId_t nAppID );
+
+S_API bool SteamEncryptedAppTicket_BUserIsVacBanned( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted );
+
+S_API const uint8 *SteamEncryptedAppTicket_GetUserVariableData( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted, uint32 *pcubUserData );
+
 #endif // STEAMCLIENT_H

File Open Steamworks/UserCommon.h

 	k_EVoiceResultNoData = 3,
 	k_EVoiceResultBufferTooSmall = 4,
 	k_EVoiceResultDataCorrupted = 5,
+	k_EVoiceResultRestricted = 6,
+	k_EVoiceResultUnsupportedCodec = 7,
 } EVoiceResult;
 
 //-----------------------------------------------------------------------------
 };
 
 
+//-----------------------------------------------------------------------------
+// Purpose: Result from RequestEncryptedAppTicket
+//-----------------------------------------------------------------------------
 struct EncryptedAppTicketResponse_t
 {
 	enum { k_iCallback = k_iSteamUserCallbacks + 54 };
+
 	EResult m_eResult;
 };
 

File Open Steamworks/UserStatsCommon.h

 	// TODO : Reverse this enum, default value seems to be 0
 } EGetAchievementIcon;
 
+#pragma pack( push, 8 )
+
 // a single entry in a leaderboard, as returned by GetDownloadedLeaderboardEntry()
 struct LeaderboardEntry001_t
 {
 
 struct LeaderboardEntry002_t
 {
-	/*
-	TODO : Reverse this struct
-	*/
-	int placeholder;
+	CSteamID m_steamIDUser; // user with the entry - use SteamFriends()->GetFriendPersonaName() & SteamFriends()->GetFriendAvatar() to get more info
+	int32 m_nGlobalRank;	// [1..N], where N is the number of users with an entry in the leaderboard
+	int32 m_nScore;			// score as set in the leaderboard
+	int32 m_cDetails;		// number of int32 details available for this entry
+	UGCHandle_t m_hUGC;		// handle for UGC attached to the entry
 };
 
 typedef LeaderboardEntry002_t LeaderboardEntry_t;
 
-#pragma pack( push, 8 )
 //-----------------------------------------------------------------------------
 // Purpose: called when the latests stats and achievements have been received
 //			from the server
 struct UserStatsUnloaded_t
 {
 	enum { k_iCallback = k_iSteamUserStatsCallbacks + 8 };
-
 	CSteamID	m_steamIDUser;	// User whose stats have been unloaded
 };
 
 	int			m_nIconHandle;		// Handle to the image, which can be used in ClientUtils()->GetImageRGBA(), 0 means no image is set for the achievement
 };
 
+//-----------------------------------------------------------------------------
+// Purpose: Callback indicating that global achievement percentages are fetched
+//-----------------------------------------------------------------------------
+struct GlobalAchievementPercentagesReady_t
+{
+	enum { k_iCallback = k_iSteamUserStatsCallbacks + 10 };
+
+	uint64		m_nGameID;				// Game this is for
+	EResult		m_eResult;				// Result of the operation
+};
+
+//-----------------------------------------------------------------------------
+// Purpose: call result indicating UGC has been uploaded, returned as a result of SetLeaderboardUGC()
+//-----------------------------------------------------------------------------
+struct LeaderboardUGCSet_t
+{
+	enum { k_iCallback = k_iSteamUserStatsCallbacks + 11 };
+	EResult m_eResult;				// The result of the operation
+	SteamLeaderboard_t m_hSteamLeaderboard;	// the leaderboard handle that was
+};
+
+//-----------------------------------------------------------------------------
+// Purpose: callback indicating global stats have been received.
+//	Returned as a result of RequestGlobalStats()
+//-----------------------------------------------------------------------------
+struct GlobalStatsReceived_t
+{
+	enum { k_iCallback = k_iSteamUserStatsCallbacks + 12 };
+	uint64	m_nGameID;				// Game global stats were requested for
+	EResult	m_eResult;				// The result of the request
+};
+
 #pragma pack( pop )
 
 

File Open Steamworks/gameserveritem.h

 inline void gameserveritem_t::SetName( const char *pName )
 {
 	strncpy( m_szServerName, pName, sizeof( m_szServerName ) );
+	m_szServerName[ sizeof( m_szServerName ) - 1 ] = '\0';
 }
 #endif
 

File Open Steamworks/servernetadr.h

 	static char s[4][64];
 	static int nBuf = 0;
 	unsigned char *ipByte = (unsigned char *)&unIP;
-	snprintf(s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[3]), (int)(ipByte[2]), (int)(ipByte[1]), (int)(ipByte[0]), usPort );
+	_snprintf (s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[3]), (int)(ipByte[2]), (int)(ipByte[1]), (int)(ipByte[0]), usPort );
 	const char *pchRet = s[nBuf];
 	++nBuf;
 	nBuf %= ( (sizeof(s)/sizeof(s[0])) );