isteamremotestorage.cs (25004B)
1 // This file is provided under The MIT License as part of Steamworks.NET. 2 // Copyright (c) 2013-2019 Riley Labrecque 3 // Please see the included LICENSE.txt for additional information. 4 5 // This file is automatically generated. 6 // Changes to this file will be reverted when you update Steamworks.NET 7 8 #if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH 9 #define DISABLESTEAMWORKS 10 #endif 11 12 #if !DISABLESTEAMWORKS 13 14 using System.Runtime.InteropServices; 15 using IntPtr = System.IntPtr; 16 17 namespace Steamworks { 18 public static class SteamRemoteStorage { 19 /// <summary> 20 /// <para> NOTE</para> 21 /// <para> Filenames are case-insensitive, and will be converted to lowercase automatically.</para> 22 /// <para> So "foo.bar" and "Foo.bar" are the same file, and if you write "Foo.bar" then</para> 23 /// <para> iterate the files, the filename returned will be "foo.bar".</para> 24 /// <para> file operations</para> 25 /// </summary> 26 public static bool FileWrite(string pchFile, byte[] pvData, int cubData) { 27 InteropHelp.TestIfAvailableClient(); 28 using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) { 29 return NativeMethods.ISteamRemoteStorage_FileWrite(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2, pvData, cubData); 30 } 31 } 32 33 public static int FileRead(string pchFile, byte[] pvData, int cubDataToRead) { 34 InteropHelp.TestIfAvailableClient(); 35 using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) { 36 return NativeMethods.ISteamRemoteStorage_FileRead(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2, pvData, cubDataToRead); 37 } 38 } 39 40 public static SteamAPICall_t FileWriteAsync(string pchFile, byte[] pvData, uint cubData) { 41 InteropHelp.TestIfAvailableClient(); 42 using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) { 43 return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_FileWriteAsync(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2, pvData, cubData); 44 } 45 } 46 47 public static SteamAPICall_t FileReadAsync(string pchFile, uint nOffset, uint cubToRead) { 48 InteropHelp.TestIfAvailableClient(); 49 using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) { 50 return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_FileReadAsync(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2, nOffset, cubToRead); 51 } 52 } 53 54 public static bool FileReadAsyncComplete(SteamAPICall_t hReadCall, byte[] pvBuffer, uint cubToRead) { 55 InteropHelp.TestIfAvailableClient(); 56 return NativeMethods.ISteamRemoteStorage_FileReadAsyncComplete(CSteamAPIContext.GetSteamRemoteStorage(), hReadCall, pvBuffer, cubToRead); 57 } 58 59 public static bool FileForget(string pchFile) { 60 InteropHelp.TestIfAvailableClient(); 61 using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) { 62 return NativeMethods.ISteamRemoteStorage_FileForget(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2); 63 } 64 } 65 66 public static bool FileDelete(string pchFile) { 67 InteropHelp.TestIfAvailableClient(); 68 using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) { 69 return NativeMethods.ISteamRemoteStorage_FileDelete(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2); 70 } 71 } 72 73 public static SteamAPICall_t FileShare(string pchFile) { 74 InteropHelp.TestIfAvailableClient(); 75 using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) { 76 return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_FileShare(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2); 77 } 78 } 79 80 public static bool SetSyncPlatforms(string pchFile, ERemoteStoragePlatform eRemoteStoragePlatform) { 81 InteropHelp.TestIfAvailableClient(); 82 using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) { 83 return NativeMethods.ISteamRemoteStorage_SetSyncPlatforms(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2, eRemoteStoragePlatform); 84 } 85 } 86 87 /// <summary> 88 /// <para> file operations that cause network IO</para> 89 /// </summary> 90 public static UGCFileWriteStreamHandle_t FileWriteStreamOpen(string pchFile) { 91 InteropHelp.TestIfAvailableClient(); 92 using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) { 93 return (UGCFileWriteStreamHandle_t)NativeMethods.ISteamRemoteStorage_FileWriteStreamOpen(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2); 94 } 95 } 96 97 public static bool FileWriteStreamWriteChunk(UGCFileWriteStreamHandle_t writeHandle, byte[] pvData, int cubData) { 98 InteropHelp.TestIfAvailableClient(); 99 return NativeMethods.ISteamRemoteStorage_FileWriteStreamWriteChunk(CSteamAPIContext.GetSteamRemoteStorage(), writeHandle, pvData, cubData); 100 } 101 102 public static bool FileWriteStreamClose(UGCFileWriteStreamHandle_t writeHandle) { 103 InteropHelp.TestIfAvailableClient(); 104 return NativeMethods.ISteamRemoteStorage_FileWriteStreamClose(CSteamAPIContext.GetSteamRemoteStorage(), writeHandle); 105 } 106 107 public static bool FileWriteStreamCancel(UGCFileWriteStreamHandle_t writeHandle) { 108 InteropHelp.TestIfAvailableClient(); 109 return NativeMethods.ISteamRemoteStorage_FileWriteStreamCancel(CSteamAPIContext.GetSteamRemoteStorage(), writeHandle); 110 } 111 112 /// <summary> 113 /// <para> file information</para> 114 /// </summary> 115 public static bool FileExists(string pchFile) { 116 InteropHelp.TestIfAvailableClient(); 117 using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) { 118 return NativeMethods.ISteamRemoteStorage_FileExists(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2); 119 } 120 } 121 122 public static bool FilePersisted(string pchFile) { 123 InteropHelp.TestIfAvailableClient(); 124 using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) { 125 return NativeMethods.ISteamRemoteStorage_FilePersisted(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2); 126 } 127 } 128 129 public static int GetFileSize(string pchFile) { 130 InteropHelp.TestIfAvailableClient(); 131 using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) { 132 return NativeMethods.ISteamRemoteStorage_GetFileSize(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2); 133 } 134 } 135 136 public static long GetFileTimestamp(string pchFile) { 137 InteropHelp.TestIfAvailableClient(); 138 using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) { 139 return NativeMethods.ISteamRemoteStorage_GetFileTimestamp(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2); 140 } 141 } 142 143 public static ERemoteStoragePlatform GetSyncPlatforms(string pchFile) { 144 InteropHelp.TestIfAvailableClient(); 145 using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) { 146 return NativeMethods.ISteamRemoteStorage_GetSyncPlatforms(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2); 147 } 148 } 149 150 /// <summary> 151 /// <para> iteration</para> 152 /// </summary> 153 public static int GetFileCount() { 154 InteropHelp.TestIfAvailableClient(); 155 return NativeMethods.ISteamRemoteStorage_GetFileCount(CSteamAPIContext.GetSteamRemoteStorage()); 156 } 157 158 public static string GetFileNameAndSize(int iFile, out int pnFileSizeInBytes) { 159 InteropHelp.TestIfAvailableClient(); 160 return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamRemoteStorage_GetFileNameAndSize(CSteamAPIContext.GetSteamRemoteStorage(), iFile, out pnFileSizeInBytes)); 161 } 162 163 /// <summary> 164 /// <para> configuration management</para> 165 /// </summary> 166 public static bool GetQuota(out ulong pnTotalBytes, out ulong puAvailableBytes) { 167 InteropHelp.TestIfAvailableClient(); 168 return NativeMethods.ISteamRemoteStorage_GetQuota(CSteamAPIContext.GetSteamRemoteStorage(), out pnTotalBytes, out puAvailableBytes); 169 } 170 171 public static bool IsCloudEnabledForAccount() { 172 InteropHelp.TestIfAvailableClient(); 173 return NativeMethods.ISteamRemoteStorage_IsCloudEnabledForAccount(CSteamAPIContext.GetSteamRemoteStorage()); 174 } 175 176 public static bool IsCloudEnabledForApp() { 177 InteropHelp.TestIfAvailableClient(); 178 return NativeMethods.ISteamRemoteStorage_IsCloudEnabledForApp(CSteamAPIContext.GetSteamRemoteStorage()); 179 } 180 181 public static void SetCloudEnabledForApp(bool bEnabled) { 182 InteropHelp.TestIfAvailableClient(); 183 NativeMethods.ISteamRemoteStorage_SetCloudEnabledForApp(CSteamAPIContext.GetSteamRemoteStorage(), bEnabled); 184 } 185 186 /// <summary> 187 /// <para> user generated content</para> 188 /// <para> Downloads a UGC file. A priority value of 0 will download the file immediately,</para> 189 /// <para> otherwise it will wait to download the file until all downloads with a lower priority</para> 190 /// <para> value are completed. Downloads with equal priority will occur simultaneously.</para> 191 /// </summary> 192 public static SteamAPICall_t UGCDownload(UGCHandle_t hContent, uint unPriority) { 193 InteropHelp.TestIfAvailableClient(); 194 return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_UGCDownload(CSteamAPIContext.GetSteamRemoteStorage(), hContent, unPriority); 195 } 196 197 /// <summary> 198 /// <para> Gets the amount of data downloaded so far for a piece of content. pnBytesExpected can be 0 if function returns false</para> 199 /// <para> or if the transfer hasn't started yet, so be careful to check for that before dividing to get a percentage</para> 200 /// </summary> 201 public static bool GetUGCDownloadProgress(UGCHandle_t hContent, out int pnBytesDownloaded, out int pnBytesExpected) { 202 InteropHelp.TestIfAvailableClient(); 203 return NativeMethods.ISteamRemoteStorage_GetUGCDownloadProgress(CSteamAPIContext.GetSteamRemoteStorage(), hContent, out pnBytesDownloaded, out pnBytesExpected); 204 } 205 206 /// <summary> 207 /// <para> Gets metadata for a file after it has been downloaded. This is the same metadata given in the RemoteStorageDownloadUGCResult_t call result</para> 208 /// </summary> 209 public static bool GetUGCDetails(UGCHandle_t hContent, out AppId_t pnAppID, out string ppchName, out int pnFileSizeInBytes, out CSteamID pSteamIDOwner) { 210 InteropHelp.TestIfAvailableClient(); 211 IntPtr ppchName2; 212 bool ret = NativeMethods.ISteamRemoteStorage_GetUGCDetails(CSteamAPIContext.GetSteamRemoteStorage(), hContent, out pnAppID, out ppchName2, out pnFileSizeInBytes, out pSteamIDOwner); 213 ppchName = ret ? InteropHelp.PtrToStringUTF8(ppchName2) : null; 214 return ret; 215 } 216 217 /// <summary> 218 /// <para> After download, gets the content of the file.</para> 219 /// <para> 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.</para> 220 /// <para> Larger files can be read in chunks to reduce memory usage (since both sides of the IPC client and the game itself must allocate</para> 221 /// <para> enough memory for each chunk). Once the last byte is read, the file is implicitly closed and further calls to UGCRead will fail</para> 222 /// <para> unless UGCDownload is called again.</para> 223 /// <para> For especially large files (anything over 100MB) it is a requirement that the file is read in chunks.</para> 224 /// </summary> 225 public static int UGCRead(UGCHandle_t hContent, byte[] pvData, int cubDataToRead, uint cOffset, EUGCReadAction eAction) { 226 InteropHelp.TestIfAvailableClient(); 227 return NativeMethods.ISteamRemoteStorage_UGCRead(CSteamAPIContext.GetSteamRemoteStorage(), hContent, pvData, cubDataToRead, cOffset, eAction); 228 } 229 230 /// <summary> 231 /// <para> Functions to iterate through UGC that has finished downloading but has not yet been read via UGCRead()</para> 232 /// </summary> 233 public static int GetCachedUGCCount() { 234 InteropHelp.TestIfAvailableClient(); 235 return NativeMethods.ISteamRemoteStorage_GetCachedUGCCount(CSteamAPIContext.GetSteamRemoteStorage()); 236 } 237 238 public static UGCHandle_t GetCachedUGCHandle(int iCachedContent) { 239 InteropHelp.TestIfAvailableClient(); 240 return (UGCHandle_t)NativeMethods.ISteamRemoteStorage_GetCachedUGCHandle(CSteamAPIContext.GetSteamRemoteStorage(), iCachedContent); 241 } 242 #if _PS3 || _SERVER 243 /// <summary> 244 /// <para> The following functions are only necessary on the Playstation 3. On PC & Mac, the Steam client will handle these operations for you</para> 245 /// <para> On Playstation 3, the game controls which files are stored in the cloud, via FilePersist, FileFetch, and FileForget.</para> 246 /// <para> Connect to Steam and get a list of files in the Cloud - results in a RemoteStorageAppSyncStatusCheck_t callback</para> 247 /// </summary> 248 public static void GetFileListFromServer() { 249 InteropHelp.TestIfAvailableClient(); 250 NativeMethods.ISteamRemoteStorage_GetFileListFromServer(CSteamAPIContext.GetSteamRemoteStorage()); 251 } 252 253 /// <summary> 254 /// <para> Indicate this file should be downloaded in the next sync</para> 255 /// </summary> 256 public static bool FileFetch(string pchFile) { 257 InteropHelp.TestIfAvailableClient(); 258 using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) { 259 return NativeMethods.ISteamRemoteStorage_FileFetch(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2); 260 } 261 } 262 263 /// <summary> 264 /// <para> Indicate this file should be persisted in the next sync</para> 265 /// </summary> 266 public static bool FilePersist(string pchFile) { 267 InteropHelp.TestIfAvailableClient(); 268 using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) { 269 return NativeMethods.ISteamRemoteStorage_FilePersist(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2); 270 } 271 } 272 273 /// <summary> 274 /// <para> Pull any requested files down from the Cloud - results in a RemoteStorageAppSyncedClient_t callback</para> 275 /// </summary> 276 public static bool SynchronizeToClient() { 277 InteropHelp.TestIfAvailableClient(); 278 return NativeMethods.ISteamRemoteStorage_SynchronizeToClient(CSteamAPIContext.GetSteamRemoteStorage()); 279 } 280 281 /// <summary> 282 /// <para> Upload any requested files to the Cloud - results in a RemoteStorageAppSyncedServer_t callback</para> 283 /// </summary> 284 public static bool SynchronizeToServer() { 285 InteropHelp.TestIfAvailableClient(); 286 return NativeMethods.ISteamRemoteStorage_SynchronizeToServer(CSteamAPIContext.GetSteamRemoteStorage()); 287 } 288 289 /// <summary> 290 /// <para> Reset any fetch/persist/etc requests</para> 291 /// </summary> 292 public static bool ResetFileRequestState() { 293 InteropHelp.TestIfAvailableClient(); 294 return NativeMethods.ISteamRemoteStorage_ResetFileRequestState(CSteamAPIContext.GetSteamRemoteStorage()); 295 } 296 #endif 297 /// <summary> 298 /// <para> publishing UGC</para> 299 /// </summary> 300 public static SteamAPICall_t PublishWorkshopFile(string pchFile, string pchPreviewFile, AppId_t nConsumerAppId, string pchTitle, string pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, System.Collections.Generic.IList<string> pTags, EWorkshopFileType eWorkshopFileType) { 301 InteropHelp.TestIfAvailableClient(); 302 using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) 303 using (var pchPreviewFile2 = new InteropHelp.UTF8StringHandle(pchPreviewFile)) 304 using (var pchTitle2 = new InteropHelp.UTF8StringHandle(pchTitle)) 305 using (var pchDescription2 = new InteropHelp.UTF8StringHandle(pchDescription)) { 306 return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_PublishWorkshopFile(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2, pchPreviewFile2, nConsumerAppId, pchTitle2, pchDescription2, eVisibility, new InteropHelp.SteamParamStringArray(pTags), eWorkshopFileType); 307 } 308 } 309 310 public static PublishedFileUpdateHandle_t CreatePublishedFileUpdateRequest(PublishedFileId_t unPublishedFileId) { 311 InteropHelp.TestIfAvailableClient(); 312 return (PublishedFileUpdateHandle_t)NativeMethods.ISteamRemoteStorage_CreatePublishedFileUpdateRequest(CSteamAPIContext.GetSteamRemoteStorage(), unPublishedFileId); 313 } 314 315 public static bool UpdatePublishedFileFile(PublishedFileUpdateHandle_t updateHandle, string pchFile) { 316 InteropHelp.TestIfAvailableClient(); 317 using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) { 318 return NativeMethods.ISteamRemoteStorage_UpdatePublishedFileFile(CSteamAPIContext.GetSteamRemoteStorage(), updateHandle, pchFile2); 319 } 320 } 321 322 public static bool UpdatePublishedFilePreviewFile(PublishedFileUpdateHandle_t updateHandle, string pchPreviewFile) { 323 InteropHelp.TestIfAvailableClient(); 324 using (var pchPreviewFile2 = new InteropHelp.UTF8StringHandle(pchPreviewFile)) { 325 return NativeMethods.ISteamRemoteStorage_UpdatePublishedFilePreviewFile(CSteamAPIContext.GetSteamRemoteStorage(), updateHandle, pchPreviewFile2); 326 } 327 } 328 329 public static bool UpdatePublishedFileTitle(PublishedFileUpdateHandle_t updateHandle, string pchTitle) { 330 InteropHelp.TestIfAvailableClient(); 331 using (var pchTitle2 = new InteropHelp.UTF8StringHandle(pchTitle)) { 332 return NativeMethods.ISteamRemoteStorage_UpdatePublishedFileTitle(CSteamAPIContext.GetSteamRemoteStorage(), updateHandle, pchTitle2); 333 } 334 } 335 336 public static bool UpdatePublishedFileDescription(PublishedFileUpdateHandle_t updateHandle, string pchDescription) { 337 InteropHelp.TestIfAvailableClient(); 338 using (var pchDescription2 = new InteropHelp.UTF8StringHandle(pchDescription)) { 339 return NativeMethods.ISteamRemoteStorage_UpdatePublishedFileDescription(CSteamAPIContext.GetSteamRemoteStorage(), updateHandle, pchDescription2); 340 } 341 } 342 343 public static bool UpdatePublishedFileVisibility(PublishedFileUpdateHandle_t updateHandle, ERemoteStoragePublishedFileVisibility eVisibility) { 344 InteropHelp.TestIfAvailableClient(); 345 return NativeMethods.ISteamRemoteStorage_UpdatePublishedFileVisibility(CSteamAPIContext.GetSteamRemoteStorage(), updateHandle, eVisibility); 346 } 347 348 public static bool UpdatePublishedFileTags(PublishedFileUpdateHandle_t updateHandle, System.Collections.Generic.IList<string> pTags) { 349 InteropHelp.TestIfAvailableClient(); 350 return NativeMethods.ISteamRemoteStorage_UpdatePublishedFileTags(CSteamAPIContext.GetSteamRemoteStorage(), updateHandle, new InteropHelp.SteamParamStringArray(pTags)); 351 } 352 353 public static SteamAPICall_t CommitPublishedFileUpdate(PublishedFileUpdateHandle_t updateHandle) { 354 InteropHelp.TestIfAvailableClient(); 355 return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_CommitPublishedFileUpdate(CSteamAPIContext.GetSteamRemoteStorage(), updateHandle); 356 } 357 358 /// <summary> 359 /// <para> Gets published file details for the given publishedfileid. If unMaxSecondsOld is greater than 0,</para> 360 /// <para> cached data may be returned, depending on how long ago it was cached. A value of 0 will force a refresh.</para> 361 /// <para> A value of k_WorkshopForceLoadPublishedFileDetailsFromCache will use cached data if it exists, no matter how old it is.</para> 362 /// </summary> 363 public static SteamAPICall_t GetPublishedFileDetails(PublishedFileId_t unPublishedFileId, uint unMaxSecondsOld) { 364 InteropHelp.TestIfAvailableClient(); 365 return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_GetPublishedFileDetails(CSteamAPIContext.GetSteamRemoteStorage(), unPublishedFileId, unMaxSecondsOld); 366 } 367 368 public static SteamAPICall_t DeletePublishedFile(PublishedFileId_t unPublishedFileId) { 369 InteropHelp.TestIfAvailableClient(); 370 return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_DeletePublishedFile(CSteamAPIContext.GetSteamRemoteStorage(), unPublishedFileId); 371 } 372 373 /// <summary> 374 /// <para> enumerate the files that the current user published with this app</para> 375 /// </summary> 376 public static SteamAPICall_t EnumerateUserPublishedFiles(uint unStartIndex) { 377 InteropHelp.TestIfAvailableClient(); 378 return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_EnumerateUserPublishedFiles(CSteamAPIContext.GetSteamRemoteStorage(), unStartIndex); 379 } 380 381 public static SteamAPICall_t SubscribePublishedFile(PublishedFileId_t unPublishedFileId) { 382 InteropHelp.TestIfAvailableClient(); 383 return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_SubscribePublishedFile(CSteamAPIContext.GetSteamRemoteStorage(), unPublishedFileId); 384 } 385 386 public static SteamAPICall_t EnumerateUserSubscribedFiles(uint unStartIndex) { 387 InteropHelp.TestIfAvailableClient(); 388 return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_EnumerateUserSubscribedFiles(CSteamAPIContext.GetSteamRemoteStorage(), unStartIndex); 389 } 390 391 public static SteamAPICall_t UnsubscribePublishedFile(PublishedFileId_t unPublishedFileId) { 392 InteropHelp.TestIfAvailableClient(); 393 return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_UnsubscribePublishedFile(CSteamAPIContext.GetSteamRemoteStorage(), unPublishedFileId); 394 } 395 396 public static bool UpdatePublishedFileSetChangeDescription(PublishedFileUpdateHandle_t updateHandle, string pchChangeDescription) { 397 InteropHelp.TestIfAvailableClient(); 398 using (var pchChangeDescription2 = new InteropHelp.UTF8StringHandle(pchChangeDescription)) { 399 return NativeMethods.ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription(CSteamAPIContext.GetSteamRemoteStorage(), updateHandle, pchChangeDescription2); 400 } 401 } 402 403 public static SteamAPICall_t GetPublishedItemVoteDetails(PublishedFileId_t unPublishedFileId) { 404 InteropHelp.TestIfAvailableClient(); 405 return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_GetPublishedItemVoteDetails(CSteamAPIContext.GetSteamRemoteStorage(), unPublishedFileId); 406 } 407 408 public static SteamAPICall_t UpdateUserPublishedItemVote(PublishedFileId_t unPublishedFileId, bool bVoteUp) { 409 InteropHelp.TestIfAvailableClient(); 410 return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_UpdateUserPublishedItemVote(CSteamAPIContext.GetSteamRemoteStorage(), unPublishedFileId, bVoteUp); 411 } 412 413 public static SteamAPICall_t GetUserPublishedItemVoteDetails(PublishedFileId_t unPublishedFileId) { 414 InteropHelp.TestIfAvailableClient(); 415 return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_GetUserPublishedItemVoteDetails(CSteamAPIContext.GetSteamRemoteStorage(), unPublishedFileId); 416 } 417 418 public static SteamAPICall_t EnumerateUserSharedWorkshopFiles(CSteamID steamId, uint unStartIndex, System.Collections.Generic.IList<string> pRequiredTags, System.Collections.Generic.IList<string> pExcludedTags) { 419 InteropHelp.TestIfAvailableClient(); 420 return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles(CSteamAPIContext.GetSteamRemoteStorage(), steamId, unStartIndex, new InteropHelp.SteamParamStringArray(pRequiredTags), new InteropHelp.SteamParamStringArray(pExcludedTags)); 421 } 422 423 public static SteamAPICall_t PublishVideo(EWorkshopVideoProvider eVideoProvider, string pchVideoAccount, string pchVideoIdentifier, string pchPreviewFile, AppId_t nConsumerAppId, string pchTitle, string pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, System.Collections.Generic.IList<string> pTags) { 424 InteropHelp.TestIfAvailableClient(); 425 using (var pchVideoAccount2 = new InteropHelp.UTF8StringHandle(pchVideoAccount)) 426 using (var pchVideoIdentifier2 = new InteropHelp.UTF8StringHandle(pchVideoIdentifier)) 427 using (var pchPreviewFile2 = new InteropHelp.UTF8StringHandle(pchPreviewFile)) 428 using (var pchTitle2 = new InteropHelp.UTF8StringHandle(pchTitle)) 429 using (var pchDescription2 = new InteropHelp.UTF8StringHandle(pchDescription)) { 430 return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_PublishVideo(CSteamAPIContext.GetSteamRemoteStorage(), eVideoProvider, pchVideoAccount2, pchVideoIdentifier2, pchPreviewFile2, nConsumerAppId, pchTitle2, pchDescription2, eVisibility, new InteropHelp.SteamParamStringArray(pTags)); 431 } 432 } 433 434 public static SteamAPICall_t SetUserPublishedFileAction(PublishedFileId_t unPublishedFileId, EWorkshopFileAction eAction) { 435 InteropHelp.TestIfAvailableClient(); 436 return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_SetUserPublishedFileAction(CSteamAPIContext.GetSteamRemoteStorage(), unPublishedFileId, eAction); 437 } 438 439 public static SteamAPICall_t EnumeratePublishedFilesByUserAction(EWorkshopFileAction eAction, uint unStartIndex) { 440 InteropHelp.TestIfAvailableClient(); 441 return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_EnumeratePublishedFilesByUserAction(CSteamAPIContext.GetSteamRemoteStorage(), eAction, unStartIndex); 442 } 443 444 /// <summary> 445 /// <para> this method enumerates the public view of workshop files</para> 446 /// </summary> 447 public static SteamAPICall_t EnumeratePublishedWorkshopFiles(EWorkshopEnumerationType eEnumerationType, uint unStartIndex, uint unCount, uint unDays, System.Collections.Generic.IList<string> pTags, System.Collections.Generic.IList<string> pUserTags) { 448 InteropHelp.TestIfAvailableClient(); 449 return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_EnumeratePublishedWorkshopFiles(CSteamAPIContext.GetSteamRemoteStorage(), eEnumerationType, unStartIndex, unCount, unDays, new InteropHelp.SteamParamStringArray(pTags), new InteropHelp.SteamParamStringArray(pUserTags)); 450 } 451 452 public static SteamAPICall_t UGCDownloadToLocation(UGCHandle_t hContent, string pchLocation, uint unPriority) { 453 InteropHelp.TestIfAvailableClient(); 454 using (var pchLocation2 = new InteropHelp.UTF8StringHandle(pchLocation)) { 455 return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_UGCDownloadToLocation(CSteamAPIContext.GetSteamRemoteStorage(), hContent, pchLocation2, unPriority); 456 } 457 } 458 } 459 } 460 461 #endif // !DISABLESTEAMWORKS