Exemple #1
0
        public override void Write()
        {
            Packet.Write(NumObjUpdates);
            Packet.Write(MapId);

            Packet.PutBit(DestroyOrOutOfRange);
            Packet.FlushBits();

            if (DestroyOrOutOfRange)
            {
                DestroyData.Write(Packet);
            }

            Packet.Write(0);

            if (NumObjUpdates > 0)
            {
                // UpdateType 1 (CreateObject)
                Packet.Write <byte>(1);
                Packet.Write(Obj.Guid);
                Packet.Write <byte>(4);

                CreateData.Write(Packet);

                // Descriptors.
                Obj.WriteToPacket(Packet);

                // Write data length to packet.
                Packet.Write(Packet.Written - 15, 11);
            }
        }