コード例 #1
0
        public ArkArrayString(ArkArchive archive, int dataSize)
        {
            var size = archive.GetInt();

            for (int n = 0; n < size; n++)
            {
                Add(archive.GetString());
            }
        }
コード例 #2
0
        public PropertyStr(ArkArchive archive, PropertyArgs args, bool propertyIsExcluded = false) : base(archive, args, propertyIsExcluded)
        {
            if (propertyIsExcluded)
            {
                archive.SkipString();
                return;
            }

            _value = archive.GetString();
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        //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;
            }
        }
コード例 #5
0
 public PropertyStr(ArkArchive archive, PropertyArgs args) : base(archive, args)
 {
     _value = archive.GetString();
 }
コード例 #6
0
 public StructUniqueNetIdRepl(ArkArchive archive, ArkName structType) : base(structType)
 {
     Unk   = archive.GetInt();
     NetId = archive.GetString();
 }