OregonCore  revision be9e804-git
Your Favourite TBC server
UpdateData.h
Go to the documentation of this file.
1 /*
2  * This file is part of the OregonCore Project. See AUTHORS file for Copyright information
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the
6  * Free Software Foundation; either version 2 of the License, or (at your
7  * option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program. If not, see <https://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef __UPDATEDATA_H
19 #define __UPDATEDATA_H
20 
21 #include "ByteBuffer.h"
22 class WorldPacket;
23 
25 {
32 };
33 
35 {
36  UPDATEFLAG_NONE = 0x0000,
37  UPDATEFLAG_SELF = 0x0001,
44 };
45 
47 {
48  public:
49  UpdateData();
50 
51  void AddOutOfRangeGUID(std::set<uint64>& guids);
52  void AddOutOfRangeGUID(const uint64& guid);
53  void AddUpdateBlock(const ByteBuffer& block);
54  bool BuildPacket(WorldPacket* packet, bool hasTransport = false);
55  bool HasData()
56  {
57  return m_blockCount > 0 || !m_outOfRangeGUIDs.empty();
58  }
59  void Clear();
60 
61  std::set<uint64> const& GetOutOfRangeGUIDs() const
62  {
63  return m_outOfRangeGUIDs;
64  }
65 
66  protected:
68  std::set<uint64> m_outOfRangeGUIDs;
70 
71  void Compress(void* dst, uint32* dst_size, void* src, int src_size);
72 };
73 #endif
74 
bool BuildPacket(WorldPacket *packet, bool hasTransport=false)
Definition: UpdateData.cpp:103
std::set< uint64 > const & GetOutOfRangeGUIDs() const
Definition: UpdateData.h:61
void Compress(void *dst, uint32 *dst_size, void *src, int src_size)
Definition: UpdateData.cpp:47
void AddOutOfRangeGUID(std::set< uint64 > &guids)
Definition: UpdateData.cpp:31
ObjectUpdateType
Definition: UpdateData.h:24
std::set< uint64 > m_outOfRangeGUIDs
Definition: UpdateData.h:68
ObjectUpdateFlags
Definition: UpdateData.h:34
void Clear()
Definition: UpdateData.cpp:149
ACE_UINT64 uint64
Definition: Define.h:70
void AddUpdateBlock(const ByteBuffer &block)
Definition: UpdateData.cpp:41
ByteBuffer m_data
Definition: UpdateData.h:69
uint32 m_blockCount
Definition: UpdateData.h:67
ACE_UINT32 uint32
Definition: Define.h:71
bool HasData()
Definition: UpdateData.h:55