mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-25 14:15:47 +03:00
ISteamUGC.RequestUGCDetails is deprecated
This commit is contained in:
parent
abb4b7f6b6
commit
0beaeb2e9d
@ -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}" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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 );
|
||||
|
@ -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 )
|
||||
|
@ -166,6 +166,8 @@ internal static bool IsDeprecated( string name )
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( name == "ISteamUGC.RequestUGCDetails" ) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user