mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-25 06:05:46 +03:00
UgcItem Downloaded time
This commit is contained in:
parent
886d9995ee
commit
f91eee68a9
@ -77,9 +77,6 @@ public static bool Download( PublishedFileId fileId, bool highPriority = false )
|
||||
|
||||
progress?.Invoke( 0.0f );
|
||||
|
||||
if ( Download( fileId, true ) == false )
|
||||
return item.IsInstalled;
|
||||
|
||||
// Steam docs about Download:
|
||||
// If the return value is true then register and wait
|
||||
// for the Callback DownloadItemResult_t before calling
|
||||
@ -96,6 +93,9 @@ public static bool Download( PublishedFileId fileId, bool highPriority = false )
|
||||
onDownloadStarted = r => downloadStarted = true;
|
||||
OnDownloadItemResult += onDownloadStarted;
|
||||
|
||||
if ( Download( fileId, true ) == false )
|
||||
return item.IsInstalled;
|
||||
|
||||
while ( downloadStarted == false )
|
||||
{
|
||||
if ( ct.IsCancellationRequested )
|
||||
|
@ -206,6 +206,22 @@ public long SizeBytes
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Time when the last update was downloaded
|
||||
/// </summary>
|
||||
public DateTime Downloaded
|
||||
{
|
||||
get
|
||||
{
|
||||
ulong size = 0;
|
||||
uint ts = 0;
|
||||
if ( !SteamUGC.Internal.GetItemInstallInfo( Id, ref size, out _, ref ts ) )
|
||||
return default;
|
||||
|
||||
return Epoch.ToDateTime( ts );
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// If we're downloading our current progress as a delta betwen 0-1
|
||||
/// </summary>
|
||||
|
Loading…
Reference in New Issue
Block a user