Counter Strike : Global Offensive Source Code
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.

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