TrinityCore
BattlePetPackets.h
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#ifndef BattlePetPackets_h__
19#define BattlePetPackets_h__
20
21#include "Packet.h"
22#include "PacketUtilities.h"
23#include "ObjectGuid.h"
24#include "Optional.h"
25#include "UnitDefines.h"
26#include <memory>
27
28namespace WorldPackets
29{
30 namespace BattlePet
31 {
33 {
37 };
38
39 struct BattlePet
40 {
55 std::string Name;
56 };
57
59 {
63 bool Locked = true;
64 };
65
66 class BattlePetJournal final : public ServerPacket
67 {
68 public:
70
71 WorldPacket const* Write() override;
72
74 bool HasJournalLock = false;
75 std::vector<std::reference_wrapper<BattlePetSlot>> Slots;
76 std::vector<std::reference_wrapper<BattlePet>> Pets;
77 };
78
80 {
81 public:
83
84 WorldPacket const* Write() override { return &_worldPacket; }
85 };
86
88 {
89 public:
91
92 WorldPacket const* Write() override { return &_worldPacket; }
93 };
94
96 {
97 public:
99
100 void Read() override { }
101 };
102
104 {
105 public:
107
108 void Read() override { }
109 };
110
111 class BattlePetUpdates final : public ServerPacket
112 {
113 public:
115
116 WorldPacket const* Write() override;
117
118 std::vector<std::reference_wrapper<BattlePet>> Pets;
119 bool PetAdded = false;
120 };
121
123 {
124 public:
126
127 WorldPacket const* Write() override;
128
129 std::vector<BattlePetSlot> Slots;
130 bool AutoSlotted = false;
131 bool NewSlot = false;
132 };
133
135 {
136 public:
138
139 void Read() override;
140
143 };
144
146 {
147 public:
149
150 void Read() override;
151
153 std::string Name;
154 std::unique_ptr<DeclinedName> DeclinedNames;
155 };
156
157 class QueryBattlePetName final : public ClientPacket
158 {
159 public:
161
162 void Read() override;
163
166 };
167
169 {
170 public:
172
173 WorldPacket const* Write() override;
174
178 bool Allow = false;
179
180 bool HasDeclined = false;
182 std::string Name;
183 };
184
185 class BattlePetDeletePet final : public ClientPacket
186 {
187 public:
189
190 void Read() override;
191
193 };
194
195 class BattlePetSetFlags final : public ClientPacket
196 {
197 public:
199
200 void Read() override;
201
205 };
206
208 {
209 public:
211
212 void Read() override;
213
215 };
216
217 class CageBattlePet final : public ClientPacket
218 {
219 public:
221
222 void Read() override;
223
225 };
226
227 class BattlePetDeleted final : public ServerPacket
228 {
229 public:
231
232 WorldPacket const* Write() override;
233
235 };
236
237 class BattlePetError final : public ServerPacket
238 {
239 public:
241
242 WorldPacket const* Write() override;
243
246 };
247
248 class BattlePetSummon final : public ClientPacket
249 {
250 public:
252
253 void Read() override;
254
256 };
257
259 {
260 public:
262
263 void Read() override;
264
266 };
267 }
268}
269
270#endif // BattlePetPackets_h__
uint8_t uint8
Definition: Define.h:144
int32_t int32
Definition: Define.h:138
uint16_t uint16
Definition: Define.h:143
uint32_t uint32
Definition: Define.h:142
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition: Optional.h:25
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
std::vector< std::reference_wrapper< BattlePet > > Pets
std::vector< std::reference_wrapper< BattlePetSlot > > Slots
std::unique_ptr< DeclinedName > DeclinedNames
WorldPacket const * Write() override
std::vector< std::reference_wrapper< BattlePet > > Pets
WorldPacket _worldPacket
Definition: Packet.h:43
@ CMSG_BATTLE_PET_REQUEST_JOURNAL_LOCK
Definition: Opcodes.h:136
@ CMSG_BATTLE_PET_REQUEST_JOURNAL
Definition: Opcodes.h:135
@ CMSG_QUERY_BATTLE_PET_NAME
Definition: Opcodes.h:637
@ CMSG_BATTLE_PET_SUMMON
Definition: Opcodes.h:139
@ CMSG_BATTLE_PET_DELETE_PET
Definition: Opcodes.h:132
@ CMSG_BATTLE_PET_SET_BATTLE_SLOT
Definition: Opcodes.h:137
@ CMSG_BATTLE_PET_UPDATE_NOTIFY
Definition: Opcodes.h:141
@ CMSG_CAGE_BATTLE_PET
Definition: Opcodes.h:154
@ CMSG_BATTLE_PET_MODIFY_NAME
Definition: Opcodes.h:134
@ CMSG_BATTLE_PET_CLEAR_FANFARE
Definition: Opcodes.h:131
@ CMSG_BATTLE_PET_SET_FLAGS
Definition: Opcodes.h:138
@ SMSG_BATTLE_PET_JOURNAL_LOCK_ACQUIRED
Definition: Opcodes.h:1029
@ SMSG_QUERY_BATTLE_PET_NAME_RESPONSE
Definition: Opcodes.h:1774
@ SMSG_BATTLE_PET_JOURNAL
Definition: Opcodes.h:1028
@ SMSG_PET_BATTLE_SLOT_UPDATES
Definition: Opcodes.h:1710
@ SMSG_BATTLE_PET_ERROR
Definition: Opcodes.h:1027
@ SMSG_BATTLE_PET_DELETED
Definition: Opcodes.h:1026
@ SMSG_BATTLE_PET_JOURNAL_LOCK_DENIED
Definition: Opcodes.h:1030
@ SMSG_BATTLE_PET_UPDATES
Definition: Opcodes.h:1034
STL namespace.
Optional< BattlePetOwnerInfo > OwnerInfo