Exemplo n.º 1
0
        internal void Read(IBitReader reader)
        {
            reader.PushFrameLength(24);

            this._Unknown1 = reader.ReadUInt32();

            // probably a primitive type
            {
                reader.PushFrameLength(24);

                reader.ReadBytes(this._Unknown2);
                reader.ReadBytes(this._Unknown3);
                reader.ReadBytes(this._Unknown4);
                reader.ReadBytes(this._Unknown5);
                this._Unknown6 = reader.ReadUInt32();
                this._Unknown7 = reader.ReadUInt32();

                // probably another primitive type
                {
                    var unknown8Length = reader.ReadUInt32();
                    this._Unknown8 = reader.ReadBytes((int)unknown8Length);
                }

                reader.PopFrameLength();
            }

            reader.PopFrameLength();
        }
Exemplo n.º 2
0
 public override void Read(IBitReader reader, ushort version)
 {
     base.Read(reader, version);
     this._Unknown        = reader.ReadGuid();
     this._HeadId         = reader.ReadUInt32();
     this._HairstyleIndex = reader.ReadUInt32();
 }
Exemplo n.º 3
0
 public override void Read(IBitReader reader, ushort version)
 {
     base.Read(reader, version);
     reader.ReadBytes(this._Unknown1);
     this._HeadId   = reader.ReadUInt32();
     this._Unknown2 = reader.ReadUInt32();
 }
        internal void Read(IBitReader reader)
        {
            reader.PushFrameLength(24);
            this._Unknown1.Clear();
            var unknown1Count = reader.ReadUInt16();

            for (int i = 0; i < unknown1Count; i++)
            {
                reader.PushFrameLength(24);
                var unknown1Key   = reader.ReadUInt32();
                var unknown1Value = reader.ReadBytes(16);
                reader.PopFrameLength();
                this._Unknown1.Add(new KeyValuePair <uint, byte[]>(unknown1Key, unknown1Value));
            }
            this._Unknown2.Clear();
            var unknown2Count = reader.ReadUInt16();

            for (int i = 0; i < unknown2Count; i++)
            {
                reader.PushFrameLength(24);
                var unknown2Key   = reader.ReadUInt32();
                var unknown2Value = reader.ReadBytes(16);
                reader.PopFrameLength();
                this._Unknown2.Add(new KeyValuePair <uint, byte[]>(unknown2Key, unknown2Value));
            }
            reader.PopFrameLength();
        }
Exemplo n.º 5
0
 private Corpse(IBitReader reader, uint version)
 {
     Unk0x0   = reader.ReadUInt32();
     X        = reader.ReadUInt32();
     Y        = reader.ReadUInt32();
     ItemList = ItemList.Read(reader, version);
 }
 internal void Read(IBitReader reader)
 {
     this._Unknown1 = reader.ReadUInt16();
     this._Unknown2.Clear();
     this._Unknown3.Clear();
     this._Unknown4.Clear();
     if (this._Unknown1 >= 1)
     {
         var unknown2Count = reader.ReadUInt16();
         for (int i = 0; i < unknown2Count; i++)
         {
             this._Unknown2.Add(reader.ReadUInt32());
         }
         var unknown3Count = reader.ReadUInt16();
         for (int i = 0; i < unknown3Count; i++)
         {
             this._Unknown3.Add(reader.ReadUInt32());
         }
     }
     if (this._Unknown1 >= 2)
     {
         var unknown4Count = reader.ReadUInt16();
         for (int i = 0; i < unknown4Count; i++)
         {
             this._Unknown4.Add(reader.ReadUInt32());
         }
     }
 }
 internal void Read(IBitReader reader, ushort version)
 {
     reader.PushFrameLength(24);
     this._Unknown1 = reader.ReadUInt32();
     this._Unknown2 = reader.ReadUInt32();
     reader.PopFrameLength();
 }
Exemplo n.º 8
0
        public override void Read(IBitReader reader, ushort version)
        {
            base.Read(reader, version);
            this._LayoutSignature = reader.ReadUInt32();
            var packedDataLength = reader.ReadUInt32();

            this._PackedData = reader.ReadBytes((int)packedDataLength);
        }
Exemplo n.º 9
0
 internal void Read(IBitReader reader)
 {
     reader.PushFrameLength(24);
     reader.ReadBytes(this._Unknown1);
     this._Unknown2 = reader.ReadUInt32();
     this._Unknown3 = reader.ReadUInt32();
     this._Unknown4 = reader.ReadUInt32();
     reader.PopFrameLength();
 }
 internal void Read(IBitReader reader)
 {
     reader.PushFrameLength(24);
     this._Unknown1 = reader.ReadUInt32();
     this._Unknown2 = reader.ReadBoolean();
     this._Unknown3 = reader.ReadUInt32();
     // TODO(gibbed): figure out what this actually
     this._Unknown4 = reader.ReadBytes(Math.Max(1, (int)((this._Unknown3 + 31) >> 5)) * 4);
     reader.PopFrameLength();
 }
 internal void Read(IBitReader reader)
 {
     reader.PushFrameLength(24);
     this._Id = reader.ReadUInt32();
     if (this._Id != 0)
     {
         this._Unknown1 = reader.ReadUInt32();
         this._Unknown2 = reader.ReadUInt32();
         this._Unknown3 = reader.ReadUInt32();
     }
     reader.PopFrameLength();
 }
Exemplo n.º 12
0
    public static Header Read(IBitReader reader)
    {
        var header = new Header
        {
            Magic    = reader.ReadUInt32(),
            Version  = reader.ReadUInt32(),
            Filesize = reader.ReadUInt32(),
            Checksum = reader.ReadUInt32()
        };

        return(header);
    }
Exemplo n.º 13
0
 internal void Read(IBitReader reader, ushort version)
 {
     reader.PushFrameLength(24);
     this._Unknown1 = reader.ReadUInt32();
     this._Unknown2.Read(reader, version);
     if (version >= 4)
     {
         this._Unknown3 = reader.ReadString();
     }
     this._Unknown4 = reader.ReadUInt32();
     reader.PopFrameLength();
 }
 public override void Read(IBitReader reader, ushort version)
 {
     if (version >= 1)
     {
         reader.PushFrameLength(24);
         this._Unknown5 = reader.ReadUInt32();
         this._Unknown6 = reader.ReadUInt32();
         this._Unknown7 = reader.ReadBoolean();
         this._Unknown8 = reader.ReadUInt32();
         reader.PopFrameLength();
     }
     base.Read(reader, version);
 }
Exemplo n.º 15
0
    public static Mercenary Read(IBitReader reader)
    {
        var mercenary = new Mercenary
        {
            IsDead     = reader.ReadUInt16(),
            Id         = reader.ReadUInt32(),
            NameId     = reader.ReadUInt16(),
            TypeId     = reader.ReadUInt16(),
            Experience = reader.ReadUInt32()
        };

        return(mercenary);
    }
Exemplo n.º 16
0
        public void Read(IBitReader reader, int version)
        {
            this._Unknown1 = reader.ReadUInt32();
            this._Unknown2 = version >= 10 && reader.ReadBoolean();

            for (int i = 0; i < this._PowerIds.Length; i++)
            {
                this._PowerIds[i] = reader.ReadUInt32();
            }

            for (int i = 0; i < this._RangedWeaponIds.Length; i++)
            {
                this._RangedWeaponIds[i] = reader.ReadUInt32();
            }

            this._MeleeWeaponId = reader.ReadUInt32();

            for (int i = 0; i < this._GearIds.Length; i++)
            {
                this._GearIds[i] = reader.ReadUInt32();
            }

            for (int i = 0; i < this._SpaceToolIds.Length; i++)
            {
                this._SpaceToolIds[i] = reader.ReadUInt32();
            }

            for (int i = 0; i < this._ConsumableIds.Length; i++)
            {
                this._ConsumableIds[i] = reader.ReadUInt32();
            }

            this._CasualOutfitId = reader.ReadUInt32();
        }
Exemplo n.º 17
0
        public static ItemData ReadItemData(IBitReader reader, ushort version)
        {
            if (version < 6)
            {
                throw new NotSupportedException();
            }

            var unknown1      = reader.ReadUInt32();
            var partitionName = reader.ReadString();

            ItemDefinition itemDefinition;

            partitionName = partitionName.ToLowerInvariant();
            if (InfoManager.Items.TryGetValue(partitionName, out itemDefinition) == false)
            {
                throw new NotSupportedException();
            }

            var itemData = ItemDataFactory.Create(itemDefinition.Type);

            itemData.Unknown1      = unknown1;
            itemData.PartitionName = partitionName;
            itemData.Definition    = itemDefinition;
            itemData.Read(reader, version);
            return(itemData);
        }
Exemplo n.º 18
0
        public void Read(IBitReader reader, ushort version)
        {
            this._ReadVersion = version;
            var count = reader.ReadUInt16();

            for (int i = 0; i < count; i++)
            {
                reader.PushFrameLength(24);
                RawItemData itemData;
                itemData.Id         = reader.ReadUInt32();
                itemData.DataLength = (int)reader.ReadUInt32(24);
                itemData.DataBytes  = reader.ReadBits(itemData.DataLength);
                this._Items.Add(itemData);
                reader.PopFrameLength();
            }
        }
Exemplo n.º 19
0
        internal override void Read4(IBitReader reader)
        {
            base.Read4(reader);
            var unknown1Count = reader.ReadUInt16();

            this._Unknown.Clear();
            for (int i = 0; i < unknown1Count; i++)
            {
                reader.PushFrameLength(24);
                var unknown1Key         = reader.ReadUInt32();
                var unknown1ValueLength = reader.ReadUInt32();
                var unknown1Value       = reader.ReadBytes((int)unknown1ValueLength);
                reader.PopFrameLength();
                this._Unknown.Add(new KeyValuePair <uint, byte[]>(unknown1Key, unknown1Value));
            }
        }
Exemplo n.º 20
0
 internal void Read(IBitReader reader)
 {
     reader.PushFrameLength(24);
     this._Unknown1 = reader.ReadUInt32();
     this._Unknown2 = reader.ReadBoolean();
     reader.PopFrameLength();
 }
Exemplo n.º 21
0
        internal void Read(IBitReader reader)
        {
            reader.PushFrameLength(24);
            this._Unknown1 = reader.ReadFloat32();
            this._Unknown2 = reader.ReadUInt32();
            this._Unknown3.Clear();
            var unknown3Count = reader.ReadUInt16();

            for (int i = 0; i < unknown3Count; i++)
            {
                var unknown3 = new EventTrackerUnknown2();
                unknown3.Read(reader);
                this._Unknown3.Add(unknown3);
            }
            this._Unknown4.Clear();
            var unknown4Count = reader.ReadUInt16();

            for (int i = 0; i < unknown4Count; i++)
            {
                var unknown4 = new EventTrackerUnknown2();
                unknown4.Read(reader);
                this._Unknown4.Add(unknown4);
            }
            reader.PopFrameLength();
        }
        private static void ReadAgentData(IBitReader reader,
                                          Dictionary <byte, Agent> agents,
                                          Dictionary <byte, uint[]> agentDataOffsets,
                                          byte index,
                                          ReadAgentDataAction action)
        {
            foreach (var kv in agentDataOffsets)
            {
                var agent   = agents[kv.Key];
                var offsets = kv.Value;

                if (offsets[index] == 0)
                {
                    continue;
                }

                reader.Position = (int)offsets[index];

                /*
                 * reader.PushFrameLength(24);
                 * action(reader, agent);
                 * reader.PopFrameLength();
                 */

                var length       = reader.ReadUInt32(24);
                var dataPosition = reader.Position;
                var dataBytes    = reader.ReadBits((int)length);
                //File.WriteAllBytes("agent_" + kv.Key + "_" + index + "_IN.bin", dataBytes);
                var dataReader = new BitReader(dataBytes, dataPosition);
                action(dataReader, agent);
            }
        }
Exemplo n.º 23
0
 public override void Read(IBitReader reader, ushort version)
 {
     this._Unknown5 = reader.ReadUInt16();
     this._Unknown6 = reader.ReadUInt16();
     this._Unknown7 = reader.ReadUInt16();
     this._Unknown8 = version < 8 ? 0 : reader.ReadUInt32();
     base.Read(reader, version);
 }
Exemplo n.º 24
0
    public static QuestsSection Read(IBitReader reader)
    {
        var questSection = new QuestsSection
        {
            Magic   = reader.ReadUInt32(),
            Header  = reader.ReadUInt32(),
            Version = reader.ReadUInt32(),
            Length  = reader.ReadUInt16()
        };

        for (int i = 0; i < questSection._difficulties.Length; i++)
        {
            questSection._difficulties[i] = QuestsDifficulty.Read(reader);
        }

        return(questSection);
    }
        internal override void Read4(IBitReader reader)
        {
            base.Read4(reader);
            this._Unknown1 = reader.ReadUInt16();
            reader.PushFrameLength(24);
            var unknown2Count = reader.ReadUInt16();

            this._Unknown2.Clear();
            for (int i = 0; i < unknown2Count; i++)
            {
                reader.PushFrameLength(24);
                var unknown2Key   = reader.ReadUInt32();
                var unknown2Value = reader.ReadUInt32();
                reader.PopFrameLength();
                this._Unknown2.Add(new KeyValuePair <uint, uint>(unknown2Key, unknown2Value));
            }
            reader.PopFrameLength();
        }
        internal override void Read1(IBitReader reader, ushort arg1)
        {
            base.Read1(reader, arg1);

            if (arg1 < 2)
            {
                this._Unknown1 = reader.ReadUInt32();
            }
        }
Exemplo n.º 27
0
    public static Skill Read(IBitReader reader)
    {
        var skill = new Skill
        {
            Id = reader.ReadUInt32()
        };

        return(skill);
    }
Exemplo n.º 28
0
        internal void Read(IBitReader reader, uint version)
        {
            reader.PushFrameLength(24);
            var dataBytesLength = reader.ReadUInt32();

            this._DataBytes = reader.ReadBytes((int)dataBytesLength);
            this._Unknown1  = version >= 6 && reader.ReadBoolean();
            this._Unknown2  = version >= 6 && reader.ReadBoolean();
            reader.PopFrameLength();
        }
Exemplo n.º 29
0
 public void Read(IBitReader reader)
 {
     reader.PushFrameLength(24);
     this._Unknown1 = reader.ReadUInt32();
     for (int i = 0; i < 5; i++)
     {
         this._Healths[i].Read(reader);
     }
     reader.PopFrameLength();
 }
Exemplo n.º 30
0
        private static void ReadList(IBitReader reader, List <KeyValuePair <Guid, uint> > list, ushort version)
        {
            if (list == null)
            {
                throw new ArgumentNullException("list");
            }

            list.Clear();
            if (version >= 1)
            {
                var count = reader.ReadUInt32();
                for (int i = 0; i < count; i++)
                {
                    var key   = reader.ReadGuid();
                    var value = reader.ReadUInt32();
                    list.Add(new KeyValuePair <Guid, uint>(key, value));
                }
            }
        }