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