internal PICSProductInfo(CMsgClientPICSProductInfoResponse.PackageInfo package_info) { this.ID = package_info.packageid; this.ChangeNumber = package_info.change_number; this.MissingToken = package_info.missing_token; this.SHAHash = package_info.sha; this.KeyValues = new KeyValue(); if (package_info.buffer != null) { using (MemoryStream ms = new MemoryStream(package_info.buffer)) using (var br = new BinaryReader(ms)) { br.ReadUInt32(); this.KeyValues.ReadAsBinary(ms); } } }
internal PICSProductInfo(CMsgClientPICSProductInfoResponse.PackageInfo package_info) { this.ID = package_info.packageid; this.ChangeNumber = package_info.change_number; this.MissingToken = package_info.missing_token; this.SHAHash = package_info.sha; this.KeyValues = new KeyValue(); if (package_info.buffer != null) { using (MemoryStream ms = new MemoryStream(package_info.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(); this.KeyValues.TryReadAsBinary(ms); } } }