Example #1
1
        public CustomHousePacket(PacketReader reader)
            : base(0xD8, "Custom House Packet")
        {
            byte CompressionType = reader.ReadByte();
            if (CompressionType != 3)
            {
                _houseSerial = Serial.Null;
                return;
            }
            reader.ReadByte(); // unknown, always 0?
            _houseSerial = reader.ReadInt32();
            _revisionHash = reader.ReadInt32();

            // this is for compression type 3 only
            int bufferLength = reader.ReadInt16();
            int trueBufferLength = reader.ReadInt16();
            _numPlanes = reader.ReadByte();
            // end compression type 3

            _planes = new CustomHousePlane[_numPlanes];
            for (int i = 0; i < _numPlanes; i++)
            {
                _planes[i] = new CustomHousePlane(reader);
            }
        }
Example #2
0
        public static void UpdateCustomHouseData(Serial serial, int hash, int planecount, CustomHousePlane[] planes)
        {
            CustomHouse house;
            if (_customHouses.ContainsKey(serial))
            {
                house = _customHouses[serial];

            }
            else
            {
                house = new CustomHouse(serial);
                _customHouses.Add(serial, house);
            }
            house.Update(hash, planecount, planes);
        }
Example #3
0
 public void Update(int hash, int planecount, CustomHousePlane[] planes)
 {
     Hash = hash;
     _planeCount = planecount;
     _planes = planes;
 }