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
20
WorldPacket
const
*
WorldPackets::EquipmentSet::EquipmentSetID::Write
()
21
{
22
_worldPacket
<<
uint32
(
SetID
);
23
_worldPacket
.
appendPackGUID
(
GUID
);
24
25
return
&
_worldPacket
;
26
}
27
28
WorldPacket
const
*
WorldPackets::EquipmentSet::LoadEquipmentSet::Write
()
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
))
43
_worldPacket <<
EquipmentSetInfo::IgnoredSlot
.
WriteAsPacked
();
44
else
45
_worldPacket <<
equipSet
->Pieces[
i
].WriteAsPacked();
46
}
47
}
48
49
return
&_worldPacket;
50
}
51
52
void
WorldPackets::EquipmentSet::SaveEquipmentSet::Read
()
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
uint8_t uint8
Definition
Define.h:135
uint32
uint32_t uint32
Definition
Define.h:133
EquipmentSetPackets.h
EQUIPMENT_SET_SLOTS
#define EQUIPMENT_SET_SLOTS
Definition
EquipmentSet.h:34
ByteBuffer::appendPackGUID
void appendPackGUID(uint64 guid)
Definition
ByteBuffer.h:468
ObjectGuid::WriteAsPacked
PackedGuidWriter WriteAsPacked() const
Definition
ObjectGuid.h:152
WorldPacket
Definition
WorldPacket.h:27
WorldPackets::Array
Definition
PacketUtilities.h:120
WorldPackets::EquipmentSet::EquipmentSetID::SetID
uint32 SetID
Index.
Definition
EquipmentSetPackets.h:36
WorldPackets::EquipmentSet::EquipmentSetID::GUID
uint64 GUID
Set Identifier.
Definition
EquipmentSetPackets.h:35
WorldPackets::EquipmentSet::EquipmentSetID::Write
WorldPacket const * Write() override
Definition
EquipmentSetPackets.cpp:20
WorldPackets::EquipmentSet::LoadEquipmentSet::Write
WorldPacket const * Write() override
Definition
EquipmentSetPackets.cpp:28
WorldPackets::EquipmentSet::SaveEquipmentSet::Read
void Read() override
Definition
EquipmentSetPackets.cpp:52
WorldPackets::Packet::_worldPacket
WorldPacket _worldPacket
Definition
Packet.h:42
EquipmentSetInfo::EquipmentSetData
Data sent in EquipmentSet related packets.
Definition
EquipmentSet.h:42
EquipmentSetInfo::IgnoredSlot
static ObjectGuid const IgnoredSlot
Definition
EquipmentSet.h:25349
server
game
Server
Packets
EquipmentSetPackets.cpp
Generated by
1.9.8