Esempio n. 1
0
 public override void Deserialize(BetterReader reader, string name)
 {
     base.Deserialize(reader, name);
     EmotionType    = (DialogResponseEmotionType)reader.ReadUInt32();
     EmotionValue   = reader.ReadUInt32();
     Unused1        = reader.ReadBytes(4);
     ResponseNumber = reader.ReadByte();
     Unused2        = reader.ReadBytes(3);
     Sound          = reader.ReadInt32();
     Flags          = (DialogResponseFlags)reader.ReadByte();
     Unused3        = reader.ReadBytes(3);
 }
Esempio n. 2
0
        public override void Deserialize(BetterReader reader, string name)
        {
            base.Deserialize(reader, name);

            Offset = reader.ReadSingle();

            Rows = new List <byte[]>();
            for (var i = 0; i < 33; i++)
            {
                Rows.Add(reader.ReadBytes(33));
            }

            Unused = reader.ReadBytes(3);
        }
Esempio n. 3
0
        public override void Deserialize(BetterReader reader, string name)
        {
            base.Deserialize(reader, name);

            NavigationMesh = reader.ReadUInt32();
            Unknown        = reader.ReadBytes(4);
        }
Esempio n. 4
0
 public override void Deserialize(BetterReader reader, string name)
 {
     base.Deserialize(reader, name);
     Type        = (DialogType)reader.ReadByte();
     NextSpeaker = (NextSpeaker)reader.ReadByte();
     Flags       = (INFOFlags)BitConverter.ToUInt16(reader.ReadBytes(2), 0);
 }
Esempio n. 5
0
        public override void Deserialize(BetterReader reader, string name)
        {
            base.Deserialize(reader, name);

            LinkedRoomsCount = reader.ReadUInt16();
            Unknown          = reader.ReadBytes(2);
        }
Esempio n. 6
0
        protected override void ExtractSubRecords(BetterReader reader, GameID gameID, uint size)
        {
            var bytes = reader.ReadBytes((int)size);
            var name  = string.Empty;

            using (var stream = new BetterMemoryReader(bytes))
            {
                var end = stream.Length;

                while (stream.Position < end)
                {
                    name = stream.ReadString(4);


                    switch (name)
                    {
                    case "EDID":
                        EDID = new STRSubRecord();
                        EDID.Deserialize(stream, name);
                        break;

                    case "OBND":
                        OBND = new OBNDSubRecord();
                        OBND.Deserialize(stream, name);
                        break;

                    case "MODL":
                        MODL = new STRSubRecord();
                        MODL.Deserialize(stream, name);
                        break;

                    case "MODB":
                        MODB = new BytesSubRecord();
                        MODB.Deserialize(stream, name);
                        break;

                    case "MODT":
                        MODT = new BytesSubRecord();
                        MODT.Deserialize(stream, name);
                        break;

                    case "MODS":
                        MODS = new MODSSubRecord();
                        MODS.Deserialize(stream, name);
                        break;

                    case "MODD":
                        MODD = new MODDSubRecord();
                        MODD.Deserialize(stream, name);
                        break;

                    default:
                        var rest = stream.ReadUInt16();
                        stream.ReadBytes(rest);
                        break;
                    }
                }
            }
        }
Esempio n. 7
0
        public override void Deserialize(BetterReader reader, string name)
        {
            base.Deserialize(reader, name);

            Reference = reader.ReadUInt32();
            Flags     = (REFR_XESPFlags)reader.ReadByte();
            Unknown   = reader.ReadBytes(3);
        }
Esempio n. 8
0
        public override void Deserialize(BetterReader reader, string name)
        {
            base.Deserialize(reader, name);

            Faction = reader.ReadUInt32();
            Rank    = reader.ReadByte();
            Unused  = reader.ReadBytes(3);
        }
Esempio n. 9
0
        public override void Deserialize(BetterReader reader, string name)
        {
            base.Deserialize(reader, name);

            Level  = reader.ReadByte();
            Unused = reader.ReadBytes(3);
            Key    = reader.ReadUInt32();
            if (Size == 12)
            {
                Unknown = reader.ReadBytes(4);
            }
            else if (Size == 16)
            {
                Unknown = reader.ReadBytes(8);
            }
            else if (Size == 20)
            {
                Unknown = reader.ReadBytes(12);
            }
        }
Esempio n. 10
0
        public override void Deserialize(BetterReader reader, string name)
        {
            base.Deserialize(reader, name);

            Unused        = reader.ReadBytes(4);
            RefCount      = reader.ReadUInt32();
            CompiledSize  = reader.ReadUInt32();
            VariableCount = reader.ReadUInt32();
            Type          = (SCHR_Types)reader.ReadUInt16();
            Flags         = (SCHR_Flags)reader.ReadUInt16();
        }
Esempio n. 11
0
        protected override void ExtractSubRecords(BetterReader reader, GameID gameID, uint size)
        {
            var bytes = reader.ReadBytes((int)size);
            var name  = string.Empty;

            using (var stream = new BetterMemoryReader(bytes))
            {
                var end = stream.Length;

                while (stream.Position < end)
                {
                    name = stream.ReadString(4);

                    switch (name)
                    {
                    case "EDID":
                        EDID = new STRSubRecord();
                        EDID.Deserialize(stream, name);
                        break;

                    case "QSTI":
                        var qsti = new FormID();
                        qsti.Deserialize(stream, name);
                        QSTI.Add(qsti);
                        break;

                    case "QSTR":
                        var qstr = new FormID();
                        qstr.Deserialize(stream, name);
                        QSTR.Add(qstr);
                        break;

                    case "FULL":
                        FULL = new STRSubRecord();
                        FULL.Deserialize(stream, name);
                        break;

                    case "PNAM":
                        PNAM = new FloatSubRecord();
                        PNAM.Deserialize(stream, name);
                        break;

                    case "DATA":
                        DATA = new DIAL_DATASubRecord();
                        DATA.Deserialize(stream, name);
                        break;

                    default:
                        break;
                    }
                }
            }
        }
Esempio n. 12
0
        protected override void ExtractSubRecords(BetterReader reader, GameID gameId, uint size)
        {
            var endRead = reader.Position + size;
            var name    = string.Empty;

            while (reader.Position < endRead)
            {
                name = reader.ReadString(4);

                switch (name)
                {
                case "HEDR":
                    Header = new HEDRSubRecord();
                    Header.Deserialize(reader, name);
                    break;

                case "OFST":
                    Offset = new BytesSubRecord();
                    Offset.Deserialize(reader, name);
                    break;

                case "DELE":
                    DELE = new BytesSubRecord();
                    DELE.Deserialize(reader, name);
                    break;

                case "CNAM":
                    Author = new STRSubRecord();
                    Author.Deserialize(reader, name);
                    break;

                case "SNAM":
                    Description = new STRSubRecord();
                    Description.Deserialize(reader, name);
                    break;

                case "MAST":
                    Master = new STRSubRecord();
                    Master.Deserialize(reader, name);
                    break;

                case "DATA":
                    FileSize = new UInt64SubRecord();
                    FileSize.Deserialize(reader, name);
                    break;

                default:
                    var dSize = reader.ReadInt16();
                    reader.ReadBytes(dSize);
                    break;
                }
            }
        }
Esempio n. 13
0
        public override void Deserialize(BetterReader reader, string name)
        {
            base.Deserialize(reader, name);

            XBound  = reader.ReadSingle();
            YBound  = reader.ReadSingle();
            ZBound  = reader.ReadSingle();
            Red     = reader.ReadSingle();
            Green   = reader.ReadSingle();
            Blue    = reader.ReadSingle();
            Unknown = reader.ReadBytes(4);
            Type    = (REFR_XPRMTypes)reader.ReadUInt32();
        }
Esempio n. 14
0
        public virtual void Deserialize(BetterReader reader, string name, GameID gameID)
        {
            type     = name;
            dataSize = reader.ReadUInt32();
            flags    = reader.ReadUInt32();
            id       = reader.ReadUInt32();
            revision = reader.ReadUInt32();

            if (gameID != GameID.Oblivion)
            {
                version = reader.ReadUInt16();
                unknow  = reader.ReadUInt16();
            }

            if (Deleted)
            {
                reader.ReadBytes((int)dataSize);
                return;
            }

            if (Compressed)
            {
                var decompSize     = (int)reader.ReadUInt32();
                var compressedData = reader.ReadBytes((int)dataSize - 4);

                Utils.LogBuffer("\t\tCompressed Data {0}", type);

                var decompressedData = Decompress(compressedData);
                using (var betterReader = new BetterMemoryReader(decompressedData))
                    ExtractSubRecords(betterReader, gameID, (uint)betterReader.Length);
            }
            else
            {
                ExtractSubRecords(reader, gameID, dataSize);
            }
        }
Esempio n. 15
0
        public override void Deserialize(BetterReader reader, string name)
        {
            base.Deserialize(reader, name);

            Records = new List <VTXTStruct>();

            var currentPosition = 0;

            while (currentPosition < Size)
            {
                Records.Add(new VTXTStruct
                {
                    Position = reader.ReadUInt16(),
                    Unused   = reader.ReadBytes(2),
                    Opacity  = reader.ReadSingle()
                });
                currentPosition += 8;
            }
        }
Esempio n. 16
0
        protected override void ExtractSubRecords(BetterReader reader, GameID gameID, uint size)
        {
            var bytes = reader.ReadBytes((int)size);
            var name  = string.Empty;

            using (var stream = new BetterMemoryReader(bytes))
            {
                var end = stream.Length;

                while (stream.Position < end)
                {
                    name = stream.ReadString(4);

                    switch (name)
                    {
                    case "EDID":
                        EDID = new STRSubRecord();
                        EDID.Deserialize(stream, name);
                        break;

                    case "DATA":
                        switch (EDID.Value[0])
                        {
                        case 's':
                            DATA = new STRSubRecord();
                            ((STRSubRecord)DATA).Deserialize(stream, name);
                            break;

                        case 'f':
                            DATA = new FloatSubRecord();
                            ((FloatSubRecord)DATA).Deserialize(stream, name);
                            break;

                        default:
                            DATA = new UInt32SubRecord();
                            ((UInt32SubRecord)DATA).Deserialize(stream, name);
                            break;
                        }
                        break;
                    }
                }
            }
        }
Esempio n. 17
0
 protected virtual void ExtractSubRecords(BetterReader reader, uint size)
 {
     reader.ReadBytes((int)size);
 }
Esempio n. 18
0
        protected override void ExtractSubRecords(BetterReader reader, GameID gameID, uint size)
        {
            var bytes = reader.ReadBytes((int)size);
            var name  = string.Empty;

            using (var stream = new BetterMemoryReader(bytes))
            {
                var end = stream.Length;

                while (stream.Position < end)
                {
                    name = stream.ReadString(4);

                    switch (name)
                    {
                    case "EDID":
                        EDID = new STRSubRecord();
                        EDID.Deserialize(stream, name);
                        break;

                    case "FULL":
                        FULL = new STRSubRecord();
                        FULL.Deserialize(stream, name);
                        break;

                    case "DATA":
                        DATA = new CELL_DATASubRecord();
                        DATA.Deserialize(stream, name);
                        break;

                    case "XCLL":
                        XCLL = new BytesSubRecord();
                        XCLL.Deserialize(stream, name);
                        break;

                    case "XCMT":
                        XCMT = new ByteSubRecord();
                        XCMT.Deserialize(stream, name);
                        break;

                    case "XGLB":
                        XGLB = new UInt32SubRecord();
                        XGLB.Deserialize(stream, name);
                        break;

                    case "XRNK":
                        XRNK = new UInt32SubRecord();
                        XRNK.Deserialize(stream, name);
                        break;

                    case "XCLW":
                        XCLW = new FloatSubRecord();
                        XCLW.Deserialize(stream, name);
                        break;

                    case "XCLC":
                        XCLC = new Vector2iSubRecord();
                        XCLC.Deserialize(stream, name);
                        break;


                    case "XCLR":
                        XCLR = new FormID();
                        XCLR.Deserialize(stream, name);
                        break;

                    case "XCIM":
                        XCIM = new FormID();
                        XCIM.Deserialize(stream, name);
                        break;

                    case "XEZN":
                        XEZN = new FormID();
                        XEZN.Deserialize(stream, name);
                        break;

                    case "XCCM":
                        XCCM = new FormID();
                        XCCM.Deserialize(stream, name);
                        break;

                    case "XCWT":
                        XCWT = new FormID();
                        XCWT.Deserialize(stream, name);
                        break;

                    case "XOWN":
                        XOWN = new FormID();
                        XOWN.Deserialize(stream, name);
                        break;

                    case "XCAS":
                        XCAS = new FormID();
                        XCAS.Deserialize(stream, name);
                        break;

                    case "XCMO":
                        XCMO = new FormID();
                        XCMO.Deserialize(stream, name);
                        break;

                    default:
                        var rest = stream.ReadUInt16();
                        stream.ReadBytes(rest);
                        break;
                    }
                }
            }
        }
Esempio n. 19
0
        protected override void ExtractSubRecords(BetterReader reader, GameID gameID, uint size)
        {
            var bytes = reader.ReadBytes((int)size);
            var name  = string.Empty;

            using (var stream = new BetterMemoryReader(bytes))
            {
                var end = stream.Length;

                while (stream.Position < end)
                {
                    name = stream.ReadString(4);

                    switch (name)
                    {
                    case "EDID":
                        EDID = new STRSubRecord();
                        EDID.Deserialize(stream, name);
                        break;

                    case "FULL":
                        FULL = new STRSubRecord();
                        FULL.Deserialize(stream, name);
                        break;

                    case "OBND":
                        OBND = new OBNDSubRecord();
                        OBND.Deserialize(stream, name);
                        break;

                    case "MODL":
                        MODL = new STRSubRecord();
                        MODL.Deserialize(stream, name);
                        break;

                    case "ACBS":
                        ACBS = new ACBSSubRecord();
                        ACBS.Deserialize(stream, name);
                        break;

                    case "SNAM":
                        var snam = new SNAMSubRecord();
                        snam.Deserialize(stream, name);
                        SNAM.Add(snam);
                        break;

                    case "INAM":
                        INAM = new FormID();
                        INAM.Deserialize(stream, name);
                        break;

                    case "VTCK":
                        VTCK = new FormID();
                        VTCK.Deserialize(stream, name);
                        break;

                    case "TPLT":
                        TPLT = new FormID();
                        TPLT.Deserialize(stream, name);
                        break;

                    case "RNAM":
                        RNAM = new FormID();
                        RNAM.Deserialize(stream, name);
                        break;

                    case "EITM":
                        EITM = new FormID();
                        EITM.Deserialize(stream, name);
                        break;

                    case "SCRI":
                        SCRI = new FormID();
                        SCRI.Deserialize(stream, name);
                        break;

                    case "PKID":
                        var pkid = new FormID();
                        pkid.Deserialize(stream, name);
                        PKID.Add(pkid);
                        break;

                    case "CNAM":
                        CNAM = new FormID();
                        CNAM.Deserialize(stream, name);
                        break;

                    case "PNAM":
                        var pnam = new FormID();
                        pnam.Deserialize(stream, name);
                        PNAM.Add(pnam);
                        break;

                    case "HNAM":
                        HNAM = new FormID();
                        HNAM.Deserialize(stream, name);
                        break;

                    case "ENAM":
                        ENAM = new FormID();
                        ENAM.Deserialize(stream, name);
                        break;

                    case "ZNAM":
                        ZNAM = new FormID();
                        ZNAM.Deserialize(stream, name);
                        break;

                    default:
                        var rest = stream.ReadUInt16();
                        stream.ReadBytes(rest);
                        break;
                    }
                }
            }
        }
Esempio n. 20
0
        protected override void ExtractSubRecords(BetterReader reader, GameID gameID, uint size)
        {
            var bytes = reader.ReadBytes((int)size);
            var name  = string.Empty;

            using (var stream = new BetterMemoryReader(bytes))
            {
                var end = stream.Length;

                while (stream.Position < end)
                {
                    name = stream.ReadString(4);

                    switch (name)
                    {
                    case "EDID":
                        EDID = new STRSubRecord();
                        EDID.Deserialize(stream, name);
                        break;

                    case "NAME":
                        NAME = new FormID();
                        NAME.Deserialize(stream, name);
                        break;

                    case "XLOC":
                        XLOC = new REFR_XLOCSubRecord();
                        XLOC.Deserialize(stream, name);
                        break;

                    case "XOWN":
                        XOWN = new FormID();
                        XOWN.Deserialize(stream, name);
                        break;

                    case "XLKR":
                        XLKR = new FormID();
                        XLKR.Deserialize(stream, name);
                        break;

                    case "DATA":
                        DATA = new PosAndRotSubRecord();
                        DATA.Deserialize(stream, name);
                        break;

                    case "XSCL":
                        XSCL = new FloatSubRecord();
                        XSCL.Deserialize(stream, name);
                        break;

                    case "XTEL":
                        XTEL = new REFR_XTELSubRecord();
                        XTEL.Deserialize(stream, name);
                        break;

                    case "XNDP":
                        XNDP = new REFR_XNDPSubRecord();
                        XNDP.Deserialize(stream, name);
                        break;

                    case "XLTW":
                        XLTW = new FormID();
                        XLTW.Deserialize(stream, name);
                        break;

                    case "XRDS":
                        XRDS = new FloatSubRecord();
                        XRDS.Deserialize(stream, name);
                        break;

                    case "XEMI":
                        XEMI = new FormID();
                        XEMI.Deserialize(stream, name);
                        break;

                    case "XPWR":
                        var xpwr = new REFR_XPWRSubRecord();
                        xpwr.Deserialize(stream, name);
                        XPWR.Add(xpwr);
                        break;

                    case "XPRD":
                        XPRD = new FloatSubRecord();
                        XPRD.Deserialize(stream, name);
                        break;

                    case "XPPA":
                        var xppaSize = stream.ReadUInt16();
                        var xppaData = stream.ReadBytes(Convert.ToInt32(xppaSize));
                        XPPA = true;
                        if (xppaData.Length > 0)
                        {
                            break;
                        }
                        break;

                    case "INAM":
                        INAM = new FormID();
                        INAM.Deserialize(stream, name);
                        break;

                    case "SCHR":
                        SCHR = new SCHRSubRecord();
                        SCHR.Deserialize(stream, name);
                        break;

                    case "TNAM":
                        TNAM = new BytesSubRecord();
                        TNAM.Deserialize(stream, name);
                        break;

                    case "XMBO":
                        XMBO = new REFR_XMBOSubRecord();
                        XMBO.Deserialize(stream, name);
                        break;

                    case "XPRM":
                        XPRM = new REFR_XPRMSubRecord();
                        XPRM.Deserialize(stream, name);
                        break;

                    case "XRMR":
                        XRMR = new REFR_XRMRSubRecord();
                        XRMR.Deserialize(stream, name);
                        break;

                    case "XLRM":
                        XLRM = new FormID();
                        XLRM.Deserialize(stream, name);
                        break;

                    case "XACT":
                        XACT = new REFR_XACTSubRecord();
                        XACT.Deserialize(stream, name);
                        break;

                    case "ONAM":
                        var onamSize = stream.ReadUInt16();
                        var onamData = stream.ReadBytes(Convert.ToInt32(onamSize));
                        ONAM = true;
                        if (onamData.Length > 0)
                        {
                            break;
                        }
                        break;

                    case "XRGD":
                        XRGD = new BytesSubRecord();
                        XRGD.Deserialize(stream, name);
                        break;

                    case "XHLP":
                        XHLP = new FloatSubRecord();
                        XHLP.Deserialize(stream, name);
                        break;

                    case "XSED":
                        XSED = new ByteSubRecord();
                        XSED.Deserialize(stream, name);
                        break;

                    case "XPOD":
                        XPOD = new REFR_XPODSubRecord();
                        XPOD.Deserialize(stream, name);
                        break;

                    case "XRDO":
                        XRDO = new REFR_XRDOSubRecord();
                        XRDO.Deserialize(stream, name);
                        break;

                    case "XAPD":
                        XAPD = new ByteSubRecord();
                        XAPD.Deserialize(stream, name);
                        break;

                    case "XAPR":
                        var xapr = new REFR_XAPRSubRecord();
                        xapr.Deserialize(stream, name);
                        XAPR.Add(xapr);

                        if (XAPR.Count > 1)
                        {
                            break;
                        }
                        break;

                    case "XESP":
                        XESP = new REFR_XESPSubRecord();
                        XESP.Deserialize(stream, name);
                        break;

                    case "XLCM":
                        XLCM = new UInt32SubRecord();
                        XLCM.Deserialize(stream, name);
                        break;

                    case "XCNT":
                        XCNT = new UInt32SubRecord();
                        XCNT.Deserialize(stream, name);
                        break;

                    case "XTRI":
                        XTRI = new REFR_XTRISubRecord();
                        XTRI.Deserialize(stream, name);
                        break;

                    case "XOCP":
                        XOCP = new BytesSubRecord();
                        XOCP.Deserialize(stream, name);
                        break;

                    case "XAMT":
                        XAMT = new FormID();
                        XAMT.Deserialize(stream, name);
                        break;

                    case "XAMC":
                        XAMC = new UInt32SubRecord();
                        XAMC.Deserialize(stream, name);
                        break;

                    case "XRAD":
                        XRAD = new FloatSubRecord();
                        XRAD.Deserialize(stream, name);
                        break;

                    case "XIBS":
                        var xibsSize = stream.ReadUInt16();
                        var xibsData = stream.ReadBytes(xibsSize);
                        XIBS = true;
                        break;

                    case "XTRG":
                        XTRG = new FormID();
                        XTRG.Deserialize(stream, name);
                        break;

                    case "XORD":
                        XORD = new BytesSubRecord();
                        XORD.Deserialize(stream, name);
                        break;

                    case "XMBP":
                        var xmbpSize = stream.ReadUInt16();
                        var xmbpData = stream.ReadBytes(xmbpSize);
                        XMBP = true;
                        break;

                    case "XMBR":
                        XMBR = new FormID();
                        XMBR.Deserialize(stream, name);
                        break;

                    case "XCLP":
                        XCLP = new BytesSubRecord();
                        XCLP.Deserialize(stream, name);
                        break;

                    case "XMRK":
                        var xmrkSize = stream.ReadUInt16();
                        var xmrkData = stream.ReadBytes(xmrkSize);
                        XMRK = true;
                        break;

                    case "FNAM":
                        FNAM = new REFR_FNAMSubRecord();
                        FNAM.Deserialize(stream, name);
                        break;

                    case "FULL":
                        FULL = new STRSubRecord();
                        FULL.Deserialize(stream, name);
                        break;

                    case "SCDA":
                        SCDA = new BytesSubRecord();
                        SCDA.Deserialize(stream, name);
                        break;

                    case "SCRO":
                        SCRO = new BytesSubRecord();
                        SCRO.Deserialize(stream, name);
                        break;

                    case "XLOD":
                        XLOD = new BytesSubRecord();
                        XLOD.Deserialize(stream, name);
                        break;

                    case "RCLR":
                        RCLR = new BytesSubRecord();
                        RCLR.Deserialize(stream, name);
                        break;

                    case "XRGB":
                        XRGB = new BytesSubRecord();
                        XRGB.Deserialize(stream, name);
                        break;

                    default:
                        var rest = stream.ReadUInt16();
                        stream.ReadBytes(rest);
                        break;
                    }
                }
            }
        }
Esempio n. 21
0
        public virtual void Deserialize(BetterReader reader, string name, GameID gameID)
        {
            _type = name;
            _subGroups = new Dictionary<GroupType, List<Group>>();
            _records = new Dictionary<string, List<Record>>();

            var headerSize = 24;

            if (gameID == GameID.Oblivion)
                headerSize = 20;

            _groupSize = reader.ReadUInt32();
            _label = reader.ReadBytes(4);
            _groupType = reader.ReadInt32();

            switch ((GroupType)_groupType)
            {
                case GroupType.Top:
                    //if (label[0] >= 32)
                    Label = Utils.ToString(_label);
                    break;
                case GroupType.WorldChildren:
                case GroupType.CellChildren:
                case GroupType.TopicChildren:
                case GroupType.CellPersistentChildren:
                case GroupType.CellTemporaryChildren:
                case GroupType.CellVisibleDistantChildren:
                    //_parentId = _label[0];
                    _parentId = BitConverter.ToUInt32(_label, 0);
                    break;
            }

            _stamp = reader.ReadUInt16();
            _unknow = reader.ReadUInt16();

            if (gameID != GameID.Oblivion)
            {
                _version = reader.ReadUInt16();
                _unknow2 = reader.ReadUInt16();
            }

            if (Label != null)
                Utils.LogBuffer("{0} > {1}", _type, Label);

            var endRead = reader.Position + (_groupSize - headerSize);
            var fname = string.Empty;

            Group group = null;
            Record record = null;

            // Only used for debug helping.
            var logGroupDebugDico = new List<int>();
            var logRecordDebugDico = new List<string>();

            while (reader.Position < endRead)
            {
                fname = reader.ReadString(4);

                if (fname == "GRUP")
                {
                    group = new Group();
                    group.Deserialize(reader, fname, gameID);

                    var groupType = (GroupType)group.Type;

                    if (!_subGroups.ContainsKey(groupType))
                    {
                        var list = new List<Group>();
                        list.Add(group);
                        _subGroups.Add(groupType, list);
                    }
                    else
                        _subGroups[groupType].Add(group);

                    if (!logGroupDebugDico.Contains(group._groupType))
                    {
                        logGroupDebugDico.Add(group._groupType);
                        Utils.LogBuffer("\t# SubGroup: {0}", (GroupType)group._groupType);
                    }
                }
                else
                {
                    record = Record.GetRecord(fname);
                    record.Deserialize(reader, fname, gameID);

                    if (!_records.ContainsKey(record.Type))
                    {
                        var list = new List<Record>();
                        list.Add(record);
                        _records.Add(record.Type, list);
                    }
                    else
                        _records[record.Type].Add(record);

                    if (!logRecordDebugDico.Contains(record.Type))
                    {
                        logRecordDebugDico.Add(record.Type);
                        Utils.LogBuffer("\t- Record: {0}", record.Type);
                    }
                }
            }
        }
Esempio n. 22
0
 protected override void ExtractSubRecords(BetterReader reader, GameID gameID, uint size)
 {
     reader.ReadBytes((int)size);
 }
Esempio n. 23
0
        protected override void ExtractSubRecords(BetterReader reader, GameID gameID, uint size)
        {
            var bytes = reader.ReadBytes((int)size);
            var name  = string.Empty;

            using (var stream = new BetterMemoryReader(bytes))
            {
                var end = stream.Length;

                while (stream.Position < end)
                {
                    name = stream.ReadString(4);

                    switch (name)
                    {
                    case "EDID":
                        EDID = new STRSubRecord();
                        EDID.Deserialize(stream, name);
                        break;

                    case "NAME":
                        NAME = new FormID();
                        NAME.Deserialize(stream, name);
                        break;

                    case "XEZN":
                        XEZN = new FormID();
                        XEZN.Deserialize(stream, name);
                        break;

                    case "INAM":
                        INAM = new FormID();
                        INAM.Deserialize(stream, name);
                        break;

                    case "TNAM":
                        TNAM = new FormID();
                        TNAM.Deserialize(stream, name);
                        break;

                    case "XMRC":
                        XMRC = new FormID();
                        XMRC.Deserialize(stream, name);
                        break;

                    case "XLKR":
                        XLKR = new FormID();
                        XLKR.Deserialize(stream, name);
                        break;

                    case "XEMI":
                        XEMI = new FormID();
                        XEMI.Deserialize(stream, name);
                        break;

                    case "XMBR":
                        XMBR = new FormID();
                        XMBR.Deserialize(stream, name);
                        break;

                    case "DATA":
                        DATA = new PosAndRotSubRecord();
                        DATA.Deserialize(stream, name);
                        break;

                    default:
                        var rest = stream.ReadUInt16();
                        stream.ReadBytes(rest);
                        break;
                    }
                }
            }
        }
Esempio n. 24
0
 public override void Deserialize(BetterReader reader, string name)
 {
     base.Deserialize(reader, name);
     Value = reader.ReadBytes((int)Size);
 }
Esempio n. 25
0
        protected override void ExtractSubRecords(BetterReader reader, GameID gameID, uint size)
        {
            var bytes = reader.ReadBytes((int)size);
            var name  = string.Empty;

            using (var stream = new BetterMemoryReader(bytes))
            {
                var end = stream.Length;

                while (stream.Position < end)
                {
                    name = stream.ReadString(4);

                    switch (name)
                    {
                    case "EDID":
                        EDID = new STRSubRecord();
                        EDID.Deserialize(stream, name);
                        break;

                    case "FULL":
                        FULL = new STRSubRecord();
                        FULL.Deserialize(stream, name);
                        break;

                    case "WNAM":
                        WNAM = new FormID();
                        WNAM.Deserialize(stream, name);
                        break;

                    case "CNAM":
                        CNAM = new FormID();
                        CNAM.Deserialize(stream, name);
                        break;

                    case "NAM2":
                        NAM2 = new FormID();
                        NAM2.Deserialize(stream, name);
                        break;

                    case "NAM3":
                        NAM3 = new FormID();
                        NAM3.Deserialize(stream, name);
                        break;

                    case "NAM4":
                        NAM4 = new FloatSubRecord();
                        NAM4.Deserialize(stream, name);
                        break;

                    case "DNAM":
                        DNAM = new WRLD_DNAMSubRecord();
                        DNAM.Deserialize(stream, name);
                        break;

                    case "ICON":
                        ICON = new STRSubRecord();
                        ICON.Deserialize(stream, name);
                        break;

                    case "MNAM":
                        MNAM = new WRLD_MNAMSubRecord();
                        MNAM.Deserialize(stream, name);
                        break;

                    case "ONAM":
                        ONAM = new WRLD_ONAMSubRecord();
                        ONAM.Deserialize(stream, name);
                        break;

                    case "INAM":
                        INAM = new FormID();
                        INAM.Deserialize(stream, name);
                        break;

                    case "DATA":
                        DATA = new WRLD_DATASubRecord();
                        DATA.Deserialize(stream, name);
                        break;

                    case "NAM0":
                        NAM0 = new Vector2fSubRecord();
                        NAM0.Deserialize(stream, name);
                        break;

                    case "NAM9":
                        NAM9 = new Vector2fSubRecord();
                        NAM9.Deserialize(stream, name);
                        break;

                    case "NNAM":
                        NNAM = new STRSubRecord();
                        NNAM.Deserialize(stream, name);
                        break;

                    case "XNAM":
                        XNAM = new STRSubRecord();
                        XNAM.Deserialize(stream, name);
                        break;

                    case "XXXX":
                        //var xxxxSize = stream.ReadUInt16();
                        //var xxxxData = stream.ReadBytes(xxxxSize);
                        //var xxxxDataStr = System.Text.Encoding.ASCII.GetString(xxxxData);
                        XXXX = new UInt32SubRecord();
                        XXXX.Deserialize(stream, name);
                        break;

                    case "OFST":
                        var ofstSize = Convert.ToInt32(stream.ReadUInt16());
                        if (ofstSize == 0)
                        {
                            ofstSize = Convert.ToInt32(XXXX.Value);
                        }
                        var ofstData = stream.ReadBytes(ofstSize);
                        break;

                    case "XEZN":
                        XEZN = new FormID();
                        XEZN.Deserialize(stream, name);
                        break;

                    case "PNAM":
                        PNAM = new WRLD_PNAMSubRecord();
                        PNAM.Deserialize(stream, name);
                        break;

                    case "ZNAM":
                        ZNAM = new FormID();
                        ZNAM.Deserialize(stream, name);
                        break;

                    default:
                        var rest = stream.ReadUInt16();
                        stream.ReadBytes(rest);
                        break;
                    }
                }
            }
        }
Esempio n. 26
0
        protected override void ExtractSubRecords(BetterReader reader, GameID gameID, uint size)
        {
            var bytes = reader.ReadBytes((int)size);
            var name  = string.Empty;

            using (var stream = new BetterMemoryReader(bytes))
            {
                var end = stream.Length;

                while (stream.Position < end)
                {
                    name = stream.ReadString(4);

                    switch (name)
                    {
                    case "DATA":
                        DATA = new BytesSubRecord();
                        DATA.Deserialize(stream, name);
                        break;

                    case "VNML":
                        VNML = new VNMLorVCLRSubRecord();
                        VNML.Deserialize(stream, name);
                        break;

                    case "VCLR":
                        VCLR = new VNMLorVCLRSubRecord();
                        VCLR.Deserialize(stream, name);
                        break;

                    case "VHGT":
                        VHGT = new VHGTSubRecord();
                        VHGT.Deserialize(stream, name);
                        break;

                    case "BTXT":
                        var btxt = new ATXTorBTXTSubRecord();
                        btxt.Deserialize(stream, name);
                        BTXT.Add(btxt);

                        if (BTXT.Count > 1)
                        {
                            break;
                        }

                        break;

                    case "ATXT":
                        var atxt = new ATXTorBTXTSubRecord();
                        atxt.Deserialize(stream, name);
                        ATXT.Add(atxt);

                        if (ATXT.Count > 1)
                        {
                            break;
                        }

                        break;

                    case "VTXT":
                        var vtxt = new VTXTSubRecord();
                        vtxt.Deserialize(stream, name);
                        VTXT.Add(vtxt);

                        if (VTXT.Count > 1)
                        {
                            break;
                        }

                        break;

                    default:
                        var rest = stream.ReadUInt16();
                        stream.ReadBytes(rest);
                        break;
                    }
                }
            }
        }
Esempio n. 27
0
        protected override void ExtractSubRecords(BetterReader reader, GameID gameID, uint size)
        {
            var bytes = reader.ReadBytes((int)size);
            var name  = string.Empty;

            using (var stream = new BetterMemoryReader(bytes))
            {
                var end = stream.Length;

                while (stream.Position < end)
                {
                    name = stream.ReadString(4);

                    switch (name)
                    {
                    case "DATA":
                        DATA = new INFO_DATASubRecord();
                        DATA.Deserialize(stream, name);
                        break;

                    case "QSTI":
                        QSTI = new FormID();
                        QSTI.Deserialize(stream, name);
                        break;

                    case "TRDT":
                        var trdt = new INFO_TRDTSubrecord();
                        trdt.Deserialize(stream, name);
                        Responses      = new INFO_ResponseSubRecordCollection();
                        Responses.TRDT = trdt;
                        break;

                    case "NAM1":
                        var nam1 = new STRSubRecord();
                        nam1.Deserialize(stream, name);
                        Responses.NAM1 = nam1;
                        break;

                    case "NAM2":
                        var nam2 = new STRSubRecord();
                        nam2.Deserialize(stream, name);
                        Responses.NAM2 = nam2;
                        break;

                    case "NAM3":
                        var nam3 = new STRSubRecord();
                        nam3.Deserialize(stream, name);
                        Responses.NAM3 = nam3;
                        break;

                    case "TCLT":
                        var tclt = new FormID();
                        tclt.Deserialize(stream, name);
                        TCLT.Add(tclt);
                        break;

                    case "TCLF":
                        var tclf = new FormID();
                        tclf.Deserialize(stream, name);
                        TCLF.Add(tclf);
                        break;

                    default:
                        var rest = stream.ReadUInt16();
                        stream.ReadBytes(rest);
                        break;
                    }
                }
            }
        }
Esempio n. 28
0
        public override void Deserialize(BetterReader reader, string name)
        {
            base.Deserialize(reader, name);

            Count = reader.ReadUInt32();

            for (var i = 0; i < Count; i++)
            {
                var alternateTextureLength = reader.ReadUInt32();
                AlternateTexture.Add(new AlternateTexture(alternateTextureLength, Encoding.ASCII.GetString(reader.ReadBytes(Convert.ToInt32(alternateTextureLength))), reader.ReadUInt32(), reader.ReadInt32()));
            }
        }