2 * Copyright (C) 2005-2009 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
24 enum OBJECT_UPDATE_TYPE
26 UPDATETYPE_VALUES
= 0,
27 UPDATETYPE_MOVEMENT
= 1,
28 UPDATETYPE_CREATE_OBJECT
= 2,
29 UPDATETYPE_CREATE_OBJECT2
= 3,
30 UPDATETYPE_OUT_OF_RANGE_OBJECTS
= 4,
31 UPDATETYPE_NEAR_OBJECTS
= 5
34 enum OBJECT_UPDATE_FLAGS
36 UPDATEFLAG_NONE
= 0x0000,
37 UPDATEFLAG_SELF
= 0x0001,
38 UPDATEFLAG_TRANSPORT
= 0x0002,
39 UPDATEFLAG_HAS_TARGET
= 0x0004,
40 UPDATEFLAG_LOWGUID
= 0x0008,
41 UPDATEFLAG_HIGHGUID
= 0x0010,
42 UPDATEFLAG_LIVING
= 0x0020,
43 UPDATEFLAG_HAS_POSITION
= 0x0040,
44 UPDATEFLAG_VEHICLE
= 0x0080,
45 UPDATEFLAG_POSITION
= 0x0100,
46 UPDATEFLAG_ROTATION
= 0x0200
54 void AddOutOfRangeGUID(std::set
<uint64
>& guids
);
55 void AddOutOfRangeGUID(const uint64
&guid
);
56 void AddUpdateBlock(const ByteBuffer
&block
);
57 bool BuildPacket(WorldPacket
*packet
);
58 bool HasData() { return m_blockCount
> 0 || !m_outOfRangeGUIDs
.empty(); }
61 std::set
<uint64
> const& GetOutOfRangeGUIDs() const { return m_outOfRangeGUIDs
; }
65 std::set
<uint64
> m_outOfRangeGUIDs
;
68 void Compress(void* dst
, uint32
*dst_size
, void* src
, int src_size
);