From a9cbc1740ab8f60980cdb0128af0b32314d3fd3d Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Wed, 26 Oct 2016 17:27:17 +0100 Subject: [PATCH] Fixed tags not setting --- .../Interfaces/Workshop.Editor.cs | 4 +- .../SteamNative.Platform.Interface.cs | 12 +- .../SteamNative.Platform.Linux32.cs | 58 +++++--- .../SteamNative.Platform.Linux64.cs | 58 +++++--- .../SteamNative/SteamNative.Platform.Mac.cs | 58 +++++--- .../SteamNative/SteamNative.Platform.Win32.cs | 36 ++--- .../SteamNative/SteamNative.Platform.Win64.cs | 36 ++--- .../SteamNative.SteamRemoteStorage.cs | 125 ++++++++++++++++-- .../SteamNative/SteamNative.SteamUGC.cs | 25 +++- .../SteamNative/SteamNative.Structs.cs | 6 +- Generator/Argument.cs | 2 +- Generator/CodeWriter.Struct.cs | 1 + Generator/CodeWriter/Class.cs | 47 ++++++- 13 files changed, 349 insertions(+), 119 deletions(-) diff --git a/Facepunch.Steamworks/Interfaces/Workshop.Editor.cs b/Facepunch.Steamworks/Interfaces/Workshop.Editor.cs index 37499be..3ead924 100644 --- a/Facepunch.Steamworks/Interfaces/Workshop.Editor.cs +++ b/Facepunch.Steamworks/Interfaces/Workshop.Editor.cs @@ -143,8 +143,8 @@ private void PublishChanges() if ( Folder != null ) workshop.ugc.SetItemContent( UpdateHandle, Folder ); - // if ( Tags != null && Tags.Count > 0 ) - // workshop.ugc.SetItemTags( UpdateId, Tags.ToArray() ); + if ( Tags != null && Tags.Count > 0 ) + workshop.ugc.SetItemTags( UpdateHandle, Tags.ToArray() ); if ( Visibility.HasValue ) workshop.ugc.SetItemVisibility( UpdateHandle, (SteamNative.RemoteStoragePublishedFileVisibility)(uint)Visibility.Value ); diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Interface.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Interface.cs index bd46e8b..6a5cb4e 100644 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Interface.cs +++ b/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Interface.cs @@ -449,14 +449,14 @@ public interface Interface : IDisposable int /*int32*/ ISteamRemoteStorage_UGCRead( ulong hContent, IntPtr /*void **/ pvData, int /*int32*/ cubDataToRead, uint /*uint32*/ cOffset, UGCReadAction /*EUGCReadAction*/ eAction ); int /*int32*/ ISteamRemoteStorage_GetCachedUGCCount(); UGCHandle_t /*(UGCHandle_t)*/ ISteamRemoteStorage_GetCachedUGCHandle( int /*int32*/ iCachedContent ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishWorkshopFile( string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, IntPtr /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ); + SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishWorkshopFile( string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ); PublishedFileUpdateHandle_t /*(PublishedFileUpdateHandle_t)*/ ISteamRemoteStorage_CreatePublishedFileUpdateRequest( ulong unPublishedFileId ); bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileFile( ulong updateHandle, string /*const char **/ pchFile ); bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFilePreviewFile( ulong updateHandle, string /*const char **/ pchPreviewFile ); bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileTitle( ulong updateHandle, string /*const char **/ pchTitle ); bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileDescription( ulong updateHandle, string /*const char **/ pchDescription ); bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileVisibility( ulong updateHandle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); - bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileTags( ulong updateHandle, IntPtr /*struct SteamParamStringArray_t **/ pTags ); + bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileTags( ulong updateHandle, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ); SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_CommitPublishedFileUpdate( ulong updateHandle ); SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_GetPublishedFileDetails( ulong unPublishedFileId, uint /*uint32*/ unMaxSecondsOld ); SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_DeletePublishedFile( ulong unPublishedFileId ); @@ -468,11 +468,11 @@ public interface Interface : IDisposable SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_GetPublishedItemVoteDetails( ulong unPublishedFileId ); SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UpdateUserPublishedItemVote( ulong unPublishedFileId, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ); SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_GetUserPublishedItemVoteDetails( ulong unPublishedFileId ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles( ulong steamId, uint /*uint32*/ unStartIndex, IntPtr /*struct SteamParamStringArray_t **/ pRequiredTags, IntPtr /*struct SteamParamStringArray_t **/ pExcludedTags ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishVideo( WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, IntPtr /*struct SteamParamStringArray_t **/ pTags ); + SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles( ulong steamId, uint /*uint32*/ unStartIndex, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pRequiredTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pExcludedTags ); + SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishVideo( WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ); SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_SetUserPublishedFileAction( ulong unPublishedFileId, WorkshopFileAction /*EWorkshopFileAction*/ eAction ); SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumeratePublishedFilesByUserAction( WorkshopFileAction /*EWorkshopFileAction*/ eAction, uint /*uint32*/ unStartIndex ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumeratePublishedWorkshopFiles( WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, IntPtr /*struct SteamParamStringArray_t **/ pTags, IntPtr /*struct SteamParamStringArray_t **/ pUserTags ); + SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumeratePublishedWorkshopFiles( WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pUserTags ); SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UGCDownloadToLocation( ulong hContent, string /*const char **/ pchLocation, uint /*uint32*/ unPriority ); ScreenshotHandle /*(ScreenshotHandle)*/ ISteamScreenshots_WriteScreenshot( IntPtr /*void **/ pubRGB, uint /*uint32*/ cubRGB, int /*int*/ nWidth, int /*int*/ nHeight ); ScreenshotHandle /*(ScreenshotHandle)*/ ISteamScreenshots_AddScreenshotToLibrary( string /*const char **/ pchFilename, string /*const char **/ pchThumbnailFilename, int /*int*/ nWidth, int /*int*/ nHeight ); @@ -521,7 +521,7 @@ public interface Interface : IDisposable bool /*bool*/ ISteamUGC_SetItemUpdateLanguage( ulong handle, string /*const char **/ pchLanguage ); bool /*bool*/ ISteamUGC_SetItemMetadata( ulong handle, string /*const char **/ pchMetaData ); bool /*bool*/ ISteamUGC_SetItemVisibility( ulong handle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); - bool /*bool*/ ISteamUGC_SetItemTags( ulong updateHandle, IntPtr /*const struct SteamParamStringArray_t **/ pTags ); + bool /*bool*/ ISteamUGC_SetItemTags( ulong updateHandle, ref SteamParamStringArray_t /*const struct SteamParamStringArray_t **/ pTags ); bool /*bool*/ ISteamUGC_SetItemContent( ulong handle, string /*const char **/ pszContentFolder ); bool /*bool*/ ISteamUGC_SetItemPreview( ulong handle, string /*const char **/ pszPreviewFile ); bool /*bool*/ ISteamUGC_RemoveItemKeyValueTags( ulong handle, string /*const char **/ pchKey ); diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Linux32.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Linux32.cs index d7e3a2b..d47f428 100644 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Linux32.cs +++ b/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Linux32.cs @@ -1492,11 +1492,14 @@ public virtual IntPtr ISteamRemoteStorage_GetFileNameAndSize( int /*int*/ iFile, return Native.ISteamRemoteStorage.GetCachedUGCHandle(_ptr, iCachedContent); } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishWorkshopFile( string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, IntPtr /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ) + public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishWorkshopFile( string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - return Native.ISteamRemoteStorage.PublishWorkshopFile(_ptr, pchFile, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, pTags, eWorkshopFileType); + var pTags_ps = new SteamParamStringArray_t.PackSmall(); + var ret = Native.ISteamRemoteStorage.PublishWorkshopFile(_ptr, pchFile, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, ref pTags_ps, eWorkshopFileType); + pTags = pTags_ps; + return ret; } public virtual PublishedFileUpdateHandle_t /*(PublishedFileUpdateHandle_t)*/ ISteamRemoteStorage_CreatePublishedFileUpdateRequest( ulong unPublishedFileId ) { @@ -1534,11 +1537,14 @@ public virtual IntPtr ISteamRemoteStorage_GetFileNameAndSize( int /*int*/ iFile, return Native.ISteamRemoteStorage.UpdatePublishedFileVisibility(_ptr, updateHandle, eVisibility); } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileTags( ulong updateHandle, IntPtr /*struct SteamParamStringArray_t **/ pTags ) + public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileTags( ulong updateHandle, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - return Native.ISteamRemoteStorage.UpdatePublishedFileTags(_ptr, updateHandle, pTags); + var pTags_ps = new SteamParamStringArray_t.PackSmall(); + var ret = Native.ISteamRemoteStorage.UpdatePublishedFileTags(_ptr, updateHandle, ref pTags_ps); + pTags = pTags_ps; + return ret; } public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_CommitPublishedFileUpdate( ulong updateHandle ) { @@ -1606,17 +1612,25 @@ public virtual IntPtr ISteamRemoteStorage_GetFileNameAndSize( int /*int*/ iFile, return Native.ISteamRemoteStorage.GetUserPublishedItemVoteDetails(_ptr, unPublishedFileId); } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles( ulong steamId, uint /*uint32*/ unStartIndex, IntPtr /*struct SteamParamStringArray_t **/ pRequiredTags, IntPtr /*struct SteamParamStringArray_t **/ pExcludedTags ) + public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles( ulong steamId, uint /*uint32*/ unStartIndex, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pRequiredTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pExcludedTags ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - return Native.ISteamRemoteStorage.EnumerateUserSharedWorkshopFiles(_ptr, steamId, unStartIndex, pRequiredTags, pExcludedTags); + var pRequiredTags_ps = new SteamParamStringArray_t.PackSmall(); + var pExcludedTags_ps = new SteamParamStringArray_t.PackSmall(); + var ret = Native.ISteamRemoteStorage.EnumerateUserSharedWorkshopFiles(_ptr, steamId, unStartIndex, ref pRequiredTags_ps, ref pExcludedTags_ps); + pRequiredTags = pRequiredTags_ps; + pExcludedTags = pExcludedTags_ps; + return ret; } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishVideo( WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, IntPtr /*struct SteamParamStringArray_t **/ pTags ) + public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishVideo( WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - return Native.ISteamRemoteStorage.PublishVideo(_ptr, eVideoProvider, pchVideoAccount, pchVideoIdentifier, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, pTags); + var pTags_ps = new SteamParamStringArray_t.PackSmall(); + var ret = Native.ISteamRemoteStorage.PublishVideo(_ptr, eVideoProvider, pchVideoAccount, pchVideoIdentifier, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, ref pTags_ps); + pTags = pTags_ps; + return ret; } public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_SetUserPublishedFileAction( ulong unPublishedFileId, WorkshopFileAction /*EWorkshopFileAction*/ eAction ) { @@ -1630,11 +1644,16 @@ public virtual IntPtr ISteamRemoteStorage_GetFileNameAndSize( int /*int*/ iFile, return Native.ISteamRemoteStorage.EnumeratePublishedFilesByUserAction(_ptr, eAction, unStartIndex); } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumeratePublishedWorkshopFiles( WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, IntPtr /*struct SteamParamStringArray_t **/ pTags, IntPtr /*struct SteamParamStringArray_t **/ pUserTags ) + public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumeratePublishedWorkshopFiles( WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pUserTags ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - return Native.ISteamRemoteStorage.EnumeratePublishedWorkshopFiles(_ptr, eEnumerationType, unStartIndex, unCount, unDays, pTags, pUserTags); + var pTags_ps = new SteamParamStringArray_t.PackSmall(); + var pUserTags_ps = new SteamParamStringArray_t.PackSmall(); + var ret = Native.ISteamRemoteStorage.EnumeratePublishedWorkshopFiles(_ptr, eEnumerationType, unStartIndex, unCount, unDays, ref pTags_ps, ref pUserTags_ps); + pTags = pTags_ps; + pUserTags = pUserTags_ps; + return ret; } public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UGCDownloadToLocation( ulong hContent, string /*const char **/ pchLocation, uint /*uint32*/ unPriority ) { @@ -3047,11 +3066,14 @@ public virtual IntPtr ISteamApps_GetLaunchQueryParam( string /*const char **/ pc return Native.ISteamUGC.SetItemVisibility(_ptr, handle, eVisibility); } - public virtual bool /*bool*/ ISteamUGC_SetItemTags( ulong updateHandle, IntPtr /*const struct SteamParamStringArray_t **/ pTags ) + public virtual bool /*bool*/ ISteamUGC_SetItemTags( ulong updateHandle, ref SteamParamStringArray_t /*const struct SteamParamStringArray_t **/ pTags ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - return Native.ISteamUGC.SetItemTags(_ptr, updateHandle, pTags); + var pTags_ps = new SteamParamStringArray_t.PackSmall(); + var ret = Native.ISteamUGC.SetItemTags(_ptr, updateHandle, ref pTags_ps); + pTags = pTags_ps; + return ret; } public virtual bool /*bool*/ ISteamUGC_SetItemContent( ulong handle, string /*const char **/ pszContentFolder ) { @@ -4500,7 +4522,7 @@ internal static unsafe class ISteamRemoteStorage [DllImportAttribute( "libsteam_api.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle" )] internal static extern UGCHandle_t /*(UGCHandle_t)*/ GetCachedUGCHandle( IntPtr ISteamRemoteStorage, int /*int32*/ iCachedContent ); [DllImportAttribute( "libsteam_api.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_PublishWorkshopFile" )] - internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ PublishWorkshopFile( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, IntPtr /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ); + internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ PublishWorkshopFile( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ); [DllImportAttribute( "libsteam_api.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_CreatePublishedFileUpdateRequest" )] internal static extern PublishedFileUpdateHandle_t /*(PublishedFileUpdateHandle_t)*/ CreatePublishedFileUpdateRequest( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); [DllImportAttribute( "libsteam_api.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileFile" )] @@ -4514,7 +4536,7 @@ internal static unsafe class ISteamRemoteStorage [DllImportAttribute( "libsteam_api.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileVisibility" )] internal static extern bool /*bool*/ UpdatePublishedFileVisibility( IntPtr ISteamRemoteStorage, ulong updateHandle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); [DllImportAttribute( "libsteam_api.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTags" )] - internal static extern bool /*bool*/ UpdatePublishedFileTags( IntPtr ISteamRemoteStorage, ulong updateHandle, IntPtr /*struct SteamParamStringArray_t **/ pTags ); + internal static extern bool /*bool*/ UpdatePublishedFileTags( IntPtr ISteamRemoteStorage, ulong updateHandle, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pTags ); [DllImportAttribute( "libsteam_api.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_CommitPublishedFileUpdate" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ CommitPublishedFileUpdate( IntPtr ISteamRemoteStorage, ulong updateHandle ); [DllImportAttribute( "libsteam_api.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_GetPublishedFileDetails" )] @@ -4538,15 +4560,15 @@ internal static unsafe class ISteamRemoteStorage [DllImportAttribute( "libsteam_api.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_GetUserPublishedItemVoteDetails" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ GetUserPublishedItemVoteDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); [DllImportAttribute( "libsteam_api.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles" )] - internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ EnumerateUserSharedWorkshopFiles( IntPtr ISteamRemoteStorage, ulong steamId, uint /*uint32*/ unStartIndex, IntPtr /*struct SteamParamStringArray_t **/ pRequiredTags, IntPtr /*struct SteamParamStringArray_t **/ pExcludedTags ); + internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ EnumerateUserSharedWorkshopFiles( IntPtr ISteamRemoteStorage, ulong steamId, uint /*uint32*/ unStartIndex, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pRequiredTags, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pExcludedTags ); [DllImportAttribute( "libsteam_api.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_PublishVideo" )] - internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ PublishVideo( IntPtr ISteamRemoteStorage, WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, IntPtr /*struct SteamParamStringArray_t **/ pTags ); + internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ PublishVideo( IntPtr ISteamRemoteStorage, WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pTags ); [DllImportAttribute( "libsteam_api.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_SetUserPublishedFileAction" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SetUserPublishedFileAction( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, WorkshopFileAction /*EWorkshopFileAction*/ eAction ); [DllImportAttribute( "libsteam_api.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_EnumeratePublishedFilesByUserAction" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ EnumeratePublishedFilesByUserAction( IntPtr ISteamRemoteStorage, WorkshopFileAction /*EWorkshopFileAction*/ eAction, uint /*uint32*/ unStartIndex ); [DllImportAttribute( "libsteam_api.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_EnumeratePublishedWorkshopFiles" )] - internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ EnumeratePublishedWorkshopFiles( IntPtr ISteamRemoteStorage, WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, IntPtr /*struct SteamParamStringArray_t **/ pTags, IntPtr /*struct SteamParamStringArray_t **/ pUserTags ); + internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ EnumeratePublishedWorkshopFiles( IntPtr ISteamRemoteStorage, WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pTags, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pUserTags ); [DllImportAttribute( "libsteam_api.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ UGCDownloadToLocation( IntPtr ISteamRemoteStorage, ulong hContent, string /*const char **/ pchLocation, uint /*uint32*/ unPriority ); } @@ -5052,7 +5074,7 @@ internal static unsafe class ISteamUGC [DllImportAttribute( "libsteam_api.so", EntryPoint = "SteamAPI_ISteamUGC_SetItemVisibility" )] internal static extern bool /*bool*/ SetItemVisibility( IntPtr ISteamUGC, ulong handle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); [DllImportAttribute( "libsteam_api.so", EntryPoint = "SteamAPI_ISteamUGC_SetItemTags" )] - internal static extern bool /*bool*/ SetItemTags( IntPtr ISteamUGC, ulong updateHandle, IntPtr /*const struct SteamParamStringArray_t **/ pTags ); + internal static extern bool /*bool*/ SetItemTags( IntPtr ISteamUGC, ulong updateHandle, ref SteamParamStringArray_t.PackSmall /*const struct SteamParamStringArray_t **/ pTags ); [DllImportAttribute( "libsteam_api.so", EntryPoint = "SteamAPI_ISteamUGC_SetItemContent" )] internal static extern bool /*bool*/ SetItemContent( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszContentFolder ); [DllImportAttribute( "libsteam_api.so", EntryPoint = "SteamAPI_ISteamUGC_SetItemPreview" )] diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Linux64.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Linux64.cs index 77b991e..652d9af 100644 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Linux64.cs +++ b/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Linux64.cs @@ -1492,11 +1492,14 @@ public virtual IntPtr ISteamRemoteStorage_GetFileNameAndSize( int /*int*/ iFile, return Native.ISteamRemoteStorage.GetCachedUGCHandle(_ptr, iCachedContent); } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishWorkshopFile( string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, IntPtr /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ) + public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishWorkshopFile( string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - return Native.ISteamRemoteStorage.PublishWorkshopFile(_ptr, pchFile, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, pTags, eWorkshopFileType); + var pTags_ps = new SteamParamStringArray_t.PackSmall(); + var ret = Native.ISteamRemoteStorage.PublishWorkshopFile(_ptr, pchFile, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, ref pTags_ps, eWorkshopFileType); + pTags = pTags_ps; + return ret; } public virtual PublishedFileUpdateHandle_t /*(PublishedFileUpdateHandle_t)*/ ISteamRemoteStorage_CreatePublishedFileUpdateRequest( ulong unPublishedFileId ) { @@ -1534,11 +1537,14 @@ public virtual IntPtr ISteamRemoteStorage_GetFileNameAndSize( int /*int*/ iFile, return Native.ISteamRemoteStorage.UpdatePublishedFileVisibility(_ptr, updateHandle, eVisibility); } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileTags( ulong updateHandle, IntPtr /*struct SteamParamStringArray_t **/ pTags ) + public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileTags( ulong updateHandle, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - return Native.ISteamRemoteStorage.UpdatePublishedFileTags(_ptr, updateHandle, pTags); + var pTags_ps = new SteamParamStringArray_t.PackSmall(); + var ret = Native.ISteamRemoteStorage.UpdatePublishedFileTags(_ptr, updateHandle, ref pTags_ps); + pTags = pTags_ps; + return ret; } public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_CommitPublishedFileUpdate( ulong updateHandle ) { @@ -1606,17 +1612,25 @@ public virtual IntPtr ISteamRemoteStorage_GetFileNameAndSize( int /*int*/ iFile, return Native.ISteamRemoteStorage.GetUserPublishedItemVoteDetails(_ptr, unPublishedFileId); } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles( ulong steamId, uint /*uint32*/ unStartIndex, IntPtr /*struct SteamParamStringArray_t **/ pRequiredTags, IntPtr /*struct SteamParamStringArray_t **/ pExcludedTags ) + public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles( ulong steamId, uint /*uint32*/ unStartIndex, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pRequiredTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pExcludedTags ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - return Native.ISteamRemoteStorage.EnumerateUserSharedWorkshopFiles(_ptr, steamId, unStartIndex, pRequiredTags, pExcludedTags); + var pRequiredTags_ps = new SteamParamStringArray_t.PackSmall(); + var pExcludedTags_ps = new SteamParamStringArray_t.PackSmall(); + var ret = Native.ISteamRemoteStorage.EnumerateUserSharedWorkshopFiles(_ptr, steamId, unStartIndex, ref pRequiredTags_ps, ref pExcludedTags_ps); + pRequiredTags = pRequiredTags_ps; + pExcludedTags = pExcludedTags_ps; + return ret; } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishVideo( WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, IntPtr /*struct SteamParamStringArray_t **/ pTags ) + public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishVideo( WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - return Native.ISteamRemoteStorage.PublishVideo(_ptr, eVideoProvider, pchVideoAccount, pchVideoIdentifier, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, pTags); + var pTags_ps = new SteamParamStringArray_t.PackSmall(); + var ret = Native.ISteamRemoteStorage.PublishVideo(_ptr, eVideoProvider, pchVideoAccount, pchVideoIdentifier, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, ref pTags_ps); + pTags = pTags_ps; + return ret; } public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_SetUserPublishedFileAction( ulong unPublishedFileId, WorkshopFileAction /*EWorkshopFileAction*/ eAction ) { @@ -1630,11 +1644,16 @@ public virtual IntPtr ISteamRemoteStorage_GetFileNameAndSize( int /*int*/ iFile, return Native.ISteamRemoteStorage.EnumeratePublishedFilesByUserAction(_ptr, eAction, unStartIndex); } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumeratePublishedWorkshopFiles( WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, IntPtr /*struct SteamParamStringArray_t **/ pTags, IntPtr /*struct SteamParamStringArray_t **/ pUserTags ) + public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumeratePublishedWorkshopFiles( WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pUserTags ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - return Native.ISteamRemoteStorage.EnumeratePublishedWorkshopFiles(_ptr, eEnumerationType, unStartIndex, unCount, unDays, pTags, pUserTags); + var pTags_ps = new SteamParamStringArray_t.PackSmall(); + var pUserTags_ps = new SteamParamStringArray_t.PackSmall(); + var ret = Native.ISteamRemoteStorage.EnumeratePublishedWorkshopFiles(_ptr, eEnumerationType, unStartIndex, unCount, unDays, ref pTags_ps, ref pUserTags_ps); + pTags = pTags_ps; + pUserTags = pUserTags_ps; + return ret; } public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UGCDownloadToLocation( ulong hContent, string /*const char **/ pchLocation, uint /*uint32*/ unPriority ) { @@ -3047,11 +3066,14 @@ public virtual IntPtr ISteamApps_GetLaunchQueryParam( string /*const char **/ pc return Native.ISteamUGC.SetItemVisibility(_ptr, handle, eVisibility); } - public virtual bool /*bool*/ ISteamUGC_SetItemTags( ulong updateHandle, IntPtr /*const struct SteamParamStringArray_t **/ pTags ) + public virtual bool /*bool*/ ISteamUGC_SetItemTags( ulong updateHandle, ref SteamParamStringArray_t /*const struct SteamParamStringArray_t **/ pTags ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - return Native.ISteamUGC.SetItemTags(_ptr, updateHandle, pTags); + var pTags_ps = new SteamParamStringArray_t.PackSmall(); + var ret = Native.ISteamUGC.SetItemTags(_ptr, updateHandle, ref pTags_ps); + pTags = pTags_ps; + return ret; } public virtual bool /*bool*/ ISteamUGC_SetItemContent( ulong handle, string /*const char **/ pszContentFolder ) { @@ -4500,7 +4522,7 @@ internal static unsafe class ISteamRemoteStorage [DllImportAttribute( "libsteam_api64.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle" )] internal static extern UGCHandle_t /*(UGCHandle_t)*/ GetCachedUGCHandle( IntPtr ISteamRemoteStorage, int /*int32*/ iCachedContent ); [DllImportAttribute( "libsteam_api64.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_PublishWorkshopFile" )] - internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ PublishWorkshopFile( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, IntPtr /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ); + internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ PublishWorkshopFile( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ); [DllImportAttribute( "libsteam_api64.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_CreatePublishedFileUpdateRequest" )] internal static extern PublishedFileUpdateHandle_t /*(PublishedFileUpdateHandle_t)*/ CreatePublishedFileUpdateRequest( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); [DllImportAttribute( "libsteam_api64.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileFile" )] @@ -4514,7 +4536,7 @@ internal static unsafe class ISteamRemoteStorage [DllImportAttribute( "libsteam_api64.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileVisibility" )] internal static extern bool /*bool*/ UpdatePublishedFileVisibility( IntPtr ISteamRemoteStorage, ulong updateHandle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); [DllImportAttribute( "libsteam_api64.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTags" )] - internal static extern bool /*bool*/ UpdatePublishedFileTags( IntPtr ISteamRemoteStorage, ulong updateHandle, IntPtr /*struct SteamParamStringArray_t **/ pTags ); + internal static extern bool /*bool*/ UpdatePublishedFileTags( IntPtr ISteamRemoteStorage, ulong updateHandle, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pTags ); [DllImportAttribute( "libsteam_api64.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_CommitPublishedFileUpdate" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ CommitPublishedFileUpdate( IntPtr ISteamRemoteStorage, ulong updateHandle ); [DllImportAttribute( "libsteam_api64.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_GetPublishedFileDetails" )] @@ -4538,15 +4560,15 @@ internal static unsafe class ISteamRemoteStorage [DllImportAttribute( "libsteam_api64.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_GetUserPublishedItemVoteDetails" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ GetUserPublishedItemVoteDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); [DllImportAttribute( "libsteam_api64.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles" )] - internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ EnumerateUserSharedWorkshopFiles( IntPtr ISteamRemoteStorage, ulong steamId, uint /*uint32*/ unStartIndex, IntPtr /*struct SteamParamStringArray_t **/ pRequiredTags, IntPtr /*struct SteamParamStringArray_t **/ pExcludedTags ); + internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ EnumerateUserSharedWorkshopFiles( IntPtr ISteamRemoteStorage, ulong steamId, uint /*uint32*/ unStartIndex, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pRequiredTags, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pExcludedTags ); [DllImportAttribute( "libsteam_api64.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_PublishVideo" )] - internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ PublishVideo( IntPtr ISteamRemoteStorage, WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, IntPtr /*struct SteamParamStringArray_t **/ pTags ); + internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ PublishVideo( IntPtr ISteamRemoteStorage, WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pTags ); [DllImportAttribute( "libsteam_api64.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_SetUserPublishedFileAction" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SetUserPublishedFileAction( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, WorkshopFileAction /*EWorkshopFileAction*/ eAction ); [DllImportAttribute( "libsteam_api64.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_EnumeratePublishedFilesByUserAction" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ EnumeratePublishedFilesByUserAction( IntPtr ISteamRemoteStorage, WorkshopFileAction /*EWorkshopFileAction*/ eAction, uint /*uint32*/ unStartIndex ); [DllImportAttribute( "libsteam_api64.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_EnumeratePublishedWorkshopFiles" )] - internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ EnumeratePublishedWorkshopFiles( IntPtr ISteamRemoteStorage, WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, IntPtr /*struct SteamParamStringArray_t **/ pTags, IntPtr /*struct SteamParamStringArray_t **/ pUserTags ); + internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ EnumeratePublishedWorkshopFiles( IntPtr ISteamRemoteStorage, WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pTags, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pUserTags ); [DllImportAttribute( "libsteam_api64.so", EntryPoint = "SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ UGCDownloadToLocation( IntPtr ISteamRemoteStorage, ulong hContent, string /*const char **/ pchLocation, uint /*uint32*/ unPriority ); } @@ -5052,7 +5074,7 @@ internal static unsafe class ISteamUGC [DllImportAttribute( "libsteam_api64.so", EntryPoint = "SteamAPI_ISteamUGC_SetItemVisibility" )] internal static extern bool /*bool*/ SetItemVisibility( IntPtr ISteamUGC, ulong handle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); [DllImportAttribute( "libsteam_api64.so", EntryPoint = "SteamAPI_ISteamUGC_SetItemTags" )] - internal static extern bool /*bool*/ SetItemTags( IntPtr ISteamUGC, ulong updateHandle, IntPtr /*const struct SteamParamStringArray_t **/ pTags ); + internal static extern bool /*bool*/ SetItemTags( IntPtr ISteamUGC, ulong updateHandle, ref SteamParamStringArray_t.PackSmall /*const struct SteamParamStringArray_t **/ pTags ); [DllImportAttribute( "libsteam_api64.so", EntryPoint = "SteamAPI_ISteamUGC_SetItemContent" )] internal static extern bool /*bool*/ SetItemContent( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszContentFolder ); [DllImportAttribute( "libsteam_api64.so", EntryPoint = "SteamAPI_ISteamUGC_SetItemPreview" )] diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Mac.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Mac.cs index 7374a8a..ae83311 100644 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Mac.cs +++ b/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Mac.cs @@ -1492,11 +1492,14 @@ public virtual IntPtr ISteamRemoteStorage_GetFileNameAndSize( int /*int*/ iFile, return Native.ISteamRemoteStorage.GetCachedUGCHandle(_ptr, iCachedContent); } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishWorkshopFile( string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, IntPtr /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ) + public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishWorkshopFile( string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - return Native.ISteamRemoteStorage.PublishWorkshopFile(_ptr, pchFile, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, pTags, eWorkshopFileType); + var pTags_ps = new SteamParamStringArray_t.PackSmall(); + var ret = Native.ISteamRemoteStorage.PublishWorkshopFile(_ptr, pchFile, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, ref pTags_ps, eWorkshopFileType); + pTags = pTags_ps; + return ret; } public virtual PublishedFileUpdateHandle_t /*(PublishedFileUpdateHandle_t)*/ ISteamRemoteStorage_CreatePublishedFileUpdateRequest( ulong unPublishedFileId ) { @@ -1534,11 +1537,14 @@ public virtual IntPtr ISteamRemoteStorage_GetFileNameAndSize( int /*int*/ iFile, return Native.ISteamRemoteStorage.UpdatePublishedFileVisibility(_ptr, updateHandle, eVisibility); } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileTags( ulong updateHandle, IntPtr /*struct SteamParamStringArray_t **/ pTags ) + public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileTags( ulong updateHandle, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - return Native.ISteamRemoteStorage.UpdatePublishedFileTags(_ptr, updateHandle, pTags); + var pTags_ps = new SteamParamStringArray_t.PackSmall(); + var ret = Native.ISteamRemoteStorage.UpdatePublishedFileTags(_ptr, updateHandle, ref pTags_ps); + pTags = pTags_ps; + return ret; } public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_CommitPublishedFileUpdate( ulong updateHandle ) { @@ -1606,17 +1612,25 @@ public virtual IntPtr ISteamRemoteStorage_GetFileNameAndSize( int /*int*/ iFile, return Native.ISteamRemoteStorage.GetUserPublishedItemVoteDetails(_ptr, unPublishedFileId); } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles( ulong steamId, uint /*uint32*/ unStartIndex, IntPtr /*struct SteamParamStringArray_t **/ pRequiredTags, IntPtr /*struct SteamParamStringArray_t **/ pExcludedTags ) + public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles( ulong steamId, uint /*uint32*/ unStartIndex, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pRequiredTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pExcludedTags ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - return Native.ISteamRemoteStorage.EnumerateUserSharedWorkshopFiles(_ptr, steamId, unStartIndex, pRequiredTags, pExcludedTags); + var pRequiredTags_ps = new SteamParamStringArray_t.PackSmall(); + var pExcludedTags_ps = new SteamParamStringArray_t.PackSmall(); + var ret = Native.ISteamRemoteStorage.EnumerateUserSharedWorkshopFiles(_ptr, steamId, unStartIndex, ref pRequiredTags_ps, ref pExcludedTags_ps); + pRequiredTags = pRequiredTags_ps; + pExcludedTags = pExcludedTags_ps; + return ret; } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishVideo( WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, IntPtr /*struct SteamParamStringArray_t **/ pTags ) + public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishVideo( WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - return Native.ISteamRemoteStorage.PublishVideo(_ptr, eVideoProvider, pchVideoAccount, pchVideoIdentifier, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, pTags); + var pTags_ps = new SteamParamStringArray_t.PackSmall(); + var ret = Native.ISteamRemoteStorage.PublishVideo(_ptr, eVideoProvider, pchVideoAccount, pchVideoIdentifier, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, ref pTags_ps); + pTags = pTags_ps; + return ret; } public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_SetUserPublishedFileAction( ulong unPublishedFileId, WorkshopFileAction /*EWorkshopFileAction*/ eAction ) { @@ -1630,11 +1644,16 @@ public virtual IntPtr ISteamRemoteStorage_GetFileNameAndSize( int /*int*/ iFile, return Native.ISteamRemoteStorage.EnumeratePublishedFilesByUserAction(_ptr, eAction, unStartIndex); } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumeratePublishedWorkshopFiles( WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, IntPtr /*struct SteamParamStringArray_t **/ pTags, IntPtr /*struct SteamParamStringArray_t **/ pUserTags ) + public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumeratePublishedWorkshopFiles( WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pUserTags ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - return Native.ISteamRemoteStorage.EnumeratePublishedWorkshopFiles(_ptr, eEnumerationType, unStartIndex, unCount, unDays, pTags, pUserTags); + var pTags_ps = new SteamParamStringArray_t.PackSmall(); + var pUserTags_ps = new SteamParamStringArray_t.PackSmall(); + var ret = Native.ISteamRemoteStorage.EnumeratePublishedWorkshopFiles(_ptr, eEnumerationType, unStartIndex, unCount, unDays, ref pTags_ps, ref pUserTags_ps); + pTags = pTags_ps; + pUserTags = pUserTags_ps; + return ret; } public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UGCDownloadToLocation( ulong hContent, string /*const char **/ pchLocation, uint /*uint32*/ unPriority ) { @@ -3047,11 +3066,14 @@ public virtual IntPtr ISteamApps_GetLaunchQueryParam( string /*const char **/ pc return Native.ISteamUGC.SetItemVisibility(_ptr, handle, eVisibility); } - public virtual bool /*bool*/ ISteamUGC_SetItemTags( ulong updateHandle, IntPtr /*const struct SteamParamStringArray_t **/ pTags ) + public virtual bool /*bool*/ ISteamUGC_SetItemTags( ulong updateHandle, ref SteamParamStringArray_t /*const struct SteamParamStringArray_t **/ pTags ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - return Native.ISteamUGC.SetItemTags(_ptr, updateHandle, pTags); + var pTags_ps = new SteamParamStringArray_t.PackSmall(); + var ret = Native.ISteamUGC.SetItemTags(_ptr, updateHandle, ref pTags_ps); + pTags = pTags_ps; + return ret; } public virtual bool /*bool*/ ISteamUGC_SetItemContent( ulong handle, string /*const char **/ pszContentFolder ) { @@ -4500,7 +4522,7 @@ internal static unsafe class ISteamRemoteStorage [DllImportAttribute( "libsteam_api.dylib", EntryPoint = "SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle" )] internal static extern UGCHandle_t /*(UGCHandle_t)*/ GetCachedUGCHandle( IntPtr ISteamRemoteStorage, int /*int32*/ iCachedContent ); [DllImportAttribute( "libsteam_api.dylib", EntryPoint = "SteamAPI_ISteamRemoteStorage_PublishWorkshopFile" )] - internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ PublishWorkshopFile( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, IntPtr /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ); + internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ PublishWorkshopFile( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ); [DllImportAttribute( "libsteam_api.dylib", EntryPoint = "SteamAPI_ISteamRemoteStorage_CreatePublishedFileUpdateRequest" )] internal static extern PublishedFileUpdateHandle_t /*(PublishedFileUpdateHandle_t)*/ CreatePublishedFileUpdateRequest( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); [DllImportAttribute( "libsteam_api.dylib", EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileFile" )] @@ -4514,7 +4536,7 @@ internal static unsafe class ISteamRemoteStorage [DllImportAttribute( "libsteam_api.dylib", EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileVisibility" )] internal static extern bool /*bool*/ UpdatePublishedFileVisibility( IntPtr ISteamRemoteStorage, ulong updateHandle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); [DllImportAttribute( "libsteam_api.dylib", EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTags" )] - internal static extern bool /*bool*/ UpdatePublishedFileTags( IntPtr ISteamRemoteStorage, ulong updateHandle, IntPtr /*struct SteamParamStringArray_t **/ pTags ); + internal static extern bool /*bool*/ UpdatePublishedFileTags( IntPtr ISteamRemoteStorage, ulong updateHandle, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pTags ); [DllImportAttribute( "libsteam_api.dylib", EntryPoint = "SteamAPI_ISteamRemoteStorage_CommitPublishedFileUpdate" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ CommitPublishedFileUpdate( IntPtr ISteamRemoteStorage, ulong updateHandle ); [DllImportAttribute( "libsteam_api.dylib", EntryPoint = "SteamAPI_ISteamRemoteStorage_GetPublishedFileDetails" )] @@ -4538,15 +4560,15 @@ internal static unsafe class ISteamRemoteStorage [DllImportAttribute( "libsteam_api.dylib", EntryPoint = "SteamAPI_ISteamRemoteStorage_GetUserPublishedItemVoteDetails" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ GetUserPublishedItemVoteDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); [DllImportAttribute( "libsteam_api.dylib", EntryPoint = "SteamAPI_ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles" )] - internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ EnumerateUserSharedWorkshopFiles( IntPtr ISteamRemoteStorage, ulong steamId, uint /*uint32*/ unStartIndex, IntPtr /*struct SteamParamStringArray_t **/ pRequiredTags, IntPtr /*struct SteamParamStringArray_t **/ pExcludedTags ); + internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ EnumerateUserSharedWorkshopFiles( IntPtr ISteamRemoteStorage, ulong steamId, uint /*uint32*/ unStartIndex, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pRequiredTags, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pExcludedTags ); [DllImportAttribute( "libsteam_api.dylib", EntryPoint = "SteamAPI_ISteamRemoteStorage_PublishVideo" )] - internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ PublishVideo( IntPtr ISteamRemoteStorage, WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, IntPtr /*struct SteamParamStringArray_t **/ pTags ); + internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ PublishVideo( IntPtr ISteamRemoteStorage, WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pTags ); [DllImportAttribute( "libsteam_api.dylib", EntryPoint = "SteamAPI_ISteamRemoteStorage_SetUserPublishedFileAction" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SetUserPublishedFileAction( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, WorkshopFileAction /*EWorkshopFileAction*/ eAction ); [DllImportAttribute( "libsteam_api.dylib", EntryPoint = "SteamAPI_ISteamRemoteStorage_EnumeratePublishedFilesByUserAction" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ EnumeratePublishedFilesByUserAction( IntPtr ISteamRemoteStorage, WorkshopFileAction /*EWorkshopFileAction*/ eAction, uint /*uint32*/ unStartIndex ); [DllImportAttribute( "libsteam_api.dylib", EntryPoint = "SteamAPI_ISteamRemoteStorage_EnumeratePublishedWorkshopFiles" )] - internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ EnumeratePublishedWorkshopFiles( IntPtr ISteamRemoteStorage, WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, IntPtr /*struct SteamParamStringArray_t **/ pTags, IntPtr /*struct SteamParamStringArray_t **/ pUserTags ); + internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ EnumeratePublishedWorkshopFiles( IntPtr ISteamRemoteStorage, WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pTags, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pUserTags ); [DllImportAttribute( "libsteam_api.dylib", EntryPoint = "SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ UGCDownloadToLocation( IntPtr ISteamRemoteStorage, ulong hContent, string /*const char **/ pchLocation, uint /*uint32*/ unPriority ); } @@ -5052,7 +5074,7 @@ internal static unsafe class ISteamUGC [DllImportAttribute( "libsteam_api.dylib", EntryPoint = "SteamAPI_ISteamUGC_SetItemVisibility" )] internal static extern bool /*bool*/ SetItemVisibility( IntPtr ISteamUGC, ulong handle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); [DllImportAttribute( "libsteam_api.dylib", EntryPoint = "SteamAPI_ISteamUGC_SetItemTags" )] - internal static extern bool /*bool*/ SetItemTags( IntPtr ISteamUGC, ulong updateHandle, IntPtr /*const struct SteamParamStringArray_t **/ pTags ); + internal static extern bool /*bool*/ SetItemTags( IntPtr ISteamUGC, ulong updateHandle, ref SteamParamStringArray_t.PackSmall /*const struct SteamParamStringArray_t **/ pTags ); [DllImportAttribute( "libsteam_api.dylib", EntryPoint = "SteamAPI_ISteamUGC_SetItemContent" )] internal static extern bool /*bool*/ SetItemContent( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszContentFolder ); [DllImportAttribute( "libsteam_api.dylib", EntryPoint = "SteamAPI_ISteamUGC_SetItemPreview" )] diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Win32.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Win32.cs index b9d235f..65d577b 100644 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Win32.cs +++ b/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Win32.cs @@ -1489,11 +1489,11 @@ public virtual IntPtr ISteamRemoteStorage_GetFileNameAndSize( int /*int*/ iFile, return Native.ISteamRemoteStorage.GetCachedUGCHandle(_ptr, iCachedContent); } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishWorkshopFile( string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, IntPtr /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ) + public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishWorkshopFile( string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - return Native.ISteamRemoteStorage.PublishWorkshopFile(_ptr, pchFile, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, pTags, eWorkshopFileType); + return Native.ISteamRemoteStorage.PublishWorkshopFile(_ptr, pchFile, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, ref pTags, eWorkshopFileType); } public virtual PublishedFileUpdateHandle_t /*(PublishedFileUpdateHandle_t)*/ ISteamRemoteStorage_CreatePublishedFileUpdateRequest( ulong unPublishedFileId ) { @@ -1531,11 +1531,11 @@ public virtual IntPtr ISteamRemoteStorage_GetFileNameAndSize( int /*int*/ iFile, return Native.ISteamRemoteStorage.UpdatePublishedFileVisibility(_ptr, updateHandle, eVisibility); } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileTags( ulong updateHandle, IntPtr /*struct SteamParamStringArray_t **/ pTags ) + public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileTags( ulong updateHandle, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - return Native.ISteamRemoteStorage.UpdatePublishedFileTags(_ptr, updateHandle, pTags); + return Native.ISteamRemoteStorage.UpdatePublishedFileTags(_ptr, updateHandle, ref pTags); } public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_CommitPublishedFileUpdate( ulong updateHandle ) { @@ -1603,17 +1603,17 @@ public virtual IntPtr ISteamRemoteStorage_GetFileNameAndSize( int /*int*/ iFile, return Native.ISteamRemoteStorage.GetUserPublishedItemVoteDetails(_ptr, unPublishedFileId); } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles( ulong steamId, uint /*uint32*/ unStartIndex, IntPtr /*struct SteamParamStringArray_t **/ pRequiredTags, IntPtr /*struct SteamParamStringArray_t **/ pExcludedTags ) + public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles( ulong steamId, uint /*uint32*/ unStartIndex, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pRequiredTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pExcludedTags ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - return Native.ISteamRemoteStorage.EnumerateUserSharedWorkshopFiles(_ptr, steamId, unStartIndex, pRequiredTags, pExcludedTags); + return Native.ISteamRemoteStorage.EnumerateUserSharedWorkshopFiles(_ptr, steamId, unStartIndex, ref pRequiredTags, ref pExcludedTags); } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishVideo( WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, IntPtr /*struct SteamParamStringArray_t **/ pTags ) + public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishVideo( WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - return Native.ISteamRemoteStorage.PublishVideo(_ptr, eVideoProvider, pchVideoAccount, pchVideoIdentifier, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, pTags); + return Native.ISteamRemoteStorage.PublishVideo(_ptr, eVideoProvider, pchVideoAccount, pchVideoIdentifier, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, ref pTags); } public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_SetUserPublishedFileAction( ulong unPublishedFileId, WorkshopFileAction /*EWorkshopFileAction*/ eAction ) { @@ -1627,11 +1627,11 @@ public virtual IntPtr ISteamRemoteStorage_GetFileNameAndSize( int /*int*/ iFile, return Native.ISteamRemoteStorage.EnumeratePublishedFilesByUserAction(_ptr, eAction, unStartIndex); } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumeratePublishedWorkshopFiles( WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, IntPtr /*struct SteamParamStringArray_t **/ pTags, IntPtr /*struct SteamParamStringArray_t **/ pUserTags ) + public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumeratePublishedWorkshopFiles( WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pUserTags ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - return Native.ISteamRemoteStorage.EnumeratePublishedWorkshopFiles(_ptr, eEnumerationType, unStartIndex, unCount, unDays, pTags, pUserTags); + return Native.ISteamRemoteStorage.EnumeratePublishedWorkshopFiles(_ptr, eEnumerationType, unStartIndex, unCount, unDays, ref pTags, ref pUserTags); } public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UGCDownloadToLocation( ulong hContent, string /*const char **/ pchLocation, uint /*uint32*/ unPriority ) { @@ -3035,11 +3035,11 @@ public virtual IntPtr ISteamApps_GetLaunchQueryParam( string /*const char **/ pc return Native.ISteamUGC.SetItemVisibility(_ptr, handle, eVisibility); } - public virtual bool /*bool*/ ISteamUGC_SetItemTags( ulong updateHandle, IntPtr /*const struct SteamParamStringArray_t **/ pTags ) + public virtual bool /*bool*/ ISteamUGC_SetItemTags( ulong updateHandle, ref SteamParamStringArray_t /*const struct SteamParamStringArray_t **/ pTags ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - return Native.ISteamUGC.SetItemTags(_ptr, updateHandle, pTags); + return Native.ISteamUGC.SetItemTags(_ptr, updateHandle, ref pTags); } public virtual bool /*bool*/ ISteamUGC_SetItemContent( ulong handle, string /*const char **/ pszContentFolder ) { @@ -4488,7 +4488,7 @@ internal static unsafe class ISteamRemoteStorage [DllImportAttribute( "steam_api.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle" )] internal static extern UGCHandle_t /*(UGCHandle_t)*/ GetCachedUGCHandle( IntPtr ISteamRemoteStorage, int /*int32*/ iCachedContent ); [DllImportAttribute( "steam_api.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_PublishWorkshopFile" )] - internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ PublishWorkshopFile( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, IntPtr /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ); + internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ PublishWorkshopFile( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ); [DllImportAttribute( "steam_api.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_CreatePublishedFileUpdateRequest" )] internal static extern PublishedFileUpdateHandle_t /*(PublishedFileUpdateHandle_t)*/ CreatePublishedFileUpdateRequest( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); [DllImportAttribute( "steam_api.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileFile" )] @@ -4502,7 +4502,7 @@ internal static unsafe class ISteamRemoteStorage [DllImportAttribute( "steam_api.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileVisibility" )] internal static extern bool /*bool*/ UpdatePublishedFileVisibility( IntPtr ISteamRemoteStorage, ulong updateHandle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); [DllImportAttribute( "steam_api.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTags" )] - internal static extern bool /*bool*/ UpdatePublishedFileTags( IntPtr ISteamRemoteStorage, ulong updateHandle, IntPtr /*struct SteamParamStringArray_t **/ pTags ); + internal static extern bool /*bool*/ UpdatePublishedFileTags( IntPtr ISteamRemoteStorage, ulong updateHandle, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ); [DllImportAttribute( "steam_api.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_CommitPublishedFileUpdate" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ CommitPublishedFileUpdate( IntPtr ISteamRemoteStorage, ulong updateHandle ); [DllImportAttribute( "steam_api.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_GetPublishedFileDetails" )] @@ -4526,15 +4526,15 @@ internal static unsafe class ISteamRemoteStorage [DllImportAttribute( "steam_api.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_GetUserPublishedItemVoteDetails" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ GetUserPublishedItemVoteDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); [DllImportAttribute( "steam_api.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles" )] - internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ EnumerateUserSharedWorkshopFiles( IntPtr ISteamRemoteStorage, ulong steamId, uint /*uint32*/ unStartIndex, IntPtr /*struct SteamParamStringArray_t **/ pRequiredTags, IntPtr /*struct SteamParamStringArray_t **/ pExcludedTags ); + internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ EnumerateUserSharedWorkshopFiles( IntPtr ISteamRemoteStorage, ulong steamId, uint /*uint32*/ unStartIndex, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pRequiredTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pExcludedTags ); [DllImportAttribute( "steam_api.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_PublishVideo" )] - internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ PublishVideo( IntPtr ISteamRemoteStorage, WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, IntPtr /*struct SteamParamStringArray_t **/ pTags ); + internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ PublishVideo( IntPtr ISteamRemoteStorage, WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ); [DllImportAttribute( "steam_api.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_SetUserPublishedFileAction" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SetUserPublishedFileAction( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, WorkshopFileAction /*EWorkshopFileAction*/ eAction ); [DllImportAttribute( "steam_api.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_EnumeratePublishedFilesByUserAction" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ EnumeratePublishedFilesByUserAction( IntPtr ISteamRemoteStorage, WorkshopFileAction /*EWorkshopFileAction*/ eAction, uint /*uint32*/ unStartIndex ); [DllImportAttribute( "steam_api.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_EnumeratePublishedWorkshopFiles" )] - internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ EnumeratePublishedWorkshopFiles( IntPtr ISteamRemoteStorage, WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, IntPtr /*struct SteamParamStringArray_t **/ pTags, IntPtr /*struct SteamParamStringArray_t **/ pUserTags ); + internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ EnumeratePublishedWorkshopFiles( IntPtr ISteamRemoteStorage, WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pUserTags ); [DllImportAttribute( "steam_api.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ UGCDownloadToLocation( IntPtr ISteamRemoteStorage, ulong hContent, string /*const char **/ pchLocation, uint /*uint32*/ unPriority ); } @@ -5040,7 +5040,7 @@ internal static unsafe class ISteamUGC [DllImportAttribute( "steam_api.dll", EntryPoint = "SteamAPI_ISteamUGC_SetItemVisibility" )] internal static extern bool /*bool*/ SetItemVisibility( IntPtr ISteamUGC, ulong handle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); [DllImportAttribute( "steam_api.dll", EntryPoint = "SteamAPI_ISteamUGC_SetItemTags" )] - internal static extern bool /*bool*/ SetItemTags( IntPtr ISteamUGC, ulong updateHandle, IntPtr /*const struct SteamParamStringArray_t **/ pTags ); + internal static extern bool /*bool*/ SetItemTags( IntPtr ISteamUGC, ulong updateHandle, ref SteamParamStringArray_t /*const struct SteamParamStringArray_t **/ pTags ); [DllImportAttribute( "steam_api.dll", EntryPoint = "SteamAPI_ISteamUGC_SetItemContent" )] internal static extern bool /*bool*/ SetItemContent( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszContentFolder ); [DllImportAttribute( "steam_api.dll", EntryPoint = "SteamAPI_ISteamUGC_SetItemPreview" )] diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Win64.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Win64.cs index 3cf6cc4..03f4284 100644 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Win64.cs +++ b/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Win64.cs @@ -1489,11 +1489,11 @@ public virtual IntPtr ISteamRemoteStorage_GetFileNameAndSize( int /*int*/ iFile, return Native.ISteamRemoteStorage.GetCachedUGCHandle(_ptr, iCachedContent); } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishWorkshopFile( string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, IntPtr /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ) + public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishWorkshopFile( string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - return Native.ISteamRemoteStorage.PublishWorkshopFile(_ptr, pchFile, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, pTags, eWorkshopFileType); + return Native.ISteamRemoteStorage.PublishWorkshopFile(_ptr, pchFile, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, ref pTags, eWorkshopFileType); } public virtual PublishedFileUpdateHandle_t /*(PublishedFileUpdateHandle_t)*/ ISteamRemoteStorage_CreatePublishedFileUpdateRequest( ulong unPublishedFileId ) { @@ -1531,11 +1531,11 @@ public virtual IntPtr ISteamRemoteStorage_GetFileNameAndSize( int /*int*/ iFile, return Native.ISteamRemoteStorage.UpdatePublishedFileVisibility(_ptr, updateHandle, eVisibility); } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileTags( ulong updateHandle, IntPtr /*struct SteamParamStringArray_t **/ pTags ) + public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileTags( ulong updateHandle, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - return Native.ISteamRemoteStorage.UpdatePublishedFileTags(_ptr, updateHandle, pTags); + return Native.ISteamRemoteStorage.UpdatePublishedFileTags(_ptr, updateHandle, ref pTags); } public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_CommitPublishedFileUpdate( ulong updateHandle ) { @@ -1603,17 +1603,17 @@ public virtual IntPtr ISteamRemoteStorage_GetFileNameAndSize( int /*int*/ iFile, return Native.ISteamRemoteStorage.GetUserPublishedItemVoteDetails(_ptr, unPublishedFileId); } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles( ulong steamId, uint /*uint32*/ unStartIndex, IntPtr /*struct SteamParamStringArray_t **/ pRequiredTags, IntPtr /*struct SteamParamStringArray_t **/ pExcludedTags ) + public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles( ulong steamId, uint /*uint32*/ unStartIndex, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pRequiredTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pExcludedTags ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - return Native.ISteamRemoteStorage.EnumerateUserSharedWorkshopFiles(_ptr, steamId, unStartIndex, pRequiredTags, pExcludedTags); + return Native.ISteamRemoteStorage.EnumerateUserSharedWorkshopFiles(_ptr, steamId, unStartIndex, ref pRequiredTags, ref pExcludedTags); } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishVideo( WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, IntPtr /*struct SteamParamStringArray_t **/ pTags ) + public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishVideo( WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - return Native.ISteamRemoteStorage.PublishVideo(_ptr, eVideoProvider, pchVideoAccount, pchVideoIdentifier, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, pTags); + return Native.ISteamRemoteStorage.PublishVideo(_ptr, eVideoProvider, pchVideoAccount, pchVideoIdentifier, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, ref pTags); } public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_SetUserPublishedFileAction( ulong unPublishedFileId, WorkshopFileAction /*EWorkshopFileAction*/ eAction ) { @@ -1627,11 +1627,11 @@ public virtual IntPtr ISteamRemoteStorage_GetFileNameAndSize( int /*int*/ iFile, return Native.ISteamRemoteStorage.EnumeratePublishedFilesByUserAction(_ptr, eAction, unStartIndex); } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumeratePublishedWorkshopFiles( WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, IntPtr /*struct SteamParamStringArray_t **/ pTags, IntPtr /*struct SteamParamStringArray_t **/ pUserTags ) + public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumeratePublishedWorkshopFiles( WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pUserTags ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - return Native.ISteamRemoteStorage.EnumeratePublishedWorkshopFiles(_ptr, eEnumerationType, unStartIndex, unCount, unDays, pTags, pUserTags); + return Native.ISteamRemoteStorage.EnumeratePublishedWorkshopFiles(_ptr, eEnumerationType, unStartIndex, unCount, unDays, ref pTags, ref pUserTags); } public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UGCDownloadToLocation( ulong hContent, string /*const char **/ pchLocation, uint /*uint32*/ unPriority ) { @@ -3035,11 +3035,11 @@ public virtual IntPtr ISteamApps_GetLaunchQueryParam( string /*const char **/ pc return Native.ISteamUGC.SetItemVisibility(_ptr, handle, eVisibility); } - public virtual bool /*bool*/ ISteamUGC_SetItemTags( ulong updateHandle, IntPtr /*const struct SteamParamStringArray_t **/ pTags ) + public virtual bool /*bool*/ ISteamUGC_SetItemTags( ulong updateHandle, ref SteamParamStringArray_t /*const struct SteamParamStringArray_t **/ pTags ) { if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - return Native.ISteamUGC.SetItemTags(_ptr, updateHandle, pTags); + return Native.ISteamUGC.SetItemTags(_ptr, updateHandle, ref pTags); } public virtual bool /*bool*/ ISteamUGC_SetItemContent( ulong handle, string /*const char **/ pszContentFolder ) { @@ -4488,7 +4488,7 @@ internal static unsafe class ISteamRemoteStorage [DllImportAttribute( "steam_api64.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle" )] internal static extern UGCHandle_t /*(UGCHandle_t)*/ GetCachedUGCHandle( IntPtr ISteamRemoteStorage, int /*int32*/ iCachedContent ); [DllImportAttribute( "steam_api64.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_PublishWorkshopFile" )] - internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ PublishWorkshopFile( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, IntPtr /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ); + internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ PublishWorkshopFile( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ); [DllImportAttribute( "steam_api64.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_CreatePublishedFileUpdateRequest" )] internal static extern PublishedFileUpdateHandle_t /*(PublishedFileUpdateHandle_t)*/ CreatePublishedFileUpdateRequest( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); [DllImportAttribute( "steam_api64.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileFile" )] @@ -4502,7 +4502,7 @@ internal static unsafe class ISteamRemoteStorage [DllImportAttribute( "steam_api64.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileVisibility" )] internal static extern bool /*bool*/ UpdatePublishedFileVisibility( IntPtr ISteamRemoteStorage, ulong updateHandle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); [DllImportAttribute( "steam_api64.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTags" )] - internal static extern bool /*bool*/ UpdatePublishedFileTags( IntPtr ISteamRemoteStorage, ulong updateHandle, IntPtr /*struct SteamParamStringArray_t **/ pTags ); + internal static extern bool /*bool*/ UpdatePublishedFileTags( IntPtr ISteamRemoteStorage, ulong updateHandle, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ); [DllImportAttribute( "steam_api64.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_CommitPublishedFileUpdate" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ CommitPublishedFileUpdate( IntPtr ISteamRemoteStorage, ulong updateHandle ); [DllImportAttribute( "steam_api64.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_GetPublishedFileDetails" )] @@ -4526,15 +4526,15 @@ internal static unsafe class ISteamRemoteStorage [DllImportAttribute( "steam_api64.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_GetUserPublishedItemVoteDetails" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ GetUserPublishedItemVoteDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); [DllImportAttribute( "steam_api64.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles" )] - internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ EnumerateUserSharedWorkshopFiles( IntPtr ISteamRemoteStorage, ulong steamId, uint /*uint32*/ unStartIndex, IntPtr /*struct SteamParamStringArray_t **/ pRequiredTags, IntPtr /*struct SteamParamStringArray_t **/ pExcludedTags ); + internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ EnumerateUserSharedWorkshopFiles( IntPtr ISteamRemoteStorage, ulong steamId, uint /*uint32*/ unStartIndex, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pRequiredTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pExcludedTags ); [DllImportAttribute( "steam_api64.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_PublishVideo" )] - internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ PublishVideo( IntPtr ISteamRemoteStorage, WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, IntPtr /*struct SteamParamStringArray_t **/ pTags ); + internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ PublishVideo( IntPtr ISteamRemoteStorage, WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ); [DllImportAttribute( "steam_api64.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_SetUserPublishedFileAction" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SetUserPublishedFileAction( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, WorkshopFileAction /*EWorkshopFileAction*/ eAction ); [DllImportAttribute( "steam_api64.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_EnumeratePublishedFilesByUserAction" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ EnumeratePublishedFilesByUserAction( IntPtr ISteamRemoteStorage, WorkshopFileAction /*EWorkshopFileAction*/ eAction, uint /*uint32*/ unStartIndex ); [DllImportAttribute( "steam_api64.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_EnumeratePublishedWorkshopFiles" )] - internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ EnumeratePublishedWorkshopFiles( IntPtr ISteamRemoteStorage, WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, IntPtr /*struct SteamParamStringArray_t **/ pTags, IntPtr /*struct SteamParamStringArray_t **/ pUserTags ); + internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ EnumeratePublishedWorkshopFiles( IntPtr ISteamRemoteStorage, WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pUserTags ); [DllImportAttribute( "steam_api64.dll", EntryPoint = "SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ UGCDownloadToLocation( IntPtr ISteamRemoteStorage, ulong hContent, string /*const char **/ pchLocation, uint /*uint32*/ unPriority ); } @@ -5040,7 +5040,7 @@ internal static unsafe class ISteamUGC [DllImportAttribute( "steam_api64.dll", EntryPoint = "SteamAPI_ISteamUGC_SetItemVisibility" )] internal static extern bool /*bool*/ SetItemVisibility( IntPtr ISteamUGC, ulong handle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); [DllImportAttribute( "steam_api64.dll", EntryPoint = "SteamAPI_ISteamUGC_SetItemTags" )] - internal static extern bool /*bool*/ SetItemTags( IntPtr ISteamUGC, ulong updateHandle, IntPtr /*const struct SteamParamStringArray_t **/ pTags ); + internal static extern bool /*bool*/ SetItemTags( IntPtr ISteamUGC, ulong updateHandle, ref SteamParamStringArray_t /*const struct SteamParamStringArray_t **/ pTags ); [DllImportAttribute( "steam_api64.dll", EntryPoint = "SteamAPI_ISteamUGC_SetItemContent" )] internal static extern bool /*bool*/ SetItemContent( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszContentFolder ); [DllImportAttribute( "steam_api64.dll", EntryPoint = "SteamAPI_ISteamUGC_SetItemPreview" )] diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.SteamRemoteStorage.cs b/Facepunch.Steamworks/SteamNative/SteamNative.SteamRemoteStorage.cs index f710438..ffdbffe 100644 --- a/Facepunch.Steamworks/SteamNative/SteamNative.SteamRemoteStorage.cs +++ b/Facepunch.Steamworks/SteamNative/SteamNative.SteamRemoteStorage.cs @@ -64,9 +64,30 @@ public SteamAPICall_t EnumeratePublishedFilesByUserAction( WorkshopFileAction eA } // SteamAPICall_t - public SteamAPICall_t EnumeratePublishedWorkshopFiles( WorkshopEnumerationType eEnumerationType /*EWorkshopEnumerationType*/, uint unStartIndex /*uint32*/, uint unCount /*uint32*/, uint unDays /*uint32*/, IntPtr pTags /*struct SteamParamStringArray_t **/, IntPtr pUserTags /*struct SteamParamStringArray_t **/ ) + // using: Detect_StringArray + public SteamAPICall_t EnumeratePublishedWorkshopFiles( WorkshopEnumerationType eEnumerationType /*EWorkshopEnumerationType*/, uint unStartIndex /*uint32*/, uint unCount /*uint32*/, uint unDays /*uint32*/, string[] pTags /*struct SteamParamStringArray_t **/, ref SteamParamStringArray_t pUserTags /*struct SteamParamStringArray_t **/ ) { - return _pi.ISteamRemoteStorage_EnumeratePublishedWorkshopFiles( eEnumerationType, unStartIndex, unCount, unDays, (IntPtr) pTags, (IntPtr) pUserTags ); + // Create strings + var nativeStrings = new IntPtr[pTags.Length]; + for ( int i = 0; i < pTags.Length; i++ ) + { + nativeStrings[i] = Marshal.StringToHGlobalAnsi( pTags[i] ); + } + + // Create string array + var size = Marshal.SizeOf( typeof( IntPtr ) ) * nativeStrings.Length; + var nativeArray = Marshal.AllocHGlobal( size ); + Marshal.Copy( nativeStrings, 0, nativeArray, nativeStrings.Length ); + + // Create SteamParamStringArray_t + var tags = new SteamParamStringArray_t(); + tags.Strings = nativeArray; + tags.NumStrings = pTags.Length; + var result = _pi.ISteamRemoteStorage_EnumeratePublishedWorkshopFiles( eEnumerationType, unStartIndex, unCount, unDays, ref tags, ref pUserTags ); + foreach ( var x in nativeStrings ) + Marshal.FreeHGlobal( x ); + + return result; } // SteamAPICall_t @@ -76,9 +97,30 @@ public SteamAPICall_t EnumerateUserPublishedFiles( uint unStartIndex /*uint32*/ } // SteamAPICall_t - public SteamAPICall_t EnumerateUserSharedWorkshopFiles( CSteamID steamId /*class CSteamID*/, uint unStartIndex /*uint32*/, IntPtr pRequiredTags /*struct SteamParamStringArray_t **/, IntPtr pExcludedTags /*struct SteamParamStringArray_t **/ ) + // using: Detect_StringArray + public SteamAPICall_t EnumerateUserSharedWorkshopFiles( CSteamID steamId /*class CSteamID*/, uint unStartIndex /*uint32*/, string[] pRequiredTags /*struct SteamParamStringArray_t **/, ref SteamParamStringArray_t pExcludedTags /*struct SteamParamStringArray_t **/ ) { - return _pi.ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles( steamId.Value, unStartIndex, (IntPtr) pRequiredTags, (IntPtr) pExcludedTags ); + // Create strings + var nativeStrings = new IntPtr[pRequiredTags.Length]; + for ( int i = 0; i < pRequiredTags.Length; i++ ) + { + nativeStrings[i] = Marshal.StringToHGlobalAnsi( pRequiredTags[i] ); + } + + // Create string array + var size = Marshal.SizeOf( typeof( IntPtr ) ) * nativeStrings.Length; + var nativeArray = Marshal.AllocHGlobal( size ); + Marshal.Copy( nativeStrings, 0, nativeArray, nativeStrings.Length ); + + // Create SteamParamStringArray_t + var tags = new SteamParamStringArray_t(); + tags.Strings = nativeArray; + tags.NumStrings = pRequiredTags.Length; + var result = _pi.ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles( steamId.Value, unStartIndex, ref tags, ref pExcludedTags ); + foreach ( var x in nativeStrings ) + Marshal.FreeHGlobal( x ); + + return result; } // SteamAPICall_t @@ -273,15 +315,57 @@ public bool IsCloudEnabledForApp() } // SteamAPICall_t - public SteamAPICall_t PublishVideo( WorkshopVideoProvider eVideoProvider /*EWorkshopVideoProvider*/, string pchVideoAccount /*const char **/, string pchVideoIdentifier /*const char **/, string pchPreviewFile /*const char **/, AppId_t nConsumerAppId /*AppId_t*/, string pchTitle /*const char **/, string pchDescription /*const char **/, RemoteStoragePublishedFileVisibility eVisibility /*ERemoteStoragePublishedFileVisibility*/, IntPtr pTags /*struct SteamParamStringArray_t **/ ) + // using: Detect_StringArray + public SteamAPICall_t PublishVideo( WorkshopVideoProvider eVideoProvider /*EWorkshopVideoProvider*/, string pchVideoAccount /*const char **/, string pchVideoIdentifier /*const char **/, string pchPreviewFile /*const char **/, AppId_t nConsumerAppId /*AppId_t*/, string pchTitle /*const char **/, string pchDescription /*const char **/, RemoteStoragePublishedFileVisibility eVisibility /*ERemoteStoragePublishedFileVisibility*/, string[] pTags /*struct SteamParamStringArray_t **/ ) { - return _pi.ISteamRemoteStorage_PublishVideo( eVideoProvider, pchVideoAccount, pchVideoIdentifier, pchPreviewFile, nConsumerAppId.Value, pchTitle, pchDescription, eVisibility, (IntPtr) pTags ); + // Create strings + var nativeStrings = new IntPtr[pTags.Length]; + for ( int i = 0; i < pTags.Length; i++ ) + { + nativeStrings[i] = Marshal.StringToHGlobalAnsi( pTags[i] ); + } + + // Create string array + var size = Marshal.SizeOf( typeof( IntPtr ) ) * nativeStrings.Length; + var nativeArray = Marshal.AllocHGlobal( size ); + Marshal.Copy( nativeStrings, 0, nativeArray, nativeStrings.Length ); + + // Create SteamParamStringArray_t + var tags = new SteamParamStringArray_t(); + tags.Strings = nativeArray; + tags.NumStrings = pTags.Length; + var result = _pi.ISteamRemoteStorage_PublishVideo( eVideoProvider, pchVideoAccount, pchVideoIdentifier, pchPreviewFile, nConsumerAppId.Value, pchTitle, pchDescription, eVisibility, ref tags ); + foreach ( var x in nativeStrings ) + Marshal.FreeHGlobal( x ); + + return result; } // SteamAPICall_t - public SteamAPICall_t PublishWorkshopFile( string pchFile /*const char **/, string pchPreviewFile /*const char **/, AppId_t nConsumerAppId /*AppId_t*/, string pchTitle /*const char **/, string pchDescription /*const char **/, RemoteStoragePublishedFileVisibility eVisibility /*ERemoteStoragePublishedFileVisibility*/, IntPtr pTags /*struct SteamParamStringArray_t **/, WorkshopFileType eWorkshopFileType /*EWorkshopFileType*/ ) + // using: Detect_StringArray + public SteamAPICall_t PublishWorkshopFile( string pchFile /*const char **/, string pchPreviewFile /*const char **/, AppId_t nConsumerAppId /*AppId_t*/, string pchTitle /*const char **/, string pchDescription /*const char **/, RemoteStoragePublishedFileVisibility eVisibility /*ERemoteStoragePublishedFileVisibility*/, string[] pTags /*struct SteamParamStringArray_t **/, WorkshopFileType eWorkshopFileType /*EWorkshopFileType*/ ) { - return _pi.ISteamRemoteStorage_PublishWorkshopFile( pchFile, pchPreviewFile, nConsumerAppId.Value, pchTitle, pchDescription, eVisibility, (IntPtr) pTags, eWorkshopFileType ); + // Create strings + var nativeStrings = new IntPtr[pTags.Length]; + for ( int i = 0; i < pTags.Length; i++ ) + { + nativeStrings[i] = Marshal.StringToHGlobalAnsi( pTags[i] ); + } + + // Create string array + var size = Marshal.SizeOf( typeof( IntPtr ) ) * nativeStrings.Length; + var nativeArray = Marshal.AllocHGlobal( size ); + Marshal.Copy( nativeStrings, 0, nativeArray, nativeStrings.Length ); + + // Create SteamParamStringArray_t + var tags = new SteamParamStringArray_t(); + tags.Strings = nativeArray; + tags.NumStrings = pTags.Length; + var result = _pi.ISteamRemoteStorage_PublishWorkshopFile( pchFile, pchPreviewFile, nConsumerAppId.Value, pchTitle, pchDescription, eVisibility, ref tags, eWorkshopFileType ); + foreach ( var x in nativeStrings ) + Marshal.FreeHGlobal( x ); + + return result; } // void @@ -357,9 +441,30 @@ public bool UpdatePublishedFileSetChangeDescription( PublishedFileUpdateHandle_t } // bool - public bool UpdatePublishedFileTags( PublishedFileUpdateHandle_t updateHandle /*PublishedFileUpdateHandle_t*/, IntPtr pTags /*struct SteamParamStringArray_t **/ ) + // using: Detect_StringArray + public bool UpdatePublishedFileTags( PublishedFileUpdateHandle_t updateHandle /*PublishedFileUpdateHandle_t*/, string[] pTags /*struct SteamParamStringArray_t **/ ) { - return _pi.ISteamRemoteStorage_UpdatePublishedFileTags( updateHandle.Value, (IntPtr) pTags ); + // Create strings + var nativeStrings = new IntPtr[pTags.Length]; + for ( int i = 0; i < pTags.Length; i++ ) + { + nativeStrings[i] = Marshal.StringToHGlobalAnsi( pTags[i] ); + } + + // Create string array + var size = Marshal.SizeOf( typeof( IntPtr ) ) * nativeStrings.Length; + var nativeArray = Marshal.AllocHGlobal( size ); + Marshal.Copy( nativeStrings, 0, nativeArray, nativeStrings.Length ); + + // Create SteamParamStringArray_t + var tags = new SteamParamStringArray_t(); + tags.Strings = nativeArray; + tags.NumStrings = pTags.Length; + var result = _pi.ISteamRemoteStorage_UpdatePublishedFileTags( updateHandle.Value, ref tags ); + foreach ( var x in nativeStrings ) + Marshal.FreeHGlobal( x ); + + return result; } // bool diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.SteamUGC.cs b/Facepunch.Steamworks/SteamNative/SteamNative.SteamUGC.cs index 96b13bd..01fd748 100644 --- a/Facepunch.Steamworks/SteamNative/SteamNative.SteamUGC.cs +++ b/Facepunch.Steamworks/SteamNative/SteamNative.SteamUGC.cs @@ -343,9 +343,30 @@ public bool SetItemPreview( UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, stri } // bool - public bool SetItemTags( UGCUpdateHandle_t updateHandle /*UGCUpdateHandle_t*/, IntPtr pTags /*const struct SteamParamStringArray_t **/ ) + // using: Detect_StringArray + public bool SetItemTags( UGCUpdateHandle_t updateHandle /*UGCUpdateHandle_t*/, string[] pTags /*const struct SteamParamStringArray_t **/ ) { - return _pi.ISteamUGC_SetItemTags( updateHandle.Value, (IntPtr) pTags ); + // Create strings + var nativeStrings = new IntPtr[pTags.Length]; + for ( int i = 0; i < pTags.Length; i++ ) + { + nativeStrings[i] = Marshal.StringToHGlobalAnsi( pTags[i] ); + } + + // Create string array + var size = Marshal.SizeOf( typeof( IntPtr ) ) * nativeStrings.Length; + var nativeArray = Marshal.AllocHGlobal( size ); + Marshal.Copy( nativeStrings, 0, nativeArray, nativeStrings.Length ); + + // Create SteamParamStringArray_t + var tags = new SteamParamStringArray_t(); + tags.Strings = nativeArray; + tags.NumStrings = pTags.Length; + var result = _pi.ISteamUGC_SetItemTags( updateHandle.Value, ref tags ); + foreach ( var x in nativeStrings ) + Marshal.FreeHGlobal( x ); + + return result; } // bool diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Structs.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Structs.cs index a1fe9b3..e9b4598 100644 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Structs.cs +++ b/Facepunch.Steamworks/SteamNative/SteamNative.Structs.cs @@ -1373,21 +1373,21 @@ public static implicit operator FavoritesListAccountsUpdated_t ( FavoritesListA [StructLayout( LayoutKind.Sequential, Pack = 8 )] public struct SteamParamStringArray_t { - public IntPtr PpStrings; // m_ppStrings const char ** + public IntPtr Strings; // m_ppStrings const char ** public int NumStrings; // m_nNumStrings int32 public static SteamParamStringArray_t FromPointer( IntPtr p ) { return (SteamParamStringArray_t) Marshal.PtrToStructure( p, typeof(SteamParamStringArray_t) ); } [StructLayout( LayoutKind.Sequential, Pack = 4 )] public struct PackSmall { - public IntPtr PpStrings; // m_ppStrings const char ** + public IntPtr Strings; // m_ppStrings const char ** public int NumStrings; // m_nNumStrings int32 public static implicit operator SteamParamStringArray_t ( SteamParamStringArray_t.PackSmall d ) { return new SteamParamStringArray_t() { - PpStrings = d.PpStrings, + Strings = d.Strings, NumStrings = d.NumStrings, }; } diff --git a/Generator/Argument.cs b/Generator/Argument.cs index 5ffec28..95a0315 100644 --- a/Generator/Argument.cs +++ b/Generator/Argument.cs @@ -64,7 +64,7 @@ bool ShouldBeIntPtr { get { - if ( ManagedType.Contains( "SteamUGCDetails_t" ) ) + if ( ManagedType.Contains( "SteamUGCDetails_t" ) || ManagedType.Contains( "SteamParamStringArray_t" ) ) return false; if ( Name == "pOutItemsArray" || Name == "handlesOut" ) diff --git a/Generator/CodeWriter.Struct.cs b/Generator/CodeWriter.Struct.cs index 6d573c4..626cb69 100644 --- a/Generator/CodeWriter.Struct.cs +++ b/Generator/CodeWriter.Struct.cs @@ -145,6 +145,7 @@ string CleanMemberName( string m ) .Replace( "m_us", "" ) .Replace( "m_sz", "" ) .Replace( "m_h", "" ) + .Replace( "m_pp", "" ) .Replace( "m_e", "" ) .Replace( "m_un", "" ) .Replace( "m_ul", "" ) diff --git a/Generator/CodeWriter/Class.cs b/Generator/CodeWriter/Class.cs index 36c9998..242b640 100644 --- a/Generator/CodeWriter/Class.cs +++ b/Generator/CodeWriter/Class.cs @@ -113,6 +113,7 @@ private void ClassMethod( string classname, SteamApiDefinition.MethodDef m ) Detect_ReturningStruct(); Detect_IntPtrArgs( argList, callargs ); Detect_MultiSizeArrayReturn( argList, callargs ); + Detect_StringArray( argList, callargs ); var methodName = m.Name; @@ -135,6 +136,47 @@ private void ClassMethod( string classname, SteamApiDefinition.MethodDef m ) LastMethodName = m.Name; } + private void Detect_StringArray( List argList, List callargs ) + { + var arg = argList.FirstOrDefault( x => x.NativeType.Contains( "SteamParamStringArray_t") ); + if ( arg == null ) return; + + arg.ManagedType = "string[]"; + + WriteLine( "// using: Detect_StringArray" ); + + BeforeLines.Add( "// Create strings" ); + BeforeLines.Add( $"var nativeStrings = new IntPtr[{arg.Name}.Length];" ); + BeforeLines.Add( $"for ( int i = 0; i < {arg.Name}.Length; i++ )" ); + BeforeLines.Add( $"{{" ); + BeforeLines.Add( $"nativeStrings[i] = Marshal.StringToHGlobalAnsi( {arg.Name}[i] );" ); + BeforeLines.Add( $"}}" ); + + BeforeLines.Add( "" ); + BeforeLines.Add( "// Create string array" ); + BeforeLines.Add( $"var size = Marshal.SizeOf( typeof( IntPtr ) ) * nativeStrings.Length;" ); + BeforeLines.Add( $"var nativeArray = Marshal.AllocHGlobal( size );" ); + BeforeLines.Add( $"Marshal.Copy( nativeStrings, 0, nativeArray, nativeStrings.Length );" ); + + BeforeLines.Add( "" ); + BeforeLines.Add( "// Create SteamParamStringArray_t" ); + BeforeLines.Add( $"var tags = new SteamParamStringArray_t();" ); + BeforeLines.Add( $"tags.Strings = nativeArray;" ); + BeforeLines.Add( $"tags.NumStrings = {arg.Name}.Length;" ); + + ReturnVar = "var result"; + + AfterLines.Add( $"foreach ( var x in nativeStrings )" ); + AfterLines.Add( $" Marshal.FreeHGlobal( x );" ); + AfterLines.Add( $"" ); + AfterLines.Add( $"return result;" ); + + + + foreach ( var a in callargs ) + if ( a.Name == arg.Name ) a.Name = "ref tags"; + } + private void Detect_MultiSizeArrayReturn( List argList, List callargs ) { if ( ReturnType != "bool" ) return; @@ -387,12 +429,7 @@ private void CallPlatformClass( string classname, SteamApiDefinition.MethodDef m if ( returnVar != "" ) r = returnVar + " = "; - // StartBlock( "case 1:" ); BeforeLines.Add( $"{r}_pi.{classname}_{methodName}({args});" ); - // WriteLine( "break;" ); - // EndBlock(); - - // EndBlock(); } } }