Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

465 lines
23 KiB

  1. //====== Copyright � 1996-2009, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose: interface to stats, achievements, and leaderboards
  4. //
  5. //=============================================================================
  6. #ifndef ISTEAMUSERSTATS_H
  7. #define ISTEAMUSERSTATS_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "isteamclient.h"
  12. #include "isteamremotestorage.h"
  13. // size limit on stat or achievement name (UTF-8 encoded)
  14. enum { k_cchStatNameMax = 128 };
  15. // maximum number of bytes for a leaderboard name (UTF-8 encoded)
  16. enum { k_cchLeaderboardNameMax = 128 };
  17. // maximum number of details int32's storable for a single leaderboard entry
  18. enum { k_cLeaderboardDetailsMax = 64 };
  19. // handle to a single leaderboard
  20. typedef uint64 SteamLeaderboard_t;
  21. // handle to a set of downloaded entries in a leaderboard
  22. typedef uint64 SteamLeaderboardEntries_t;
  23. // type of data request, when downloading leaderboard entries
  24. enum ELeaderboardDataRequest
  25. {
  26. k_ELeaderboardDataRequestGlobal = 0,
  27. k_ELeaderboardDataRequestGlobalAroundUser = 1,
  28. k_ELeaderboardDataRequestFriends = 2,
  29. k_ELeaderboardDataRequestUsers = 3
  30. };
  31. // the sort order of a leaderboard
  32. enum ELeaderboardSortMethod
  33. {
  34. k_ELeaderboardSortMethodNone = 0,
  35. k_ELeaderboardSortMethodAscending = 1, // top-score is lowest number
  36. k_ELeaderboardSortMethodDescending = 2, // top-score is highest number
  37. };
  38. // the display type (used by the Steam Community web site) for a leaderboard
  39. enum ELeaderboardDisplayType
  40. {
  41. k_ELeaderboardDisplayTypeNone = 0,
  42. k_ELeaderboardDisplayTypeNumeric = 1, // simple numerical score
  43. k_ELeaderboardDisplayTypeTimeSeconds = 2, // the score represents a time, in seconds
  44. k_ELeaderboardDisplayTypeTimeMilliSeconds = 3, // the score represents a time, in milliseconds
  45. };
  46. enum ELeaderboardUploadScoreMethod
  47. {
  48. k_ELeaderboardUploadScoreMethodNone = 0,
  49. k_ELeaderboardUploadScoreMethodKeepBest = 1, // Leaderboard will keep user's best score
  50. k_ELeaderboardUploadScoreMethodForceUpdate = 2, // Leaderboard will always replace score with specified
  51. };
  52. // a single entry in a leaderboard, as returned by GetDownloadedLeaderboardEntry()
  53. #if defined( VALVE_CALLBACK_PACK_SMALL )
  54. #pragma pack( push, 4 )
  55. #elif defined( VALVE_CALLBACK_PACK_LARGE )
  56. #pragma pack( push, 8 )
  57. #else
  58. #error isteamclient.h must be included
  59. #endif
  60. struct LeaderboardEntry_t
  61. {
  62. CSteamID m_steamIDUser; // user with the entry - use SteamFriends()->GetFriendPersonaName() & SteamFriends()->GetFriendAvatar() to get more info
  63. int32 m_nGlobalRank; // [1..N], where N is the number of users with an entry in the leaderboard
  64. int32 m_nScore; // score as set in the leaderboard
  65. int32 m_cDetails; // number of int32 details available for this entry
  66. UGCHandle_t m_hUGC; // handle for UGC attached to the entry
  67. };
  68. #pragma pack( pop )
  69. //-----------------------------------------------------------------------------
  70. // Purpose: Functions for accessing stats, achievements, and leaderboard information
  71. //-----------------------------------------------------------------------------
  72. class ISteamUserStats
  73. {
  74. public:
  75. // Ask the server to send down this user's data and achievements for this game
  76. virtual bool RequestCurrentStats() = 0;
  77. // Data accessors
  78. virtual bool GetStat( const char *pchName, int32 *pData ) = 0;
  79. virtual bool GetStat( const char *pchName, float *pData ) = 0;
  80. // Set / update data
  81. virtual bool SetStat( const char *pchName, int32 nData ) = 0;
  82. virtual bool SetStat( const char *pchName, float fData ) = 0;
  83. virtual bool UpdateAvgRateStat( const char *pchName, float flCountThisSession, double dSessionLength ) = 0;
  84. // Achievement flag accessors
  85. virtual bool GetAchievement( const char *pchName, bool *pbAchieved ) = 0;
  86. virtual bool SetAchievement( const char *pchName ) = 0;
  87. virtual bool ClearAchievement( const char *pchName ) = 0;
  88. // Get the achievement status, and the time it was unlocked if unlocked.
  89. // If the return value is true, but the unlock time is zero, that means it was unlocked before Steam
  90. // began tracking achievement unlock times (December 2009). Time is seconds since January 1, 1970.
  91. virtual bool GetAchievementAndUnlockTime( const char *pchName, bool *pbAchieved, uint32 *punUnlockTime ) = 0;
  92. // Store the current data on the server, will get a callback when set
  93. // And one callback for every new achievement
  94. //
  95. // If the callback has a result of k_EResultInvalidParam, one or more stats
  96. // uploaded has been rejected, either because they broke constraints
  97. // or were out of date. In this case the server sends back updated values.
  98. // The stats should be re-iterated to keep in sync.
  99. virtual bool StoreStats() = 0;
  100. // Achievement / GroupAchievement metadata
  101. // Gets the icon of the achievement, which is a handle to be used in ISteamUtils::GetImageRGBA(), or 0 if none set.
  102. // A return value of 0 may indicate we are still fetching data, and you can wait for the UserAchievementIconFetched_t callback
  103. // which will notify you when the bits are ready. If the callback still returns zero, then there is no image set for the
  104. // specified achievement.
  105. virtual int GetAchievementIcon( const char *pchName ) = 0;
  106. // Get general attributes for an achievement. Accepts the following keys:
  107. // - "name" and "desc" for retrieving the localized achievement name and description (returned in UTF8)
  108. // - "hidden" for retrieving if an achievement is hidden (returns "0" when not hidden, "1" when hidden)
  109. virtual const char *GetAchievementDisplayAttribute( const char *pchName, const char *pchKey ) = 0;
  110. // Achievement progress - triggers an AchievementProgress callback, that is all.
  111. // Calling this w/ N out of N progress will NOT set the achievement, the game must still do that.
  112. virtual bool IndicateAchievementProgress( const char *pchName, uint32 nCurProgress, uint32 nMaxProgress ) = 0;
  113. // Used for iterating achievements. In general games should not need these functions because they should have a
  114. // list of existing achievements compiled into them
  115. virtual uint32 GetNumAchievements() = 0;
  116. // Get achievement name iAchievement in [0,GetNumAchievements)
  117. virtual const char *GetAchievementName( uint32 iAchievement ) = 0;
  118. // Friends stats & achievements
  119. // downloads stats for the user
  120. // returns a UserStatsReceived_t received when completed
  121. // if the other user has no stats, UserStatsReceived_t.m_eResult will be set to k_EResultFail
  122. // these stats won't be auto-updated; you'll need to call RequestUserStats() again to refresh any data
  123. virtual SteamAPICall_t RequestUserStats( CSteamID steamIDUser ) = 0;
  124. // requests stat information for a user, usable after a successful call to RequestUserStats()
  125. virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, int32 *pData ) = 0;
  126. virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, float *pData ) = 0;
  127. virtual bool GetUserAchievement( CSteamID steamIDUser, const char *pchName, bool *pbAchieved ) = 0;
  128. // See notes for GetAchievementAndUnlockTime above
  129. virtual bool GetUserAchievementAndUnlockTime( CSteamID steamIDUser, const char *pchName, bool *pbAchieved, uint32 *punUnlockTime ) = 0;
  130. // Reset stats
  131. virtual bool ResetAllStats( bool bAchievementsToo ) = 0;
  132. // Leaderboard functions
  133. // asks the Steam back-end for a leaderboard by name, and will create it if it's not yet
  134. // This call is asynchronous, with the result returned in LeaderboardFindResult_t
  135. virtual SteamAPICall_t FindOrCreateLeaderboard( const char *pchLeaderboardName, ELeaderboardSortMethod eLeaderboardSortMethod, ELeaderboardDisplayType eLeaderboardDisplayType ) = 0;
  136. // as above, but won't create the leaderboard if it's not found
  137. // This call is asynchronous, with the result returned in LeaderboardFindResult_t
  138. virtual SteamAPICall_t FindLeaderboard( const char *pchLeaderboardName ) = 0;
  139. // returns the name of a leaderboard
  140. virtual const char *GetLeaderboardName( SteamLeaderboard_t hSteamLeaderboard ) = 0;
  141. // returns the total number of entries in a leaderboard, as of the last request
  142. virtual int GetLeaderboardEntryCount( SteamLeaderboard_t hSteamLeaderboard ) = 0;
  143. // returns the sort method of the leaderboard
  144. virtual ELeaderboardSortMethod GetLeaderboardSortMethod( SteamLeaderboard_t hSteamLeaderboard ) = 0;
  145. // returns the display type of the leaderboard
  146. virtual ELeaderboardDisplayType GetLeaderboardDisplayType( SteamLeaderboard_t hSteamLeaderboard ) = 0;
  147. // Asks the Steam back-end for a set of rows in the leaderboard.
  148. // This call is asynchronous, with the result returned in LeaderboardScoresDownloaded_t
  149. // LeaderboardScoresDownloaded_t will contain a handle to pull the results from GetDownloadedLeaderboardEntries() (below)
  150. // You can ask for more entries than exist, and it will return as many as do exist.
  151. // k_ELeaderboardDataRequestGlobal requests rows in the leaderboard from the full table, with nRangeStart & nRangeEnd in the range [1, TotalEntries]
  152. // k_ELeaderboardDataRequestGlobalAroundUser requests rows around the current user, nRangeStart being negate
  153. // e.g. DownloadLeaderboardEntries( hLeaderboard, k_ELeaderboardDataRequestGlobalAroundUser, -3, 3 ) will return 7 rows, 3 before the user, 3 after
  154. // k_ELeaderboardDataRequestFriends requests all the rows for friends of the current user
  155. virtual SteamAPICall_t DownloadLeaderboardEntries( SteamLeaderboard_t hSteamLeaderboard, ELeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd ) = 0;
  156. // as above, but downloads leaderboard entries for an arbitrary set of users - ELeaderboardDataRequest is k_ELeaderboardDataRequestUsers
  157. // if a user doesn't have a leaderboard entry, they won't be included in the result
  158. // a max of 100 users can be downloaded at a time, with only one outstanding call at a time
  159. METHOD_DESC(Downloads leaderboard entries for an arbitrary set of users - ELeaderboardDataRequest is k_ELeaderboardDataRequestUsers)
  160. virtual SteamAPICall_t DownloadLeaderboardEntriesForUsers( SteamLeaderboard_t hSteamLeaderboard,
  161. ARRAY_COUNT_D(cUsers, Array of users to retrieve) CSteamID *prgUsers, int cUsers ) = 0;
  162. // Returns data about a single leaderboard entry
  163. // use a for loop from 0 to LeaderboardScoresDownloaded_t::m_cEntryCount to get all the downloaded entries
  164. // e.g.
  165. // void OnLeaderboardScoresDownloaded( LeaderboardScoresDownloaded_t *pLeaderboardScoresDownloaded )
  166. // {
  167. // for ( int index = 0; index < pLeaderboardScoresDownloaded->m_cEntryCount; index++ )
  168. // {
  169. // LeaderboardEntry_t leaderboardEntry;
  170. // int32 details[3]; // we know this is how many we've stored previously
  171. // GetDownloadedLeaderboardEntry( pLeaderboardScoresDownloaded->m_hSteamLeaderboardEntries, index, &leaderboardEntry, details, 3 );
  172. // assert( leaderboardEntry.m_cDetails == 3 );
  173. // ...
  174. // }
  175. // once you've accessed all the entries, the data will be free'd, and the SteamLeaderboardEntries_t handle will become invalid
  176. virtual bool GetDownloadedLeaderboardEntry( SteamLeaderboardEntries_t hSteamLeaderboardEntries, int index, LeaderboardEntry_t *pLeaderboardEntry, int32 *pDetails, int cDetailsMax ) = 0;
  177. // Uploads a user score to the Steam back-end.
  178. // This call is asynchronous, with the result returned in LeaderboardScoreUploaded_t
  179. // Details are extra game-defined information regarding how the user got that score
  180. // pScoreDetails points to an array of int32's, cScoreDetailsCount is the number of int32's in the list
  181. virtual SteamAPICall_t UploadLeaderboardScore( SteamLeaderboard_t hSteamLeaderboard, ELeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int32 nScore, const int32 *pScoreDetails, int cScoreDetailsCount ) = 0;
  182. // Attaches a piece of user generated content the user's entry on a leaderboard.
  183. // hContent is a handle to a piece of user generated content that was shared using ISteamUserRemoteStorage::FileShare().
  184. // This call is asynchronous, with the result returned in LeaderboardUGCSet_t.
  185. virtual SteamAPICall_t AttachLeaderboardUGC( SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC ) = 0;
  186. // Retrieves the number of players currently playing your game (online + offline)
  187. // This call is asynchronous, with the result returned in NumberOfCurrentPlayers_t
  188. virtual SteamAPICall_t GetNumberOfCurrentPlayers() = 0;
  189. // Requests that Steam fetch data on the percentage of players who have received each achievement
  190. // for the game globally.
  191. // This call is asynchronous, with the result returned in GlobalAchievementPercentagesReady_t.
  192. virtual SteamAPICall_t RequestGlobalAchievementPercentages() = 0;
  193. // Get the info on the most achieved achievement for the game, returns an iterator index you can use to fetch
  194. // the next most achieved afterwards. Will return -1 if there is no data on achievement
  195. // percentages (ie, you haven't called RequestGlobalAchievementPercentages and waited on the callback).
  196. virtual int GetMostAchievedAchievementInfo( char *pchName, uint32 unNameBufLen, float *pflPercent, bool *pbAchieved ) = 0;
  197. // Get the info on the next most achieved achievement for the game. Call this after GetMostAchievedAchievementInfo or another
  198. // GetNextMostAchievedAchievementInfo call passing the iterator from the previous call. Returns -1 after the last
  199. // achievement has been iterated.
  200. virtual int GetNextMostAchievedAchievementInfo( int iIteratorPrevious, char *pchName, uint32 unNameBufLen, float *pflPercent, bool *pbAchieved ) = 0;
  201. // Returns the percentage of users who have achieved the specified achievement.
  202. virtual bool GetAchievementAchievedPercent( const char *pchName, float *pflPercent ) = 0;
  203. // Requests global stats data, which is available for stats marked as "aggregated".
  204. // This call is asynchronous, with the results returned in GlobalStatsReceived_t.
  205. // nHistoryDays specifies how many days of day-by-day history to retrieve in addition
  206. // to the overall totals. The limit is 60.
  207. virtual SteamAPICall_t RequestGlobalStats( int nHistoryDays ) = 0;
  208. // Gets the lifetime totals for an aggregated stat
  209. virtual bool GetGlobalStat( const char *pchStatName, int64 *pData ) = 0;
  210. virtual bool GetGlobalStat( const char *pchStatName, double *pData ) = 0;
  211. // Gets history for an aggregated stat. pData will be filled with daily values, starting with today.
  212. // So when called, pData[0] will be today, pData[1] will be yesterday, and pData[2] will be two days ago,
  213. // etc. cubData is the size in bytes of the pubData buffer. Returns the number of
  214. // elements actually set.
  215. virtual int32 GetGlobalStatHistory( const char *pchStatName, ARRAY_COUNT(cubData) int64 *pData, uint32 cubData ) = 0;
  216. virtual int32 GetGlobalStatHistory( const char *pchStatName, ARRAY_COUNT(cubData) double *pData, uint32 cubData ) = 0;
  217. #ifdef _PS3
  218. // Call to kick off installation of the PS3 trophies. This call is asynchronous, and the results will be returned in a PS3TrophiesInstalled_t
  219. // callback.
  220. virtual bool InstallPS3Trophies() = 0;
  221. // Returns the amount of space required at boot to install trophies. This value can be used when comparing the amount of space needed
  222. // by the game to the available space value passed to the game at boot. The value is set during InstallPS3Trophies().
  223. virtual uint64 GetTrophySpaceRequiredBeforeInstall() = 0;
  224. // On PS3, user stats & achievement progress through Steam must be stored with the user's saved game data.
  225. // At startup, before calling RequestCurrentStats(), you must pass the user's stats data to Steam via this method.
  226. // If you do not have any user data, call this function with pvData = NULL and cubData = 0
  227. virtual bool SetUserStatsData( const void *pvData, uint32 cubData ) = 0;
  228. // Call to get the user's current stats data. You should retrieve this data after receiving successful UserStatsReceived_t & UserStatsStored_t
  229. // callbacks, and store the data with the user's save game data. You can call this method with pvData = NULL and cubData = 0 to get the required
  230. // buffer size.
  231. virtual bool GetUserStatsData( void *pvData, uint32 cubData, uint32 *pcubWritten ) = 0;
  232. #endif
  233. };
  234. #define STEAMUSERSTATS_INTERFACE_VERSION "STEAMUSERSTATS_INTERFACE_VERSION011"
  235. // callbacks
  236. #if defined( VALVE_CALLBACK_PACK_SMALL )
  237. #pragma pack( push, 4 )
  238. #elif defined( VALVE_CALLBACK_PACK_LARGE )
  239. #pragma pack( push, 8 )
  240. #else
  241. #error isteamclient.h must be included
  242. #endif
  243. //-----------------------------------------------------------------------------
  244. // Purpose: called when the latests stats and achievements have been received
  245. // from the server
  246. //-----------------------------------------------------------------------------
  247. struct UserStatsReceived_t
  248. {
  249. enum { k_iCallback = k_iSteamUserStatsCallbacks + 1 };
  250. uint64 m_nGameID; // Game these stats are for
  251. EResult m_eResult; // Success / error fetching the stats
  252. CSteamID m_steamIDUser; // The user for whom the stats are retrieved for
  253. };
  254. //-----------------------------------------------------------------------------
  255. // Purpose: result of a request to store the user stats for a game
  256. //-----------------------------------------------------------------------------
  257. struct UserStatsStored_t
  258. {
  259. enum { k_iCallback = k_iSteamUserStatsCallbacks + 2 };
  260. uint64 m_nGameID; // Game these stats are for
  261. EResult m_eResult; // success / error
  262. };
  263. //-----------------------------------------------------------------------------
  264. // Purpose: result of a request to store the achievements for a game, or an
  265. // "indicate progress" call. If both m_nCurProgress and m_nMaxProgress
  266. // are zero, that means the achievement has been fully unlocked.
  267. //-----------------------------------------------------------------------------
  268. struct UserAchievementStored_t
  269. {
  270. enum { k_iCallback = k_iSteamUserStatsCallbacks + 3 };
  271. uint64 m_nGameID; // Game this is for
  272. bool m_bGroupAchievement; // if this is a "group" achievement
  273. char m_rgchAchievementName[k_cchStatNameMax]; // name of the achievement
  274. uint32 m_nCurProgress; // current progress towards the achievement
  275. uint32 m_nMaxProgress; // "out of" this many
  276. };
  277. //-----------------------------------------------------------------------------
  278. // Purpose: call result for finding a leaderboard, returned as a result of FindOrCreateLeaderboard() or FindLeaderboard()
  279. // use CCallResult<> to map this async result to a member function
  280. //-----------------------------------------------------------------------------
  281. struct LeaderboardFindResult_t
  282. {
  283. enum { k_iCallback = k_iSteamUserStatsCallbacks + 4 };
  284. SteamLeaderboard_t m_hSteamLeaderboard; // handle to the leaderboard serarched for, 0 if no leaderboard found
  285. uint8 m_bLeaderboardFound; // 0 if no leaderboard found
  286. };
  287. //-----------------------------------------------------------------------------
  288. // Purpose: call result indicating scores for a leaderboard have been downloaded and are ready to be retrieved, returned as a result of DownloadLeaderboardEntries()
  289. // use CCallResult<> to map this async result to a member function
  290. //-----------------------------------------------------------------------------
  291. struct LeaderboardScoresDownloaded_t
  292. {
  293. enum { k_iCallback = k_iSteamUserStatsCallbacks + 5 };
  294. SteamLeaderboard_t m_hSteamLeaderboard;
  295. SteamLeaderboardEntries_t m_hSteamLeaderboardEntries; // the handle to pass into GetDownloadedLeaderboardEntries()
  296. int m_cEntryCount; // the number of entries downloaded
  297. };
  298. //-----------------------------------------------------------------------------
  299. // Purpose: call result indicating scores has been uploaded, returned as a result of UploadLeaderboardScore()
  300. // use CCallResult<> to map this async result to a member function
  301. //-----------------------------------------------------------------------------
  302. struct LeaderboardScoreUploaded_t
  303. {
  304. enum { k_iCallback = k_iSteamUserStatsCallbacks + 6 };
  305. uint8 m_bSuccess; // 1 if the call was successful
  306. SteamLeaderboard_t m_hSteamLeaderboard; // the leaderboard handle that was
  307. int32 m_nScore; // the score that was attempted to set
  308. uint8 m_bScoreChanged; // true if the score in the leaderboard change, false if the existing score was better
  309. int m_nGlobalRankNew; // the new global rank of the user in this leaderboard
  310. int m_nGlobalRankPrevious; // the previous global rank of the user in this leaderboard; 0 if the user had no existing entry in the leaderboard
  311. };
  312. struct NumberOfCurrentPlayers_t
  313. {
  314. enum { k_iCallback = k_iSteamUserStatsCallbacks + 7 };
  315. uint8 m_bSuccess; // 1 if the call was successful
  316. int32 m_cPlayers; // Number of players currently playing
  317. };
  318. //-----------------------------------------------------------------------------
  319. // Purpose: Callback indicating that a user's stats have been unloaded.
  320. // Call RequestUserStats again to access stats for this user
  321. //-----------------------------------------------------------------------------
  322. struct UserStatsUnloaded_t
  323. {
  324. enum { k_iCallback = k_iSteamUserStatsCallbacks + 8 };
  325. CSteamID m_steamIDUser; // User whose stats have been unloaded
  326. };
  327. //-----------------------------------------------------------------------------
  328. // Purpose: Callback indicating that an achievement icon has been fetched
  329. //-----------------------------------------------------------------------------
  330. struct UserAchievementIconFetched_t
  331. {
  332. enum { k_iCallback = k_iSteamUserStatsCallbacks + 9 };
  333. CGameID m_nGameID; // Game this is for
  334. char m_rgchAchievementName[k_cchStatNameMax]; // name of the achievement
  335. bool m_bAchieved; // Is the icon for the achieved or not achieved version?
  336. int m_nIconHandle; // Handle to the image, which can be used in SteamUtils()->GetImageRGBA(), 0 means no image is set for the achievement
  337. };
  338. //-----------------------------------------------------------------------------
  339. // Purpose: Callback indicating that global achievement percentages are fetched
  340. //-----------------------------------------------------------------------------
  341. struct GlobalAchievementPercentagesReady_t
  342. {
  343. enum { k_iCallback = k_iSteamUserStatsCallbacks + 10 };
  344. uint64 m_nGameID; // Game this is for
  345. EResult m_eResult; // Result of the operation
  346. };
  347. //-----------------------------------------------------------------------------
  348. // Purpose: call result indicating UGC has been uploaded, returned as a result of SetLeaderboardUGC()
  349. //-----------------------------------------------------------------------------
  350. struct LeaderboardUGCSet_t
  351. {
  352. enum { k_iCallback = k_iSteamUserStatsCallbacks + 11 };
  353. EResult m_eResult; // The result of the operation
  354. SteamLeaderboard_t m_hSteamLeaderboard; // the leaderboard handle that was
  355. };
  356. //-----------------------------------------------------------------------------
  357. // Purpose: callback indicating that PS3 trophies have been installed
  358. //-----------------------------------------------------------------------------
  359. struct PS3TrophiesInstalled_t
  360. {
  361. enum { k_iCallback = k_iSteamUserStatsCallbacks + 12 };
  362. uint64 m_nGameID; // Game these stats are for
  363. EResult m_eResult; // The result of the operation
  364. uint64 m_ulRequiredDiskSpace; // If m_eResult is k_EResultDiskFull, will contain the amount of space needed to install trophies
  365. };
  366. //-----------------------------------------------------------------------------
  367. // Purpose: callback indicating global stats have been received.
  368. // Returned as a result of RequestGlobalStats()
  369. //-----------------------------------------------------------------------------
  370. struct GlobalStatsReceived_t
  371. {
  372. enum { k_iCallback = k_iSteamUserStatsCallbacks + 12 };
  373. uint64 m_nGameID; // Game global stats were requested for
  374. EResult m_eResult; // The result of the request
  375. };
  376. #pragma pack( pop )
  377. #endif // ISTEAMUSER_H