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.

696 lines
32 KiB

  1. //====== Copyright � 1996-2008, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose: public interface to user remote file storage in Steam
  4. //
  5. //=============================================================================
  6. #ifndef ISTEAMREMOTESTORAGE_H
  7. #define ISTEAMREMOTESTORAGE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "isteamclient.h"
  12. //-----------------------------------------------------------------------------
  13. // Purpose: Defines the largest allowed file size. Cloud files cannot be written
  14. // in a single chunk over 100MB (and cannot be over 200MB total.)
  15. //-----------------------------------------------------------------------------
  16. const uint32 k_unMaxCloudFileChunkSize = 100 * 1024 * 1024;
  17. //-----------------------------------------------------------------------------
  18. // Purpose: Structure that contains an array of const char * strings and the number of those strings
  19. //-----------------------------------------------------------------------------
  20. #if defined( VALVE_CALLBACK_PACK_SMALL )
  21. #pragma pack( push, 4 )
  22. #elif defined( VALVE_CALLBACK_PACK_LARGE )
  23. #pragma pack( push, 8 )
  24. #else
  25. #error isteamclient.h must be included
  26. #endif
  27. struct SteamParamStringArray_t
  28. {
  29. const char ** m_ppStrings;
  30. int32 m_nNumStrings;
  31. };
  32. #pragma pack( pop )
  33. // A handle to a piece of user generated content
  34. typedef uint64 UGCHandle_t;
  35. typedef uint64 PublishedFileUpdateHandle_t;
  36. typedef uint64 PublishedFileId_t;
  37. const PublishedFileId_t k_PublishedFileIdInvalid = 0;
  38. const UGCHandle_t k_UGCHandleInvalid = 0xffffffffffffffffull;
  39. const PublishedFileUpdateHandle_t k_PublishedFileUpdateHandleInvalid = 0xffffffffffffffffull;
  40. // Handle for writing to Steam Cloud
  41. typedef uint64 UGCFileWriteStreamHandle_t;
  42. const UGCFileWriteStreamHandle_t k_UGCFileStreamHandleInvalid = 0xffffffffffffffffull;
  43. const uint32 k_cchPublishedDocumentTitleMax = 128 + 1;
  44. const uint32 k_cchPublishedDocumentDescriptionMax = 8000;
  45. const uint32 k_cchPublishedDocumentChangeDescriptionMax = 8000;
  46. const uint32 k_unEnumeratePublishedFilesMaxResults = 50;
  47. const uint32 k_cchTagListMax = 1024 + 1;
  48. const uint32 k_cchFilenameMax = 260;
  49. const uint32 k_cchPublishedFileURLMax = 256;
  50. // Ways to handle a synchronization conflict
  51. enum EResolveConflict
  52. {
  53. k_EResolveConflictKeepClient = 1, // The local version of each file will be used to overwrite the server version
  54. k_EResolveConflictKeepServer = 2, // The server version of each file will be used to overwrite the local version
  55. };
  56. enum ERemoteStoragePlatform
  57. {
  58. k_ERemoteStoragePlatformNone = 0,
  59. k_ERemoteStoragePlatformWindows = (1 << 0),
  60. k_ERemoteStoragePlatformOSX = (1 << 1),
  61. k_ERemoteStoragePlatformPS3 = (1 << 2),
  62. k_ERemoteStoragePlatformLinux = (1 << 3),
  63. k_ERemoteStoragePlatformReserved2 = (1 << 4),
  64. k_ERemoteStoragePlatformAll = 0xffffffff
  65. };
  66. enum ERemoteStoragePublishedFileVisibility
  67. {
  68. k_ERemoteStoragePublishedFileVisibilityPublic = 0,
  69. k_ERemoteStoragePublishedFileVisibilityFriendsOnly = 1,
  70. k_ERemoteStoragePublishedFileVisibilityPrivate = 2,
  71. };
  72. enum EWorkshopFileType
  73. {
  74. k_EWorkshopFileTypeFirst = 0,
  75. k_EWorkshopFileTypeCommunity = 0, // normal Workshop item that can be subscribed to
  76. k_EWorkshopFileTypeMicrotransaction = 1, // Workshop item that is meant to be voted on for the purpose of selling in-game
  77. k_EWorkshopFileTypeCollection = 2, // a collection of Workshop or Greenlight items
  78. k_EWorkshopFileTypeArt = 3, // artwork
  79. k_EWorkshopFileTypeVideo = 4, // external video
  80. k_EWorkshopFileTypeScreenshot = 5, // screenshot
  81. k_EWorkshopFileTypeGame = 6, // Greenlight game entry
  82. k_EWorkshopFileTypeSoftware = 7, // Greenlight software entry
  83. k_EWorkshopFileTypeConcept = 8, // Greenlight concept
  84. k_EWorkshopFileTypeWebGuide = 9, // Steam web guide
  85. k_EWorkshopFileTypeIntegratedGuide = 10, // application integrated guide
  86. k_EWorkshopFileTypeMerch = 11, // Workshop merchandise meant to be voted on for the purpose of being sold
  87. k_EWorkshopFileTypeControllerBinding = 12, // Steam Controller bindings
  88. k_EWorkshopFileTypeSteamworksAccessInvite = 13, // internal
  89. k_EWorkshopFileTypeSteamVideo = 14, // Steam video
  90. k_EWorkshopFileTypeGameManagedItem = 15, // managed completely by the game, not the user, and not shown on the web
  91. // Update k_EWorkshopFileTypeMax if you add values.
  92. k_EWorkshopFileTypeMax = 16
  93. };
  94. enum EWorkshopVote
  95. {
  96. k_EWorkshopVoteUnvoted = 0,
  97. k_EWorkshopVoteFor = 1,
  98. k_EWorkshopVoteAgainst = 2,
  99. k_EWorkshopVoteLater = 3,
  100. };
  101. enum EWorkshopFileAction
  102. {
  103. k_EWorkshopFileActionPlayed = 0,
  104. k_EWorkshopFileActionCompleted = 1,
  105. };
  106. enum EWorkshopEnumerationType
  107. {
  108. k_EWorkshopEnumerationTypeRankedByVote = 0,
  109. k_EWorkshopEnumerationTypeRecent = 1,
  110. k_EWorkshopEnumerationTypeTrending = 2,
  111. k_EWorkshopEnumerationTypeFavoritesOfFriends = 3,
  112. k_EWorkshopEnumerationTypeVotedByFriends = 4,
  113. k_EWorkshopEnumerationTypeContentByFriends = 5,
  114. k_EWorkshopEnumerationTypeRecentFromFollowedUsers = 6,
  115. };
  116. enum EWorkshopVideoProvider
  117. {
  118. k_EWorkshopVideoProviderNone = 0,
  119. k_EWorkshopVideoProviderYoutube = 1
  120. };
  121. enum EUGCReadAction
  122. {
  123. // Keeps the file handle open unless the last byte is read. You can use this when reading large files (over 100MB) in sequential chunks.
  124. // If the last byte is read, this will behave the same as k_EUGCRead_Close. Otherwise, it behaves the same as k_EUGCRead_ContinueReading.
  125. // This value maintains the same behavior as before the EUGCReadAction parameter was introduced.
  126. k_EUGCRead_ContinueReadingUntilFinished = 0,
  127. // Keeps the file handle open. Use this when using UGCRead to seek to different parts of the file.
  128. // When you are done seeking around the file, make a final call with k_EUGCRead_Close to close it.
  129. k_EUGCRead_ContinueReading = 1,
  130. // Frees the file handle. Use this when you're done reading the content.
  131. // To read the file from Steam again you will need to call UGCDownload again.
  132. k_EUGCRead_Close = 2,
  133. };
  134. //-----------------------------------------------------------------------------
  135. // Purpose: Functions for accessing, reading and writing files stored remotely
  136. // and cached locally
  137. //-----------------------------------------------------------------------------
  138. class ISteamRemoteStorage
  139. {
  140. public:
  141. // NOTE
  142. //
  143. // Filenames are case-insensitive, and will be converted to lowercase automatically.
  144. // So "foo.bar" and "Foo.bar" are the same file, and if you write "Foo.bar" then
  145. // iterate the files, the filename returned will be "foo.bar".
  146. //
  147. // file operations
  148. virtual bool FileWrite( const char *pchFile, const void *pvData, int32 cubData ) = 0;
  149. virtual int32 FileRead( const char *pchFile, void *pvData, int32 cubDataToRead ) = 0;
  150. CALL_RESULT( RemoteStorageFileWriteAsyncComplete_t )
  151. virtual SteamAPICall_t FileWriteAsync( const char *pchFile, const void *pvData, uint32 cubData ) = 0;
  152. CALL_RESULT( RemoteStorageFileReadAsyncComplete_t )
  153. virtual SteamAPICall_t FileReadAsync( const char *pchFile, uint32 nOffset, uint32 cubToRead ) = 0;
  154. virtual bool FileReadAsyncComplete( SteamAPICall_t hReadCall, void *pvBuffer, uint32 cubToRead ) = 0;
  155. virtual bool FileForget( const char *pchFile ) = 0;
  156. virtual bool FileDelete( const char *pchFile ) = 0;
  157. CALL_RESULT( RemoteStorageFileShareResult_t )
  158. virtual SteamAPICall_t FileShare( const char *pchFile ) = 0;
  159. virtual bool SetSyncPlatforms( const char *pchFile, ERemoteStoragePlatform eRemoteStoragePlatform ) = 0;
  160. // file operations that cause network IO
  161. virtual UGCFileWriteStreamHandle_t FileWriteStreamOpen( const char *pchFile ) = 0;
  162. virtual bool FileWriteStreamWriteChunk( UGCFileWriteStreamHandle_t writeHandle, const void *pvData, int32 cubData ) = 0;
  163. virtual bool FileWriteStreamClose( UGCFileWriteStreamHandle_t writeHandle ) = 0;
  164. virtual bool FileWriteStreamCancel( UGCFileWriteStreamHandle_t writeHandle ) = 0;
  165. // file information
  166. virtual bool FileExists( const char *pchFile ) = 0;
  167. virtual bool FilePersisted( const char *pchFile ) = 0;
  168. virtual int32 GetFileSize( const char *pchFile ) = 0;
  169. virtual int64 GetFileTimestamp( const char *pchFile ) = 0;
  170. virtual ERemoteStoragePlatform GetSyncPlatforms( const char *pchFile ) = 0;
  171. // iteration
  172. virtual int32 GetFileCount() = 0;
  173. virtual const char *GetFileNameAndSize( int iFile, int32 *pnFileSizeInBytes ) = 0;
  174. // configuration management
  175. virtual bool GetQuota( int32 *pnTotalBytes, int32 *puAvailableBytes ) = 0;
  176. virtual bool IsCloudEnabledForAccount() = 0;
  177. virtual bool IsCloudEnabledForApp() = 0;
  178. virtual void SetCloudEnabledForApp( bool bEnabled ) = 0;
  179. // user generated content
  180. // Downloads a UGC file. A priority value of 0 will download the file immediately,
  181. // otherwise it will wait to download the file until all downloads with a lower priority
  182. // value are completed. Downloads with equal priority will occur simultaneously.
  183. CALL_RESULT( RemoteStorageDownloadUGCResult_t )
  184. virtual SteamAPICall_t UGCDownload( UGCHandle_t hContent, uint32 unPriority ) = 0;
  185. // Gets the amount of data downloaded so far for a piece of content. pnBytesExpected can be 0 if function returns false
  186. // or if the transfer hasn't started yet, so be careful to check for that before dividing to get a percentage
  187. virtual bool GetUGCDownloadProgress( UGCHandle_t hContent, int32 *pnBytesDownloaded, int32 *pnBytesExpected ) = 0;
  188. // Gets metadata for a file after it has been downloaded. This is the same metadata given in the RemoteStorageDownloadUGCResult_t call result
  189. virtual bool GetUGCDetails( UGCHandle_t hContent, AppId_t *pnAppID, OUT_STRING() char **ppchName, int32 *pnFileSizeInBytes, OUT_STRUCT() CSteamID *pSteamIDOwner ) = 0;
  190. // After download, gets the content of the file.
  191. // Small files can be read all at once by calling this function with an offset of 0 and cubDataToRead equal to the size of the file.
  192. // Larger files can be read in chunks to reduce memory usage (since both sides of the IPC client and the game itself must allocate
  193. // enough memory for each chunk). Once the last byte is read, the file is implicitly closed and further calls to UGCRead will fail
  194. // unless UGCDownload is called again.
  195. // For especially large files (anything over 100MB) it is a requirement that the file is read in chunks.
  196. virtual int32 UGCRead( UGCHandle_t hContent, void *pvData, int32 cubDataToRead, uint32 cOffset, EUGCReadAction eAction ) = 0;
  197. // Functions to iterate through UGC that has finished downloading but has not yet been read via UGCRead()
  198. virtual int32 GetCachedUGCCount() = 0;
  199. virtual UGCHandle_t GetCachedUGCHandle( int32 iCachedContent ) = 0;
  200. // The following functions are only necessary on the Playstation 3. On PC & Mac, the Steam client will handle these operations for you
  201. // On Playstation 3, the game controls which files are stored in the cloud, via FilePersist, FileFetch, and FileForget.
  202. #if defined(_PS3) || defined(_SERVER)
  203. // Connect to Steam and get a list of files in the Cloud - results in a RemoteStorageAppSyncStatusCheck_t callback
  204. virtual void GetFileListFromServer() = 0;
  205. // Indicate this file should be downloaded in the next sync
  206. virtual bool FileFetch( const char *pchFile ) = 0;
  207. // Indicate this file should be persisted in the next sync
  208. virtual bool FilePersist( const char *pchFile ) = 0;
  209. // Pull any requested files down from the Cloud - results in a RemoteStorageAppSyncedClient_t callback
  210. virtual bool SynchronizeToClient() = 0;
  211. // Upload any requested files to the Cloud - results in a RemoteStorageAppSyncedServer_t callback
  212. virtual bool SynchronizeToServer() = 0;
  213. // Reset any fetch/persist/etc requests
  214. virtual bool ResetFileRequestState() = 0;
  215. #endif
  216. // publishing UGC
  217. CALL_RESULT( RemoteStoragePublishFileProgress_t )
  218. virtual SteamAPICall_t PublishWorkshopFile( const char *pchFile, const char *pchPreviewFile, AppId_t nConsumerAppId, const char *pchTitle, const char *pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, SteamParamStringArray_t *pTags, EWorkshopFileType eWorkshopFileType ) = 0;
  219. virtual PublishedFileUpdateHandle_t CreatePublishedFileUpdateRequest( PublishedFileId_t unPublishedFileId ) = 0;
  220. virtual bool UpdatePublishedFileFile( PublishedFileUpdateHandle_t updateHandle, const char *pchFile ) = 0;
  221. virtual bool UpdatePublishedFilePreviewFile( PublishedFileUpdateHandle_t updateHandle, const char *pchPreviewFile ) = 0;
  222. virtual bool UpdatePublishedFileTitle( PublishedFileUpdateHandle_t updateHandle, const char *pchTitle ) = 0;
  223. virtual bool UpdatePublishedFileDescription( PublishedFileUpdateHandle_t updateHandle, const char *pchDescription ) = 0;
  224. virtual bool UpdatePublishedFileVisibility( PublishedFileUpdateHandle_t updateHandle, ERemoteStoragePublishedFileVisibility eVisibility ) = 0;
  225. virtual bool UpdatePublishedFileTags( PublishedFileUpdateHandle_t updateHandle, SteamParamStringArray_t *pTags ) = 0;
  226. CALL_RESULT( RemoteStorageUpdatePublishedFileResult_t )
  227. virtual SteamAPICall_t CommitPublishedFileUpdate( PublishedFileUpdateHandle_t updateHandle ) = 0;
  228. // Gets published file details for the given publishedfileid. If unMaxSecondsOld is greater than 0,
  229. // cached data may be returned, depending on how long ago it was cached. A value of 0 will force a refresh.
  230. // A value of k_WorkshopForceLoadPublishedFileDetailsFromCache will use cached data if it exists, no matter how old it is.
  231. CALL_RESULT( RemoteStorageGetPublishedFileDetailsResult_t )
  232. virtual SteamAPICall_t GetPublishedFileDetails( PublishedFileId_t unPublishedFileId, uint32 unMaxSecondsOld ) = 0;
  233. CALL_RESULT( RemoteStorageDeletePublishedFileResult_t )
  234. virtual SteamAPICall_t DeletePublishedFile( PublishedFileId_t unPublishedFileId ) = 0;
  235. // enumerate the files that the current user published with this app
  236. CALL_RESULT( RemoteStorageEnumerateUserPublishedFilesResult_t )
  237. virtual SteamAPICall_t EnumerateUserPublishedFiles( uint32 unStartIndex ) = 0;
  238. CALL_RESULT( RemoteStorageSubscribePublishedFileResult_t )
  239. virtual SteamAPICall_t SubscribePublishedFile( PublishedFileId_t unPublishedFileId ) = 0;
  240. CALL_RESULT( RemoteStorageEnumerateUserSubscribedFilesResult_t )
  241. virtual SteamAPICall_t EnumerateUserSubscribedFiles( uint32 unStartIndex ) = 0;
  242. CALL_RESULT( RemoteStorageUnsubscribePublishedFileResult_t )
  243. virtual SteamAPICall_t UnsubscribePublishedFile( PublishedFileId_t unPublishedFileId ) = 0;
  244. virtual bool UpdatePublishedFileSetChangeDescription( PublishedFileUpdateHandle_t updateHandle, const char *pchChangeDescription ) = 0;
  245. CALL_RESULT( RemoteStorageGetPublishedItemVoteDetailsResult_t )
  246. virtual SteamAPICall_t GetPublishedItemVoteDetails( PublishedFileId_t unPublishedFileId ) = 0;
  247. CALL_RESULT( RemoteStorageUpdateUserPublishedItemVoteResult_t )
  248. virtual SteamAPICall_t UpdateUserPublishedItemVote( PublishedFileId_t unPublishedFileId, bool bVoteUp ) = 0;
  249. CALL_RESULT( RemoteStorageGetPublishedItemVoteDetailsResult_t )
  250. virtual SteamAPICall_t GetUserPublishedItemVoteDetails( PublishedFileId_t unPublishedFileId ) = 0;
  251. CALL_RESULT( RemoteStorageEnumerateUserPublishedFilesResult_t )
  252. virtual SteamAPICall_t EnumerateUserSharedWorkshopFiles( CSteamID steamId, uint32 unStartIndex, SteamParamStringArray_t *pRequiredTags, SteamParamStringArray_t *pExcludedTags ) = 0;
  253. CALL_RESULT( RemoteStoragePublishFileProgress_t )
  254. virtual SteamAPICall_t PublishVideo( EWorkshopVideoProvider eVideoProvider, const char *pchVideoAccount, const char *pchVideoIdentifier, const char *pchPreviewFile, AppId_t nConsumerAppId, const char *pchTitle, const char *pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, SteamParamStringArray_t *pTags ) = 0;
  255. CALL_RESULT( RemoteStorageEnumeratePublishedFilesByUserActionResult_t )
  256. virtual SteamAPICall_t SetUserPublishedFileAction( PublishedFileId_t unPublishedFileId, EWorkshopFileAction eAction ) = 0;
  257. CALL_RESULT( RemoteStorageEnumeratePublishedFilesByUserActionResult_t )
  258. virtual SteamAPICall_t EnumeratePublishedFilesByUserAction( EWorkshopFileAction eAction, uint32 unStartIndex ) = 0;
  259. // this method enumerates the public view of workshop files
  260. CALL_RESULT( RemoteStorageEnumerateWorkshopFilesResult_t )
  261. virtual SteamAPICall_t EnumeratePublishedWorkshopFiles( EWorkshopEnumerationType eEnumerationType, uint32 unStartIndex, uint32 unCount, uint32 unDays, SteamParamStringArray_t *pTags, SteamParamStringArray_t *pUserTags ) = 0;
  262. CALL_RESULT( RemoteStorageDownloadUGCResult_t )
  263. virtual SteamAPICall_t UGCDownloadToLocation( UGCHandle_t hContent, const char *pchLocation, uint32 unPriority ) = 0;
  264. };
  265. #define STEAMREMOTESTORAGE_INTERFACE_VERSION "STEAMREMOTESTORAGE_INTERFACE_VERSION013"
  266. // callbacks
  267. #if defined( VALVE_CALLBACK_PACK_SMALL )
  268. #pragma pack( push, 4 )
  269. #elif defined( VALVE_CALLBACK_PACK_LARGE )
  270. #pragma pack( push, 8 )
  271. #else
  272. #error isteamclient.h must be included
  273. #endif
  274. //-----------------------------------------------------------------------------
  275. // Purpose: sent when the local file cache is fully synced with the server for an app
  276. // That means that an application can be started and has all latest files
  277. //-----------------------------------------------------------------------------
  278. struct RemoteStorageAppSyncedClient_t
  279. {
  280. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 1 };
  281. AppId_t m_nAppID;
  282. EResult m_eResult;
  283. int m_unNumDownloads;
  284. };
  285. //-----------------------------------------------------------------------------
  286. // Purpose: sent when the server is fully synced with the local file cache for an app
  287. // That means that we can shutdown Steam and our data is stored on the server
  288. //-----------------------------------------------------------------------------
  289. struct RemoteStorageAppSyncedServer_t
  290. {
  291. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 2 };
  292. AppId_t m_nAppID;
  293. EResult m_eResult;
  294. int m_unNumUploads;
  295. };
  296. //-----------------------------------------------------------------------------
  297. // Purpose: Status of up and downloads during a sync session
  298. //
  299. //-----------------------------------------------------------------------------
  300. struct RemoteStorageAppSyncProgress_t
  301. {
  302. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 3 };
  303. char m_rgchCurrentFile[k_cchFilenameMax]; // Current file being transferred
  304. AppId_t m_nAppID; // App this info relates to
  305. uint32 m_uBytesTransferredThisChunk; // Bytes transferred this chunk
  306. double m_dAppPercentComplete; // Percent complete that this app's transfers are
  307. bool m_bUploading; // if false, downloading
  308. };
  309. //
  310. // IMPORTANT! k_iClientRemoteStorageCallbacks + 4 is used, see iclientremotestorage.h
  311. //
  312. //-----------------------------------------------------------------------------
  313. // Purpose: Sent after we've determined the list of files that are out of sync
  314. // with the server.
  315. //-----------------------------------------------------------------------------
  316. struct RemoteStorageAppSyncStatusCheck_t
  317. {
  318. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 5 };
  319. AppId_t m_nAppID;
  320. EResult m_eResult;
  321. };
  322. //-----------------------------------------------------------------------------
  323. // Purpose: Sent after a conflict resolution attempt.
  324. //-----------------------------------------------------------------------------
  325. struct RemoteStorageConflictResolution_t
  326. {
  327. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 6 };
  328. AppId_t m_nAppID;
  329. EResult m_eResult;
  330. };
  331. //-----------------------------------------------------------------------------
  332. // Purpose: The result of a call to FileShare()
  333. //-----------------------------------------------------------------------------
  334. struct RemoteStorageFileShareResult_t
  335. {
  336. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 7 };
  337. EResult m_eResult; // The result of the operation
  338. UGCHandle_t m_hFile; // The handle that can be shared with users and features
  339. char m_rgchFilename[k_cchFilenameMax]; // The name of the file that was shared
  340. };
  341. // k_iClientRemoteStorageCallbacks + 8 is deprecated! Do not reuse
  342. //-----------------------------------------------------------------------------
  343. // Purpose: The result of a call to PublishFile()
  344. //-----------------------------------------------------------------------------
  345. struct RemoteStoragePublishFileResult_t
  346. {
  347. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 9 };
  348. EResult m_eResult; // The result of the operation.
  349. PublishedFileId_t m_nPublishedFileId;
  350. bool m_bUserNeedsToAcceptWorkshopLegalAgreement;
  351. };
  352. //-----------------------------------------------------------------------------
  353. // Purpose: The result of a call to DeletePublishedFile()
  354. //-----------------------------------------------------------------------------
  355. struct RemoteStorageDeletePublishedFileResult_t
  356. {
  357. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 11 };
  358. EResult m_eResult; // The result of the operation.
  359. PublishedFileId_t m_nPublishedFileId;
  360. };
  361. //-----------------------------------------------------------------------------
  362. // Purpose: The result of a call to EnumerateUserPublishedFiles()
  363. //-----------------------------------------------------------------------------
  364. struct RemoteStorageEnumerateUserPublishedFilesResult_t
  365. {
  366. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 12 };
  367. EResult m_eResult; // The result of the operation.
  368. int32 m_nResultsReturned;
  369. int32 m_nTotalResultCount;
  370. PublishedFileId_t m_rgPublishedFileId[ k_unEnumeratePublishedFilesMaxResults ];
  371. };
  372. //-----------------------------------------------------------------------------
  373. // Purpose: The result of a call to SubscribePublishedFile()
  374. //-----------------------------------------------------------------------------
  375. struct RemoteStorageSubscribePublishedFileResult_t
  376. {
  377. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 13 };
  378. EResult m_eResult; // The result of the operation.
  379. PublishedFileId_t m_nPublishedFileId;
  380. };
  381. //-----------------------------------------------------------------------------
  382. // Purpose: The result of a call to EnumerateSubscribePublishedFiles()
  383. //-----------------------------------------------------------------------------
  384. struct RemoteStorageEnumerateUserSubscribedFilesResult_t
  385. {
  386. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 14 };
  387. EResult m_eResult; // The result of the operation.
  388. int32 m_nResultsReturned;
  389. int32 m_nTotalResultCount;
  390. PublishedFileId_t m_rgPublishedFileId[ k_unEnumeratePublishedFilesMaxResults ];
  391. uint32 m_rgRTimeSubscribed[ k_unEnumeratePublishedFilesMaxResults ];
  392. };
  393. #if defined(VALVE_CALLBACK_PACK_SMALL)
  394. VALVE_COMPILE_TIME_ASSERT( sizeof( RemoteStorageEnumerateUserSubscribedFilesResult_t ) == (1 + 1 + 1 + 50 + 100) * 4 );
  395. #elif defined(VALVE_CALLBACK_PACK_LARGE)
  396. VALVE_COMPILE_TIME_ASSERT( sizeof( RemoteStorageEnumerateUserSubscribedFilesResult_t ) == (1 + 1 + 1 + 50 + 100) * 4 + 4 );
  397. #else
  398. #warning You must first include isteamclient.h
  399. #endif
  400. //-----------------------------------------------------------------------------
  401. // Purpose: The result of a call to UnsubscribePublishedFile()
  402. //-----------------------------------------------------------------------------
  403. struct RemoteStorageUnsubscribePublishedFileResult_t
  404. {
  405. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 15 };
  406. EResult m_eResult; // The result of the operation.
  407. PublishedFileId_t m_nPublishedFileId;
  408. };
  409. //-----------------------------------------------------------------------------
  410. // Purpose: The result of a call to CommitPublishedFileUpdate()
  411. //-----------------------------------------------------------------------------
  412. struct RemoteStorageUpdatePublishedFileResult_t
  413. {
  414. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 16 };
  415. EResult m_eResult; // The result of the operation.
  416. PublishedFileId_t m_nPublishedFileId;
  417. bool m_bUserNeedsToAcceptWorkshopLegalAgreement;
  418. };
  419. //-----------------------------------------------------------------------------
  420. // Purpose: The result of a call to UGCDownload()
  421. //-----------------------------------------------------------------------------
  422. struct RemoteStorageDownloadUGCResult_t
  423. {
  424. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 17 };
  425. EResult m_eResult; // The result of the operation.
  426. UGCHandle_t m_hFile; // The handle to the file that was attempted to be downloaded.
  427. AppId_t m_nAppID; // ID of the app that created this file.
  428. int32 m_nSizeInBytes; // The size of the file that was downloaded, in bytes.
  429. char m_pchFileName[k_cchFilenameMax]; // The name of the file that was downloaded.
  430. uint64 m_ulSteamIDOwner; // Steam ID of the user who created this content.
  431. };
  432. //-----------------------------------------------------------------------------
  433. // Purpose: The result of a call to GetPublishedFileDetails()
  434. //-----------------------------------------------------------------------------
  435. struct RemoteStorageGetPublishedFileDetailsResult_t
  436. {
  437. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 18 };
  438. EResult m_eResult; // The result of the operation.
  439. PublishedFileId_t m_nPublishedFileId;
  440. AppId_t m_nCreatorAppID; // ID of the app that created this file.
  441. AppId_t m_nConsumerAppID; // ID of the app that will consume this file.
  442. char m_rgchTitle[k_cchPublishedDocumentTitleMax]; // title of document
  443. char m_rgchDescription[k_cchPublishedDocumentDescriptionMax]; // description of document
  444. UGCHandle_t m_hFile; // The handle of the primary file
  445. UGCHandle_t m_hPreviewFile; // The handle of the preview file
  446. uint64 m_ulSteamIDOwner; // Steam ID of the user who created this content.
  447. uint32 m_rtimeCreated; // time when the published file was created
  448. uint32 m_rtimeUpdated; // time when the published file was last updated
  449. ERemoteStoragePublishedFileVisibility m_eVisibility;
  450. bool m_bBanned;
  451. char m_rgchTags[k_cchTagListMax]; // comma separated list of all tags associated with this file
  452. bool m_bTagsTruncated; // whether the list of tags was too long to be returned in the provided buffer
  453. char m_pchFileName[k_cchFilenameMax]; // The name of the primary file
  454. int32 m_nFileSize; // Size of the primary file
  455. int32 m_nPreviewFileSize; // Size of the preview file
  456. char m_rgchURL[k_cchPublishedFileURLMax]; // URL (for a video or a website)
  457. EWorkshopFileType m_eFileType; // Type of the file
  458. bool m_bAcceptedForUse; // developer has specifically flagged this item as accepted in the Workshop
  459. };
  460. struct RemoteStorageEnumerateWorkshopFilesResult_t
  461. {
  462. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 19 };
  463. EResult m_eResult;
  464. int32 m_nResultsReturned;
  465. int32 m_nTotalResultCount;
  466. PublishedFileId_t m_rgPublishedFileId[ k_unEnumeratePublishedFilesMaxResults ];
  467. float m_rgScore[ k_unEnumeratePublishedFilesMaxResults ];
  468. AppId_t m_nAppId;
  469. uint32 m_unStartIndex;
  470. };
  471. //-----------------------------------------------------------------------------
  472. // Purpose: The result of GetPublishedItemVoteDetails
  473. //-----------------------------------------------------------------------------
  474. struct RemoteStorageGetPublishedItemVoteDetailsResult_t
  475. {
  476. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 20 };
  477. EResult m_eResult;
  478. PublishedFileId_t m_unPublishedFileId;
  479. int32 m_nVotesFor;
  480. int32 m_nVotesAgainst;
  481. int32 m_nReports;
  482. float m_fScore;
  483. };
  484. //-----------------------------------------------------------------------------
  485. // Purpose: User subscribed to a file for the app (from within the app or on the web)
  486. //-----------------------------------------------------------------------------
  487. struct RemoteStoragePublishedFileSubscribed_t
  488. {
  489. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 21 };
  490. PublishedFileId_t m_nPublishedFileId; // The published file id
  491. AppId_t m_nAppID; // ID of the app that will consume this file.
  492. };
  493. //-----------------------------------------------------------------------------
  494. // Purpose: User unsubscribed from a file for the app (from within the app or on the web)
  495. //-----------------------------------------------------------------------------
  496. struct RemoteStoragePublishedFileUnsubscribed_t
  497. {
  498. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 22 };
  499. PublishedFileId_t m_nPublishedFileId; // The published file id
  500. AppId_t m_nAppID; // ID of the app that will consume this file.
  501. };
  502. //-----------------------------------------------------------------------------
  503. // Purpose: Published file that a user owns was deleted (from within the app or the web)
  504. //-----------------------------------------------------------------------------
  505. struct RemoteStoragePublishedFileDeleted_t
  506. {
  507. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 23 };
  508. PublishedFileId_t m_nPublishedFileId; // The published file id
  509. AppId_t m_nAppID; // ID of the app that will consume this file.
  510. };
  511. //-----------------------------------------------------------------------------
  512. // Purpose: The result of a call to UpdateUserPublishedItemVote()
  513. //-----------------------------------------------------------------------------
  514. struct RemoteStorageUpdateUserPublishedItemVoteResult_t
  515. {
  516. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 24 };
  517. EResult m_eResult; // The result of the operation.
  518. PublishedFileId_t m_nPublishedFileId; // The published file id
  519. };
  520. //-----------------------------------------------------------------------------
  521. // Purpose: The result of a call to GetUserPublishedItemVoteDetails()
  522. //-----------------------------------------------------------------------------
  523. struct RemoteStorageUserVoteDetails_t
  524. {
  525. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 25 };
  526. EResult m_eResult; // The result of the operation.
  527. PublishedFileId_t m_nPublishedFileId; // The published file id
  528. EWorkshopVote m_eVote; // what the user voted
  529. };
  530. struct RemoteStorageEnumerateUserSharedWorkshopFilesResult_t
  531. {
  532. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 26 };
  533. EResult m_eResult; // The result of the operation.
  534. int32 m_nResultsReturned;
  535. int32 m_nTotalResultCount;
  536. PublishedFileId_t m_rgPublishedFileId[ k_unEnumeratePublishedFilesMaxResults ];
  537. };
  538. struct RemoteStorageSetUserPublishedFileActionResult_t
  539. {
  540. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 27 };
  541. EResult m_eResult; // The result of the operation.
  542. PublishedFileId_t m_nPublishedFileId; // The published file id
  543. EWorkshopFileAction m_eAction; // the action that was attempted
  544. };
  545. struct RemoteStorageEnumeratePublishedFilesByUserActionResult_t
  546. {
  547. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 28 };
  548. EResult m_eResult; // The result of the operation.
  549. EWorkshopFileAction m_eAction; // the action that was filtered on
  550. int32 m_nResultsReturned;
  551. int32 m_nTotalResultCount;
  552. PublishedFileId_t m_rgPublishedFileId[ k_unEnumeratePublishedFilesMaxResults ];
  553. uint32 m_rgRTimeUpdated[ k_unEnumeratePublishedFilesMaxResults ];
  554. };
  555. //-----------------------------------------------------------------------------
  556. // Purpose: Called periodically while a PublishWorkshopFile is in progress
  557. //-----------------------------------------------------------------------------
  558. struct RemoteStoragePublishFileProgress_t
  559. {
  560. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 29 };
  561. double m_dPercentFile;
  562. bool m_bPreview;
  563. };
  564. //-----------------------------------------------------------------------------
  565. // Purpose: Called when the content for a published file is updated
  566. //-----------------------------------------------------------------------------
  567. struct RemoteStoragePublishedFileUpdated_t
  568. {
  569. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 30 };
  570. PublishedFileId_t m_nPublishedFileId; // The published file id
  571. AppId_t m_nAppID; // ID of the app that will consume this file.
  572. uint64 m_ulUnused; // not used anymore
  573. };
  574. //-----------------------------------------------------------------------------
  575. // Purpose: Called when a FileWriteAsync completes
  576. //-----------------------------------------------------------------------------
  577. struct RemoteStorageFileWriteAsyncComplete_t
  578. {
  579. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 31 };
  580. EResult m_eResult; // result
  581. };
  582. //-----------------------------------------------------------------------------
  583. // Purpose: Called when a FileReadAsync completes
  584. //-----------------------------------------------------------------------------
  585. struct RemoteStorageFileReadAsyncComplete_t
  586. {
  587. enum { k_iCallback = k_iClientRemoteStorageCallbacks + 32 };
  588. SteamAPICall_t m_hFileReadAsync; // call handle of the async read which was made
  589. EResult m_eResult; // result
  590. uint32 m_nOffset; // offset in the file this read was at
  591. uint32 m_cubRead; // amount read - will the <= the amount requested
  592. };
  593. #pragma pack( pop )
  594. #endif // ISTEAMREMOTESTORAGE_H