TrinityCore
Loading...
Searching...
No Matches
LootPackets.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 "
LootPackets.h
"
19
20
namespace
WorldPackets::Loot
21
{
22
static
ByteBuffer
&
operator<<
(
ByteBuffer
& data,
LootItemData
const
&
lootItem
)
23
{
24
data <<
uint8
(
lootItem
.LootListID);
25
data <<
uint32
(
lootItem
.ItemID);
26
data <<
uint32
(
lootItem
.Quantity);
27
data <<
uint32
(
lootItem
.ItemDisplayInfoID);
28
data <<
int32
(
lootItem
.RandomPropertiesSeed);
29
data <<
int32
(
lootItem
.RandomPropertiesID);
30
data <<
uint8
(
lootItem
.UIType);
31
32
return
data;
33
}
34
35
void
LootUnit::Read
()
36
{
37
_worldPacket
>>
Unit
;
38
}
39
40
WorldPacket
const
*
LootResponse::Write
()
41
{
42
_worldPacket
<<
Owner
;
43
_worldPacket
<<
uint8
(
AcquireReason
);
44
if
(
AcquireReason
)
45
{
46
_worldPacket
<<
uint32
(
Coins
);
47
_worldPacket
<<
uint8
(
Items
.size());
48
for
(
LootItemData
const
& item :
Items
)
49
_worldPacket
<< item;
50
}
51
else
52
_worldPacket
<<
uint8
(
FailureReason
);
53
54
return
&
_worldPacket
;
55
}
56
57
void
LootItem::Read
()
58
{
59
_worldPacket
>>
LootListID
;
60
}
61
62
WorldPacket
const
*
LootRemoved::Write
()
63
{
64
_worldPacket
<<
LootListID
;
65
66
return
&
_worldPacket
;
67
}
68
69
void
LootRelease::Read
()
70
{
71
_worldPacket
>>
Unit
;
72
}
73
74
WorldPacket
const
*
LootMoneyNotify::Write
()
75
{
76
_worldPacket
<<
uint32
(
Money
);
77
_worldPacket
<<
bool
(
SoleLooter
);
78
79
return
&
_worldPacket
;
80
}
81
}
uint8
uint8_t uint8
Definition
Define.h:135
int32
int32_t int32
Definition
Define.h:129
uint32
uint32_t uint32
Definition
Define.h:133
LootPackets.h
ByteBuffer
Definition
ByteBuffer.h:70
WorldPacket
Definition
WorldPacket.h:27
WorldPackets::Array
Definition
PacketUtilities.h:120
WorldPackets::Loot::LootItem::Read
void Read() override
Definition
LootPackets.cpp:57
WorldPackets::Loot::LootItem::LootListID
uint8 LootListID
Definition
LootPackets.h:70
WorldPackets::Loot::LootMoneyNotify::Money
uint32 Money
Definition
LootPackets.h:108
WorldPackets::Loot::LootMoneyNotify::Write
WorldPacket const * Write() override
Definition
LootPackets.cpp:74
WorldPackets::Loot::LootMoneyNotify::SoleLooter
bool SoleLooter
Definition
LootPackets.h:109
WorldPackets::Loot::LootRelease::Unit
ObjectGuid Unit
Definition
LootPackets.h:90
WorldPackets::Loot::LootRelease::Read
void Read() override
Definition
LootPackets.cpp:69
WorldPackets::Loot::LootRemoved::LootListID
uint8 LootListID
Definition
LootPackets.h:80
WorldPackets::Loot::LootRemoved::Write
WorldPacket const * Write() override
Definition
LootPackets.cpp:62
WorldPackets::Loot::LootResponse::FailureReason
uint8 FailureReason
Definition
LootPackets.h:58
WorldPackets::Loot::LootResponse::Items
std::vector< LootItemData > Items
Definition
LootPackets.h:60
WorldPackets::Loot::LootResponse::Write
WorldPacket const * Write() override
Definition
LootPackets.cpp:40
WorldPackets::Loot::LootResponse::Owner
ObjectGuid Owner
Definition
LootPackets.h:56
WorldPackets::Loot::LootResponse::AcquireReason
uint8 AcquireReason
Definition
LootPackets.h:57
WorldPackets::Loot::LootResponse::Coins
uint32 Coins
Definition
LootPackets.h:59
WorldPackets::Loot::LootUnit::Unit
ObjectGuid Unit
Definition
LootPackets.h:35
WorldPackets::Loot::LootUnit::Read
void Read() override
Definition
LootPackets.cpp:35
WorldPackets::Packet::_worldPacket
WorldPacket _worldPacket
Definition
Packet.h:42
WorldPackets::Loot
Definition
Loot.h:38
WorldPackets::Loot::operator<<
static ByteBuffer & operator<<(ByteBuffer &data, LootItemData const &lootItem)
Definition
LootPackets.cpp:22
WorldPackets::Loot::LootItemData
Definition
LootPackets.h:39
server
game
Server
Packets
LootPackets.cpp
Generated by
1.9.8