public FObjectExport(IAssetConverter converter) { FPackageFileSummary?summ = converter.GetSummary(); using (BinaryReader br = new BinaryReader(converter.GetAssetStream(), Encoding.UTF8, true)) { this.ClassIndex = br.ReadInt32(); this.SuperIndex = br.ReadInt32(); if (summ.GetUE4Version() >= 508) { this.TemplateIndex = br.ReadInt32(); } FObjectResource resource = new FObjectResource(converter); this.Index = resource.Index; this.ObjectName = resource.ObjectName; this.ObjectFlags = (EObjectFlags)br.ReadInt32(); if (summ.GetUE4Version() >= 511) { this.SerialSize = br.ReadInt64(); this.SerialOffset = br.ReadInt64(); } else { this.SerialSize = br.ReadInt32(); this.SerialOffset = br.ReadInt32(); } this.ExportFileOffset = SerialOffset - summ.TotalSize; this.IsForcedExport = br.ReadInt32() != 0; this.IsNotForClient = br.ReadInt32() != 0; this.IsNotForServer = br.ReadInt32() != 0; this.PackageGuid = new FGuid(converter.GetAssetStream()); this.PackageFlags = (EPackageFlags)br.ReadInt32(); if (summ.GetUE4Version() >= 365) { this.IsNotAlwaysLoadedForEditorGame = br.ReadInt32() != 0; } if (summ.GetUE4Version() >= 485) { this.IsAsset = br.ReadInt32() != 0; } if (summ.GetUE4Version() >= 507) { this.FirstExportDependency = br.ReadInt32(); this.SerializationBeforeSerializationDependencies = br.ReadInt32(); this.CreateBeforeSerializationDependencies = br.ReadInt32(); this.SerializationBeforeCreateDependencies = br.ReadInt32(); this.CreateBeforeCreateDependencies = br.ReadInt32(); } } }
public void DeserializePropertyTagValue(IAssetConverter converter) { using (BinaryReader br = new BinaryReader(converter.GetExportStream(), Encoding.UTF8, true)) { this.Value = br.ReadSingle(); } }
public byte[] SerializePropertyTagData(IAssetConverter converter) { byte[] bytes = new byte[16]; int i = 0; foreach (FNameEntrySerialized name in converter.GetNameMap()) { if (name.Name.Equals(this.KeyType)) { Array.Copy(BitConverter.GetBytes(i), bytes, 4); break; } i++; } Array.Copy(BitConverter.GetBytes(this.KeyType.NameCount), 0, bytes, 4, 4); foreach (FNameEntrySerialized name in converter.GetNameMap()) { if (name.Name.Equals(this.ValueType)) { Array.Copy(BitConverter.GetBytes(i), 0, bytes, 8, 4); break; } i++; } Array.Copy(BitConverter.GetBytes(this.ValueType.NameCount), 0, bytes, 12, 4); return(bytes); }
#pragma warning restore CS8618 // Non-nullable field is uninitialized. Consider declaring as nullable. public FObjectResource(IAssetConverter converter) { using (BinaryReader br = new BinaryReader(converter.GetAssetStream(), Encoding.UTF8, true)) { this.Index = br.ReadInt32(); this.ObjectName = new FName(converter.GetNameMap(), converter.GetAssetStream()); } }
public byte[] SerializePropertyTagValue(IAssetConverter converter) { byte[] bytes = new byte[12]; Array.Copy(BitConverter.GetBytes(this.X), 0, bytes, 0, 4); Array.Copy(BitConverter.GetBytes(this.Y), 0, bytes, 4, 4); Array.Copy(BitConverter.GetBytes(this.Z), 0, bytes, 8, 4); return(bytes); }
//TODO: When deserializing StructProperty arrays, invalid data may occur. Must fix, unsure how at this time /** * Comment Author: Nick Kennedy * Date: 12 October 2020 **/ public void DeserializePropertyTagValue(IAssetConverter converter) { using (BinaryReader br = new BinaryReader(converter.GetExportStream(), Encoding.UTF8, true)) { this.Count = br.ReadInt32(); for (int i = 0; i < this.Count; i++) { Properties.Add(converter.GetValueProperties(this.ArrayType.Name)); } } }
public AssetController(ILogger <AssetController> logger, IAssetRepository assetRepository, ICsvAssetReader csvAssetReader, IAssetConverter assetConverter, IAssetSearchPredicateConverter assetSearchPredicateConverter, IBatchRepository batchRepository) { this.logger = logger; this.assetRepository = assetRepository; this.csvAssetReader = csvAssetReader; this.assetConverter = assetConverter; this.assetSearchPredicateConverter = assetSearchPredicateConverter; this.batchRepository = batchRepository; }
public FObjectImport(IAssetConverter converter) { using (BinaryReader br = new BinaryReader(converter.GetAssetStream(), Encoding.UTF8, true)) { this.ClassPackage = new FName(converter.GetNameMap(), converter.GetAssetStream()); this.ClassName = new FName(converter.GetNameMap(), converter.GetAssetStream()); FObjectResource resource = new FObjectResource(converter); this.Index = resource.Index; this.ObjectName = resource.ObjectName; } }
public byte[] SerializePropertyTagData(IAssetConverter converter) { byte[] bytes = new byte[24]; int i = 0; foreach (FNameEntrySerialized name in converter.GetNameMap()) { if (name.Name.Equals(this.StructType)) { Array.Copy(BitConverter.GetBytes(i), bytes, 4); break; } i++; } Array.Copy(BitConverter.GetBytes(this.StructType.NameCount), 0, bytes, 4, 4); Array.Copy(BitConverter.GetBytes(this.Guid.A), 0, bytes, 8, 4); Array.Copy(BitConverter.GetBytes(this.Guid.B), 0, bytes, 12, 4); Array.Copy(BitConverter.GetBytes(this.Guid.C), 0, bytes, 16, 4); Array.Copy(BitConverter.GetBytes(this.Guid.D), 0, bytes, 20, 4); return(bytes); }
public void DeserializePropertyTagValue(IAssetConverter converter) { using (BinaryReader br = new BinaryReader(converter.GetExportStream(), Encoding.UTF8, true)) { int tableIndex = br.ReadInt32(); if (tableIndex < 0) { FObjectImport import = converter.GetImportMap()[tableIndex * -1 - 1]; this.Value = new FName($"{import.ObjectName.Name} : {import.ClassPackage.Name}/{import.ClassName.Name}") { NameCount = import.ObjectName.NameCount }; } else if (tableIndex > 0) { this.Value = converter.GetExportMap()[tableIndex - 1].ObjectName; } else { this.Value = new FName("UObject"); } } }
public void DeserializePropertyTagValue(IAssetConverter converter) { throw new NotImplementedException(); }
public byte[] SerializePropertyTagValue(IAssetConverter converter) { return(new byte[] { this.Value }); }
public void DeserializePropertyTagData(IAssetConverter converter) { this.Name = new FName(converter.GetNameMap(), converter.GetExportStream()); }
public void DeserializePropertyTagValue(IAssetConverter converter) { this.Values = converter.GetValueProperties(this.StructType.Name); }
public byte[] SerializePropertyTagData(IAssetConverter converter) { return(new byte[] { (byte)(this.Value ? 0 : 1) }); }
public byte[] SerializePropertyTagData(IAssetConverter converter) { throw new NotImplementedException(); }
public byte[] SerializePropertyTagValue(IAssetConverter converter) { byte[] bytes = new byte[this.Str.Value.Length + 1]; Array.Copy(Encoding.UTF8.GetBytes(this.Str.Value), bytes, this.Str.Value.Length); return(bytes); }
public void DeserializePropertyTagValue(IAssetConverter converter) { this.Str = new FString(converter.GetExportStream()); }
public static void AddConverter(Type type, IAssetConverter converter) { AssetConverters.Add(type, converter); }
public byte[] SerializePropertyTagValue(IAssetConverter converter) { return(BitConverter.GetBytes(this.Value)); }
public byte[] SerializePropertyTagValue(IAssetConverter converter) { //TODO: Implement FGuid reading throw new NotImplementedException(); }