ISteamUGC.RequestUGCDetails is deprecated

This commit is contained in:
Garry Newman 2020-03-31 08:34:51 +01:00
parent abb4b7f6b6
commit 0beaeb2e9d
4 changed files with 11 additions and 14 deletions

View File

@ -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}" );
}
}
}

View File

@ -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<SteamUGCRequestUGCDetailsResult_t> RequestUGCDetails( PublishedFileId nPublishedFileID, uint unMaxAgeSeconds )
{
var returnValue = _RequestUGCDetails( Self, nPublishedFileID, unMaxAgeSeconds );
return new CallResult<SteamUGCRequestUGCDetailsResult_t>( 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 );

View File

@ -217,10 +217,15 @@ public float DownloadAmount
public static async Task<Item?> 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 )

View File

@ -166,6 +166,8 @@ internal static bool IsDeprecated( string name )
return true;
}
if ( name == "ISteamUGC.RequestUGCDetails" ) return true;
return false;
}