TrinityCore
VoidStoragePackets.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 "VoidStoragePackets.h"
19
21{
23 return &_worldPacket;
24}
25
27{
28 _worldPacket >> Npc;
29}
30
32{
33 _worldPacket >> Npc;
34}
35
37{
38 _worldPacket << uint8(Reason);
39 return &_worldPacket;
40}
41
43{
44 data << voidItem.Guid;
45 data << voidItem.Creator;
46 data << uint32(voidItem.Slot);
47 data << voidItem.Item;
48 return data;
49}
50
52{
53 _worldPacket.reserve(1 + Items.size() * sizeof(VoidItem));
54
55 _worldPacket.WriteBits(Items.size(), 8);
56 _worldPacket.FlushBits();
57
58 for (VoidItem const& voidItem : Items)
59 _worldPacket << voidItem;
60
61 return &_worldPacket;
62}
63
65{
66 _worldPacket >> Npc;
67 Deposits.resize(_worldPacket.read<uint32>());
68 Withdrawals.resize(_worldPacket.read<uint32>());
69
70 for (ObjectGuid& deposit : Deposits)
71 _worldPacket >> deposit;
72
73 for (ObjectGuid& withdrawal : Withdrawals)
74 _worldPacket >> withdrawal;
75}
76
78{
79 _worldPacket.reserve(1 + AddedItems.size() * sizeof(VoidItem) + RemovedItems.size() * 16);
80
81 _worldPacket.WriteBits(AddedItems.size(), 4);
82 _worldPacket.WriteBits(RemovedItems.size(), 4);
83 _worldPacket.FlushBits();
84
85 for (VoidItem const& addedItem : AddedItems)
86 _worldPacket << addedItem;
87
88 for (ObjectGuid const& removedItem : RemovedItems)
89 _worldPacket << removedItem;
90
91 return &_worldPacket;
92}
93
95{
96 _worldPacket >> Npc;
97 _worldPacket >> VoidItemGuid;
98 _worldPacket >> DstSlot;
99}
100
102{
103 _worldPacket << VoidItemA << uint32(VoidItemSlotA);
104 _worldPacket << VoidItemB << uint32(VoidItemSlotB);
105 return &_worldPacket;
106}
uint8_t uint8
Definition: Define.h:144
int32_t int32
Definition: Define.h:138
uint32_t uint32
Definition: Define.h:142
void reserve(size_t ressize)
Definition: ByteBuffer.h:546
WorldPacket _worldPacket
Definition: Packet.h:43
ByteBuffer & operator<<(ByteBuffer &data, Movement::MonsterSplineFilterKey const &monsterSplineFilterKey)
WorldPackets::Item::ItemInstance Item