TrinityCore
Loading...
Searching...
No Matches
VignettePackets.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore 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 <http://www.gnu.org/licenses/>.
16 */
17
18#include "VignettePackets.h"
19#include "PacketOperators.h"
20
22{
23ByteBuffer& operator<<(ByteBuffer& data, VignetteData const& vignetteData)
24{
25 data << vignetteData.Position;
26 data << vignetteData.ObjGUID;
27 data << int32(vignetteData.VignetteID);
28 data << uint32(vignetteData.ZoneID);
29 data << uint32(vignetteData.WMOGroupID);
30 data << uint32(vignetteData.WMODoodadPlacementID);
31 data << float(vignetteData.HealthPercent);
32 data << uint16(vignetteData.RecommendedGroupSizeMin);
33 data << uint16(vignetteData.RecommendedGroupSizeMax);
34
35 return data;
36}
37
38ByteBuffer& operator<<(ByteBuffer& data, VignetteDataSet const& vignetteDataSet)
39{
40 data << Size<uint32>(vignetteDataSet.IDs);
41 data << Size<uint32>(vignetteDataSet.Data);
42 for (ObjectGuid const& id : vignetteDataSet.IDs)
43 data << id;
44
45 for (VignetteData const& vignetteData : vignetteDataSet.Data)
46 data << vignetteData;
47
48 return data;
49}
50
52{
53 _worldPacket << Bits<1>(ForceUpdate);
54 _worldPacket << Bits<1>(InFogOfWar);
55 _worldPacket << Size<uint32>(Removed);
58 for (ObjectGuid const& removed : Removed)
59 _worldPacket << removed;
60
61 return &_worldPacket;
62}
63}
int32_t int32
Definition Define.h:150
uint16_t uint16
Definition Define.h:155
uint32_t uint32
Definition Define.h:154
WorldPacket _worldPacket
Definition Packet.h:43
WorldPacket const * Write() override
ByteBuffer & operator<<(ByteBuffer &data, VignetteData const &vignetteData)
TaggedPosition<::Position::XYZ > Position