diff --git a/Facepunch.Steamworks.Test/UgcTest.cs b/Facepunch.Steamworks.Test/UgcTest.cs index 14ab767..1008809 100644 --- a/Facepunch.Steamworks.Test/UgcTest.cs +++ b/Facepunch.Steamworks.Test/UgcTest.cs @@ -35,6 +35,7 @@ public async Task GetInformation() Console.WriteLine( $"Description: {itemInfo?.Description}" ); Console.WriteLine( $"Owner: {itemInfo?.Owner}" ); Console.WriteLine( $"Score: {itemInfo?.Score}" ); + Console.WriteLine( $"PreviewImageUrl: {itemInfo?.PreviewImageUrl}" ); } } } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs index 37640a1..cf15820 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs @@ -438,17 +438,6 @@ internal bool AddRequiredKeyValueTag( UGCQueryHandle_t handle, [MarshalAs( Unman return returnValue; } - #region FunctionMeta - [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_RequestUGCDetails", CallingConvention = Platform.CC)] - private static extern SteamAPICall_t _RequestUGCDetails( IntPtr self, PublishedFileId nPublishedFileID, uint unMaxAgeSeconds ); - - #endregion - internal CallResult RequestUGCDetails( PublishedFileId nPublishedFileID, uint unMaxAgeSeconds ) - { - var returnValue = _RequestUGCDetails( Self, nPublishedFileID, unMaxAgeSeconds ); - return new CallResult( returnValue, IsServer ); - } - #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_CreateItem", CallingConvention = Platform.CC)] private static extern SteamAPICall_t _CreateItem( IntPtr self, AppId nConsumerAppId, WorkshopFileType eFileType ); diff --git a/Facepunch.Steamworks/Structs/UgcItem.cs b/Facepunch.Steamworks/Structs/UgcItem.cs index bd93fa0..640a0a4 100644 --- a/Facepunch.Steamworks/Structs/UgcItem.cs +++ b/Facepunch.Steamworks/Structs/UgcItem.cs @@ -217,10 +217,15 @@ public float DownloadAmount public static async Task GetAsync( PublishedFileId id, int maxageseconds = 60 * 30 ) { - var result = await SteamUGC.Internal.RequestUGCDetails( id, (uint) maxageseconds ); - if ( !result.HasValue ) return null; + var file = await Steamworks.Ugc.Query.All + .WithFileId( id ) + .WithLongDescription( true ) + .GetPageAsync( 1 ); - return From( result.Value.Details ); + if ( !file.HasValue ) return null; + if ( file.Value.ResultCount == 0 ) return null; + + return file.Value.Entries.First(); } internal static Item From( SteamUGCDetails_t details ) diff --git a/Generator/Cleanup.cs b/Generator/Cleanup.cs index 3a6f24f..f30bb78 100644 --- a/Generator/Cleanup.cs +++ b/Generator/Cleanup.cs @@ -166,6 +166,8 @@ internal static bool IsDeprecated( string name ) return true; } + if ( name == "ISteamUGC.RequestUGCDetails" ) return true; + return false; }