isteamremotestorage.cs 24 KB

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