Exemplo n.º 1
0
        protected override Stream UnParse()
        {
            Stream stream = base.UnParse();
            var    writer = new BinaryWriter(stream);

            writer.Write(this.unknown02);
            writer.Write(this.refIndicator);
            if (this.refIndicator == 0)
            {
                if (this.nullRefs == null)
                {
                    this.nullRefs = new Gp4references(this.RecommendedApiVersion, this.OnResourceChanged);
                }
                this.nullRefs.UnParse(stream);
            }
            else
            {
                if (this.modlRefs == null)
                {
                    this.modlRefs = new Gp9references(this.RecommendedApiVersion, this.OnResourceChanged);
                }
                this.modlRefs.UnParse(stream);
                if (this.ftptRefs == null)
                {
                    this.ftptRefs = new Gp9references(this.RecommendedApiVersion, this.OnResourceChanged);
                }
                this.ftptRefs.UnParse(stream);
            }

            return(stream);
        }
Exemplo n.º 2
0
        void Parse(Stream s)
        {
            var br = new BinaryReader(s);

            this.version        = br.ReadUInt32();
            this.commonA        = new CatalogCommon(kRecommendedApiVersion, this.OnResourceChanged, s);
            this.hashIndicator  = br.ReadUInt32();
            this.hash01         = br.ReadUInt32();
            this.hash02         = br.ReadUInt32();
            this.hash03         = br.ReadUInt32();
            this.unk02          = br.ReadUInt32();
            this.hash04         = br.ReadUInt32();
            this.hash05         = br.ReadUInt32();
            this.unkFlags01     = br.ReadUInt32();
            this.categoryFlags  = br.ReadUInt32();
            this.unkFlags03     = br.ReadUInt32();
            this.unkFlags04     = br.ReadUInt32();
            this.placementFlags = br.ReadUInt32();
            this.unkIID01       = br.ReadUInt64();
            this.unk03          = br.ReadByte();
            this.unkIID02       = br.ReadUInt64();
            this.unk04          = br.ReadByte();
            this.colors         = new ColorList(this.OnResourceChanged, s);
            this.unk05          = br.ReadByte();
            this.unk06          = br.ReadByte();
            this.unk07          = br.ReadByte();
            this.unk08          = br.ReadByte();
            this.unk09          = br.ReadByte();
            this.build_buy      = br.ReadByte();
            if (this.version >= 0x19)
            {
                this.unk10 = br.ReadUInt32();
                this.unk11 = br.ReadUInt32();
                this.unk12 = br.ReadUInt32();
                this.unk13 = br.ReadUInt32();
            }
            this.unk14        = br.ReadUInt32();
            this.refIndicator = br.ReadUInt32();
            if (this.refIndicator == 0)
            {
                this.nullRefs = new Gp4references(kRecommendedApiVersion, this.OnResourceChanged, s);
            }
            else
            {
                this.modlRefs = new Gp9references(kRecommendedApiVersion, this.OnResourceChanged, s);
                this.ftptRefs = new Gp9references(kRecommendedApiVersion, this.OnResourceChanged, s);
            }
        }
Exemplo n.º 3
0
        protected override void Parse(Stream s)
        {
            base.Parse(s);
            var reader = new BinaryReader(s);

            this.unknown02    = reader.ReadUInt32();
            this.refIndicator = reader.ReadUInt32();
            if (this.refIndicator == 0)
            {
                this.nullRefs = new Gp4references(this.RecommendedApiVersion, this.OnResourceChanged, s);
            }
            else
            {
                this.modlRefs = new Gp9references(this.RecommendedApiVersion, this.OnResourceChanged, s);
                this.ftptRefs = new Gp9references(this.RecommendedApiVersion, this.OnResourceChanged, s);
            }
        }
Exemplo n.º 4
0
        protected override Stream UnParse()
        {
            var s  = new MemoryStream();
            var bw = new BinaryWriter(s);

            bw.Write(this.version);
            if (this.commonA == null)
            {
                commonA = new CatalogCommon(kRecommendedApiVersion, this.OnResourceChanged);
            }
            this.commonA.UnParse(s);
            bw.Write(this.hashIndicator);
            bw.Write(this.hash01);
            bw.Write(this.hash02);
            bw.Write(this.hash03);
            bw.Write(this.unk02);
            bw.Write(this.hash04);
            bw.Write(this.hash05);
            bw.Write(this.unkFlags01);
            bw.Write(this.categoryFlags);
            bw.Write(this.unkFlags03);
            bw.Write(this.unkFlags04);
            bw.Write(this.placementFlags);
            bw.Write(this.unkIID01);
            bw.Write(this.unk03);
            bw.Write(this.unkIID02);
            bw.Write(this.unk04);
            if (this.colors == null)
            {
                this.colors = new ColorList(this.OnResourceChanged);
            }
            this.colors.UnParse(s);
            bw.Write(this.unk05);
            bw.Write(this.unk06);
            bw.Write(this.unk07);
            bw.Write(this.unk08);
            bw.Write(this.unk09);
            bw.Write(this.build_buy);
            if (this.version >= 0x19)
            {
                bw.Write(this.unk10);
                bw.Write(this.unk11);
                bw.Write(this.unk12);
                bw.Write(this.unk13);
            }
            bw.Write(this.unk14);
            bw.Write(this.refIndicator);
            if (refIndicator == 0)
            {
                if (this.nullRefs == null)
                {
                    this.nullRefs = new Gp4references(kRecommendedApiVersion, this.OnResourceChanged);
                }
                this.nullRefs.UnParse(s);
            }
            else
            {
                if (this.modlRefs == null)
                {
                    this.modlRefs = new Gp9references(kRecommendedApiVersion, this.OnResourceChanged);
                }
                this.modlRefs.UnParse(s);
                if (this.ftptRefs == null)
                {
                    this.ftptRefs = new Gp9references(kRecommendedApiVersion, this.OnResourceChanged);
                }
                this.ftptRefs.UnParse(s);
            }
            return(s);
        }