internal Package(CMsgClientPackageInfoResponse.Package pack, Package.PackageStatus status) { Status = status; PackageID = pack.package_id; ChangeNumber = pack.change_number; Hash = pack.sha; Data = new KeyValue(); using (var ms = new MemoryStream(pack.buffer)) using (var br = new BinaryReader(ms)) { br.ReadUInt32(); // unknown uint at the beginning of the buffer Data.ReadAsBinary(ms); } }
internal Package(CMsgClientPackageInfoResponse.Package pack, Package.PackageStatus status) { Status = status; PackageID = pack.package_id; ChangeNumber = pack.change_number; Hash = pack.sha; Data = new KeyValue(); using (var ms = new MemoryStream(pack.buffer)) using (var br = new BinaryReader(ms)) { // steamclient checks this value == 1 before it attempts to read the KV from the buffer // see: CPackageInfo::UpdateFromBuffer(CSHA const&,uint,CUtlBuffer &) // todo: we've apparently ignored this with zero ill effects, but perhaps we want to respect it? br.ReadUInt32(); Data.TryReadAsBinary(ms); } }