TrinityCore
Loading...
Searching...
No Matches
EquipmentSetPackets.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 "EquipmentSetPackets.h"
19
27
29{
30 _worldPacket << uint32(SetData.size());
31
32 for (EquipmentSetInfo::EquipmentSetData const* equipSet : SetData)
33 {
34 _worldPacket.appendPackGUID(equipSet->Guid);
35 _worldPacket << uint32(equipSet->SetID);
36 _worldPacket << equipSet->SetName;
37 _worldPacket << equipSet->SetIcon;
38
39 for (uint32 i = 0; i < EQUIPMENT_SET_SLOTS; ++i)
40 {
41 // ignored slots stored in IgnoreMask, client wants "1" as raw GUID, so no HighGuid::Item
42 if (equipSet->IgnoreMask & (1 << i))
44 else
45 _worldPacket << equipSet->Pieces[i].WriteAsPacked();
46 }
47 }
48
49 return &_worldPacket;
50}
51
53{
54 _worldPacket.readPackGUID(Set.Guid);
55 _worldPacket >> Set.SetID;
56 _worldPacket >> Set.SetName;
57 _worldPacket >> Set.SetIcon;
58
59 for (uint8 i = 0; i < EQUIPMENT_SET_SLOTS; ++i)
60 _worldPacket >> Set.Pieces[i].ReadAsPacked();
61}
uint8_t uint8
Definition Define.h:135
uint32_t uint32
Definition Define.h:133
#define EQUIPMENT_SET_SLOTS
void appendPackGUID(uint64 guid)
Definition ByteBuffer.h:468
PackedGuidWriter WriteAsPacked() const
Definition ObjectGuid.h:152
WorldPacket _worldPacket
Definition Packet.h:42
Data sent in EquipmentSet related packets.
static ObjectGuid const IgnoredSlot