Example #1
0
        public override void Deserialize(BinaryReader reader)
        {
            Name  = reader.ReadString();
            LotID = reader.ReadUInt32();
            if (Version > 6)
            {
                Terrain = new VMTSOSurroundingTerrain();
                Terrain.Deserialize(reader);
            }
            else
            {
                reader.ReadByte(); //old Terrain Type
            }
            PropertyCategory = reader.ReadByte();
            Size             = reader.ReadInt32();

            OwnerID   = reader.ReadUInt32();
            Roommates = new HashSet <uint>();
            var roomCount = reader.ReadInt16();

            for (int i = 0; i < roomCount; i++)
            {
                Roommates.Add(reader.ReadUInt32());
            }
            BuildRoommates = new HashSet <uint>();
            var broomCount = reader.ReadInt16();

            for (int i = 0; i < broomCount; i++)
            {
                BuildRoommates.Add(reader.ReadUInt32());
            }

            if (Version > 10)
            {
                if (reader.ReadBoolean())
                {
                    JobUI = new VMTSOJobUI();
                    JobUI.Deserialize(reader);
                }
            }

            if (Version > 24)
            {
                SkillMode = reader.ReadByte();
            }

            if (Version > 27)
            {
                ChatChannels.Clear();
                var channelCount = reader.ReadByte(); //number of chat channels - currently unused

                for (int i = 0; i < channelCount; i++)
                {
                    var chan = new VMTSOChatChannel();
                    chan.Deserialize(reader);
                    ChatChannels.Add(chan);
                }
            }
        }
Example #2
0
        public override void Deserialize(BinaryReader reader)
        {
            Name  = reader.ReadString();
            LotID = reader.ReadUInt32();
            if (Version > 6)
            {
                Terrain = new VMTSOSurroundingTerrain();
                Terrain.Deserialize(reader);
            }
            else
            {
                reader.ReadByte(); //old Terrain Type
            }
            PropertyCategory = reader.ReadByte();
            Size             = reader.ReadInt32();

            OwnerID   = reader.ReadUInt32();
            Roommates = new HashSet <uint>();
            var roomCount = reader.ReadInt16();

            for (int i = 0; i < roomCount; i++)
            {
                Roommates.Add(reader.ReadUInt32());
            }
            BuildRoommates = new HashSet <uint>();
            var broomCount = reader.ReadInt16();

            for (int i = 0; i < broomCount; i++)
            {
                BuildRoommates.Add(reader.ReadUInt32());
            }

            if (Version > 10)
            {
                if (reader.ReadBoolean())
                {
                    JobUI = new VMTSOJobUI();
                    JobUI.Deserialize(reader);
                }
            }
        }