Beispiel #1
0
        static DB6Header ReadHeader(BinaryReader reader)
        {
            DB6Header header = new DB6Header();

            header.Signature       = reader.ReadStringFromChars(4);
            header.RecordCount     = reader.ReadUInt32();
            header.FieldCount      = reader.ReadUInt32();
            header.RecordSize      = reader.ReadUInt32();
            header.StringTableSize = reader.ReadUInt32(); // also offset for sparse table

            header.TableHash  = reader.ReadUInt32();
            header.LayoutHash = reader.ReadUInt32(); // 21737: changed from build number to layoutHash

            header.MinId         = reader.ReadInt32();
            header.MaxId         = reader.ReadInt32();
            header.Locale        = reader.ReadInt32();
            header.CopyTableSize = reader.ReadInt32();
            header.Flags         = reader.ReadUInt16();
            header.IndexField    = reader.ReadUInt16();

            header.TotalFieldCount = reader.ReadUInt32();
            header.CommonDataSize  = reader.ReadUInt32();

            for (int i = 0; i < header.FieldCount; i++)
            {
                header.columnMeta.Add(new DB6Header.FieldEntry()
                {
                    UnusedBits = reader.ReadInt16(), Offset = (short)(reader.ReadInt16() + (header.HasIndexTable() ? 4 : 0))
                });
            }

            if (header.HasIndexTable())
            {
                header.FieldCount++;
                header.columnMeta.Insert(0, new DB6Header.FieldEntry());
            }

            return(header);
        }
Beispiel #2
0
        static void ReadHeader(BinaryReader reader)
        {
            Header                 = new DB6Header();
            Header.Signature       = reader.ReadUInt32();
            Header.RecordCount     = reader.ReadUInt32();
            Header.FieldCount      = reader.ReadUInt32();
            Header.RecordSize      = reader.ReadUInt32();
            Header.StringTableSize = reader.ReadUInt32(); // also offset for sparse table

            Header.TableHash       = reader.ReadUInt32();
            Header.LayoutHash      = reader.ReadUInt32();
            Header.MinId           = reader.ReadInt32();
            Header.MaxId           = reader.ReadInt32();
            Header.Locale          = reader.ReadInt32();
            Header.CopyTableSize   = reader.ReadInt32();
            Header.Flags           = (HeaderFlags)reader.ReadUInt16();
            Header.IdIndex         = reader.ReadUInt16();
            Header.TotalFieldCount = reader.ReadUInt32();

            Header.BitpackedDataOffset  = reader.ReadUInt32();
            Header.LookupColumnCount    = reader.ReadUInt32();
            Header.OffsetTableOffset    = reader.ReadUInt32();
            Header.IdListSize           = reader.ReadUInt32();
            Header.ColumnMetaSize       = reader.ReadUInt32();
            Header.CommonDataSize       = reader.ReadUInt32();
            Header.PalletDataSize       = reader.ReadUInt32();
            Header.RelationshipDataSize = reader.ReadUInt32();

            //Gather field structures
            FieldStructure = new List <FieldStructureEntry>();
            for (int i = 0; i < Header.FieldCount; i++)
            {
                var field = new FieldStructureEntry(reader.ReadInt16(), reader.ReadUInt16());
                FieldStructure.Add(field);
            }
        }