2 * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef __UPDATEDATA_H
20 #define __UPDATEDATA_H
22 #include "ByteBuffer.h"
27 enum OBJECT_UPDATE_TYPE
29 UPDATETYPE_VALUES
= 0,
30 UPDATETYPE_MOVEMENT
= 1,
31 UPDATETYPE_CREATE_OBJECT
= 2,
32 UPDATETYPE_CREATE_OBJECT2
= 3,
33 UPDATETYPE_OUT_OF_RANGE_OBJECTS
= 4,
34 UPDATETYPE_NEAR_OBJECTS
= 5
37 enum OBJECT_UPDATE_FLAGS
39 UPDATEFLAG_NONE
= 0x0000,
40 UPDATEFLAG_SELF
= 0x0001,
41 UPDATEFLAG_TRANSPORT
= 0x0002,
42 UPDATEFLAG_HAS_ATTACKING_TARGET
= 0x0004,
43 UPDATEFLAG_LOWGUID
= 0x0008,
44 UPDATEFLAG_HIGHGUID
= 0x0010,
45 UPDATEFLAG_LIVING
= 0x0020,
46 UPDATEFLAG_HAS_POSITION
= 0x0040,
47 UPDATEFLAG_VEHICLE
= 0x0080,
48 UPDATEFLAG_POSITION
= 0x0100,
49 UPDATEFLAG_ROTATION
= 0x0200
57 void AddOutOfRangeGUID(std::set
<uint64
>& guids
);
58 void AddOutOfRangeGUID(const uint64
&guid
);
59 void AddUpdateBlock(const ByteBuffer
&block
);
60 bool BuildPacket(WorldPacket
*packet
);
61 bool HasData() { return m_blockCount
> 0 || !m_outOfRangeGUIDs
.empty(); }
64 std::set
<uint64
> const& GetOutOfRangeGUIDs() const { return m_outOfRangeGUIDs
; }
68 std::set
<uint64
> m_outOfRangeGUIDs
;
71 void Compress(void* dst
, uint32
*dst_size
, void* src
, int src_size
);