isteamremotestorage.h 31 KB

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