Skip to content

Commit

Permalink
Merge pull request #615 from xPaw/xpaw/depot-manifests
Browse files Browse the repository at this point in the history
Expose more fields in DepotManifest
  • Loading branch information
azuisleet authored Dec 17, 2018
2 parents a12aad9 + 5ce2929 commit df0d048
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions SteamKit2/SteamKit2/Types/DepotManifest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,26 @@ internal FileData(string filename, EDepotFileFlag flag, ulong size, byte[] hash,
/// <c>true</c> if the filenames are encrypted; otherwise, <c>false</c>.
/// </value>
public bool FilenamesEncrypted { get; private set; }
/// <summary>
/// Gets the depot id.
/// </summary>
public uint DepotID { get; private set; }
/// <summary>
/// Gets the manifest id.
/// </summary>
public ulong ManifestGID { get; private set; }
/// <summary>
/// Gets the depot creation time.
/// </summary>
public DateTime CreationTime { get; private set; }
/// <summary>
/// Gets the total uncompressed size of all files in this depot.
/// </summary>
public ulong TotalUncompressedSize { get; private set; }
/// <summary>
/// Gets the total compressed size of all files in this depot.
/// </summary>
public ulong TotalCompressedSize { get; private set; }


internal DepotManifest(byte[] data)
Expand Down Expand Up @@ -239,6 +259,11 @@ void ParseBinaryManifest(Steam3Manifest manifest)
{
Files = new List<FileData>( manifest.Mapping.Count );
FilenamesEncrypted = manifest.AreFileNamesEncrypted;
DepotID = manifest.DepotID;
ManifestGID = manifest.ManifestGID;
CreationTime = manifest.CreationTime;
TotalUncompressedSize = manifest.TotalUncompressedSize;
TotalCompressedSize = manifest.TotalCompressedSize;

foreach (var file_mapping in manifest.Mapping)
{
Expand Down Expand Up @@ -273,6 +298,11 @@ void ParseProtobufManifestPayload(ContentManifestPayload payload)
void ParseProtobufManifestMetadata(ContentManifestMetadata metadata)
{
FilenamesEncrypted = metadata.filenames_encrypted;
DepotID = metadata.depot_id;
ManifestGID = metadata.gid_manifest;
CreationTime = DateUtils.DateTimeFromUnixTime( metadata.creation_time );
TotalUncompressedSize = metadata.cb_disk_original;
TotalCompressedSize = metadata.cb_disk_compressed;
}
}
}

0 comments on commit df0d048

Please sign in to comment.