Deserialize() public method

public Deserialize ( BinaryReader reader ) : void
reader System.IO.BinaryReader
return void
示例#1
0
        public virtual void Deserialize(BinaryReader reader)
        {
            ObjectID = reader.ReadInt16();
            PersistID = reader.ReadUInt32();

            if (this is VMGameObjectMarshal) PlatformState = new VMTSOObjectState();
            else PlatformState = new VMTSOAvatarState();

            PlatformState.Deserialize(reader);

            var datas = reader.ReadInt32();
            ObjectData = new short[datas];
            for (int i = 0; i < datas; i++) ObjectData[i] = reader.ReadInt16();

            var listLen = reader.ReadInt32();
            MyList = new short[listLen];
            for (int i = 0; i < listLen; i++) MyList[i] = reader.ReadInt16();

            if (reader.ReadBoolean())
            {
                Headline = new VMRuntimeHeadlineMarshal();
                Headline.Deserialize(reader);
            }

            GUID = reader.ReadUInt32();
            MasterGUID = reader.ReadUInt32();

            MainParam = reader.ReadInt16();
            MainStackOBJ = reader.ReadInt16();

            var contN = reader.ReadInt32();
            Contained = new short[contN];
            for (int i = 0; i < contN; i++) Contained[i] = reader.ReadInt16();
            Container = reader.ReadInt16();
            ContainerSlot = reader.ReadInt16();

            var attrN = reader.ReadInt32();
            Attributes = new short[attrN];
            for (int i = 0; i < attrN; i++) Attributes[i] = reader.ReadInt16();

            var relN = reader.ReadInt32();
            MeToObject = new VMEntityRelationshipMarshal[relN];
            for (int i = 0; i < relN; i++) {
                MeToObject[i] = new VMEntityRelationshipMarshal();
                MeToObject[i].Deserialize(reader);
            }

            DynamicSpriteFlags = reader.ReadUInt64();
            if (Version > 2) DynamicSpriteFlags2 = reader.ReadUInt64();
            Position = new LotTilePos();
            Position.Deserialize(reader);
        }
示例#2
0
        public virtual void Deserialize(BinaryReader reader)
        {
            ObjectID  = reader.ReadInt16();
            PersistID = reader.ReadUInt32();

            if (this is VMGameObjectMarshal)
            {
                PlatformState = new VMTSOObjectState(Version);
            }
            else
            {
                PlatformState = new VMTSOAvatarState(Version);
            }

            PlatformState.Deserialize(reader);

            var datas = reader.ReadInt32();

            ObjectData = new short[datas];
            for (int i = 0; i < datas; i++)
            {
                ObjectData[i] = reader.ReadInt16();
            }

            var listLen = reader.ReadInt32();

            MyList = new short[listLen];
            for (int i = 0; i < listLen; i++)
            {
                MyList[i] = reader.ReadInt16();
            }

            if (reader.ReadBoolean())
            {
                Headline = new VMRuntimeHeadlineMarshal();
                Headline.Deserialize(reader);
            }

            GUID       = reader.ReadUInt32();
            MasterGUID = reader.ReadUInt32();

            MainParam    = reader.ReadInt16();
            MainStackOBJ = reader.ReadInt16();

            var contN = reader.ReadInt32();

            Contained = new short[contN];
            for (int i = 0; i < contN; i++)
            {
                Contained[i] = reader.ReadInt16();
            }
            Container     = reader.ReadInt16();
            ContainerSlot = reader.ReadInt16();

            var attrN = reader.ReadInt32();

            Attributes = new short[attrN];
            for (int i = 0; i < attrN; i++)
            {
                Attributes[i] = reader.ReadInt16();
            }

            var relN = reader.ReadInt32();

            MeToObject = new VMEntityRelationshipMarshal[relN];
            for (int i = 0; i < relN; i++)
            {
                MeToObject[i] = new VMEntityRelationshipMarshal();
                MeToObject[i].Deserialize(reader);
            }

            if (Version > 7)
            {
                var prelN = reader.ReadInt32();
                MeToPersist = new VMEntityPersistRelationshipMarshal[prelN];
                for (int i = 0; i < prelN; i++)
                {
                    MeToPersist[i] = new VMEntityPersistRelationshipMarshal();
                    MeToPersist[i].Deserialize(reader);
                }
            }
            else
            {
                MeToPersist = new VMEntityPersistRelationshipMarshal[0];
            }

            DynamicSpriteFlags = reader.ReadUInt64();
            if (Version > 2)
            {
                DynamicSpriteFlags2 = reader.ReadUInt64();
            }
            Position = new LotTilePos();
            Position.Deserialize(reader);

            if (Version > 16)
            {
                TimestampLockoutCount = reader.ReadUInt32();
            }

            if (Version > 19)
            {
                LightColor = new Color(reader.ReadUInt32());
            }
        }
示例#3
0
        public virtual void Deserialize(BinaryReader reader)
        {
            ObjectID  = reader.ReadInt16();
            PersistID = reader.ReadUInt32();

            var datas = reader.ReadInt32();

            ObjectData = new short[datas];
            for (int i = 0; i < datas; i++)
            {
                ObjectData[i] = reader.ReadInt16();
            }

            var listLen = reader.ReadInt32();

            MyList = new short[listLen];
            for (int i = 0; i < listLen; i++)
            {
                MyList[i] = reader.ReadInt16();
            }

            if (reader.ReadBoolean())
            {
                Headline = new VMRuntimeHeadlineMarshal();
                Headline.Deserialize(reader);
            }

            GUID       = reader.ReadUInt32();
            MasterGUID = reader.ReadUInt32();

            MainParam    = reader.ReadInt16();
            MainStackOBJ = reader.ReadInt16();

            var contN = reader.ReadInt32();

            Contained = new short[contN];
            for (int i = 0; i < contN; i++)
            {
                Contained[i] = reader.ReadInt16();
            }
            Container     = reader.ReadInt16();
            ContainerSlot = reader.ReadInt16();

            var attrN = reader.ReadInt32();

            Attributes = new short[attrN];
            for (int i = 0; i < attrN; i++)
            {
                Attributes[i] = reader.ReadInt16();
            }

            var relN = reader.ReadInt32();

            MeToObject = new VMEntityRelationshipMarshal[relN];
            for (int i = 0; i < relN; i++)
            {
                MeToObject[i] = new VMEntityRelationshipMarshal();
                MeToObject[i].Deserialize(reader);
            }

            DynamicSpriteFlags = reader.ReadUInt32();
            Position           = new LotTilePos();
            Position.Deserialize(reader);
        }