Esempio n. 1
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();

            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);
        }
Esempio n. 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());
            }
        }
Esempio n. 3
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);
        }
Esempio n. 4
0
        public void SaveEnt(VMEntityMarshal target)
        {
            var newList = new short[MyList.Count];
            int i = 0;
            foreach (var item in MyList) newList[i++] = item;

            var newContd = new short[Contained.Length];
            i = 0;
            foreach (var item in Contained) newContd[i++] = (item == null)?(short)0:item.ObjectID;

            var relArry = new VMEntityRelationshipMarshal[MeToObject.Count];
            i = 0;
            foreach (var item in MeToObject) relArry[i++] = new VMEntityRelationshipMarshal { Target = item.Key, Values = item.Value.ToArray() };

            target.ObjectID = ObjectID;
            target.PersistID = PersistID;
            target.ObjectData = ObjectData;
            target.MyList = newList;

            target.GUID = Object.OBJ.GUID;
            target.MasterGUID = (MasterDefinition == null)?0:MasterDefinition.GUID;

            target.MainParam = MainParam; //parameters passed to main on creation.
            target.MainStackOBJ = MainStackOBJ;

            target.Contained = newContd; //object ids
            target.Container = (Container == null)?(short)0:Container.ObjectID;
            target.ContainerSlot = ContainerSlot;

            target.Attributes = Attributes;
            target.MeToObject = relArry;

            target.DynamicSpriteFlags = DynamicSpriteFlags;
            target.Position = _Position;
        }
Esempio n. 5
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);
        }