public ArkArrayString(ArkArchive archive, int dataSize) { var size = archive.GetInt(); for (int n = 0; n < size; n++) { Add(archive.GetString()); } }
public PropertyStr(ArkArchive archive, PropertyArgs args, bool propertyIsExcluded = false) : base(archive, args, propertyIsExcluded) { if (propertyIsExcluded) { archive.SkipString(); return; } _value = archive.GetString(); }
public IExtraData Read(GameObject obj, ArkArchive archive, long length) { var shouldBeZero = archive.GetInt(); if (shouldBeZero != 0) { _logger.Warn($"Expected int after properties to be 0 but found {shouldBeZero} at {archive.Position - 4:X}"); } var structMapCount = archive.GetInt(); IList <IDictionary <string, StructPropertyList> > structMapList = new List <IDictionary <string, StructPropertyList> >(structMapCount); try { for (int structMapIndex = 0; structMapIndex < structMapCount; structMapIndex++) { var structCount = archive.GetInt(); IDictionary <string, StructPropertyList> structMap = new Dictionary <string, StructPropertyList>(); for (int structIndex = 0; structIndex < structCount; structIndex++) { var structName = archive.GetString(); StructPropertyList properties = new StructPropertyList(archive, null); var shouldBeZero2 = archive.GetInt(); if (shouldBeZero2 != 0) { _logger.Warn($"Expected int after properties to be 0 but found {shouldBeZero2} at {archive.Position - 4:X}"); } structMap[structName] = properties; } structMapList.Add(structMap); } } catch (UnreadablePropertyException) { // Just stop reading and attach collected structs } ExtraDataFoliage extraDataFoliage = new ExtraDataFoliage(); extraDataFoliage.StructMapList = structMapList; return(extraDataFoliage); }
//public virtual int Size //{ // get // { // int size = ArkArchive.getStringLength(path) + 4; // if (data != null) // { // size += data.Length * 4; // foreach (sbyte[][] partData in data) // { // if (partData != null) // { // size += partData.Length * 4; // foreach (sbyte[] blobData in partData) // { // size += blobData.Length; // } // } // } // } // return size; // } //} public virtual void read(ArkArchive archive) { Path = archive.GetString(); var partCount = archive.GetInt(); Data = new sbyte[partCount][][]; for (var part = 0; part < partCount; part++) { var blobCount = archive.GetInt(); var partData = new sbyte[blobCount][]; for (var blob = 0; blob < blobCount; blob++) { var blobSize = archive.GetInt() * 4; // Array of 32 bit values partData[blob] = archive.GetBytes(blobSize); } Data[part] = partData; } }
public PropertyStr(ArkArchive archive, PropertyArgs args) : base(archive, args) { _value = archive.GetString(); }
public StructUniqueNetIdRepl(ArkArchive archive, ArkName structType) : base(structType) { Unk = archive.GetInt(); NetId = archive.GetString(); }