TrinityCore
Loading...
Searching...
No Matches
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 TRINITYCORE_BATTLE_PET_PACKETS_H
19#define TRINITYCORE_BATTLE_PET_PACKETS_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 {
38
58
60 {
64 bool Locked = true;
65 };
66
67 class BattlePetJournal final : public ServerPacket
68 {
69 public:
71
72 WorldPacket const* Write() override;
73
75 bool HasJournalLock = false;
76 std::vector<std::reference_wrapper<BattlePetSlot>> Slots;
77 std::vector<std::reference_wrapper<BattlePet>> Pets;
78 };
79
87
95
97 {
98 public:
100
101 void Read() override { }
102 };
103
105 {
106 public:
108
109 void Read() override { }
110 };
111
112 class BattlePetUpdates final : public ServerPacket
113 {
114 public:
116
117 WorldPacket const* Write() override;
118
119 std::vector<std::reference_wrapper<BattlePet const>> Pets;
120 bool PetAdded = false;
121 };
122
124 {
125 public:
127
128 WorldPacket const* Write() override;
129
130 std::vector<BattlePetSlot> Slots;
131 bool AutoSlotted = false;
132 bool NewSlot = false;
133 };
134
136 {
137 public:
139
140 void Read() override;
141
144 };
145
147 {
148 public:
150
151 void Read() override;
152
154 std::string Name;
155 std::unique_ptr<DeclinedName> DeclinedNames;
156 };
157
158 class QueryBattlePetName final : public ClientPacket
159 {
160 public:
162
163 void Read() override;
164
167 };
168
185
186 class BattlePetDeletePet final : public ClientPacket
187 {
188 public:
190
191 void Read() override;
192
194 };
195
196 class BattlePetSetFlags final : public ClientPacket
197 {
198 public:
200
201 void Read() override;
202
206 };
207
209 {
210 public:
212
213 void Read() override;
214
216 };
217
218 class CageBattlePet final : public ClientPacket
219 {
220 public:
221 explicit CageBattlePet(WorldPacket&& packet) : ClientPacket(CMSG_CAGE_BATTLE_PET, std::move(packet)) { }
222
223 void Read() override;
224
226 };
227
228 class BattlePetDeleted final : public ServerPacket
229 {
230 public:
232
233 WorldPacket const* Write() override;
234
236 };
237
238 class BattlePetError final : public ServerPacket
239 {
240 public:
242
243 WorldPacket const* Write() override;
244
247 };
248
249 class BattlePetSummon final : public ClientPacket
250 {
251 public:
252 explicit BattlePetSummon(WorldPacket&& packet) : ClientPacket(CMSG_BATTLE_PET_SUMMON, std::move(packet)) { }
253
254 void Read() override;
255
257 };
258
260 {
261 public:
263
264 void Read() override;
265
267 };
268 }
269}
270
271#endif // TRINITYCORE_BATTLE_PET_PACKETS_H
uint8_t uint8
Definition Define.h:156
int32_t int32
Definition Define.h:150
uint16_t uint16
Definition Define.h:155
uint32_t uint32
Definition Define.h:154
@ SMSG_BATTLE_PET_JOURNAL_LOCK_ACQUIRED
Definition Opcodes.h:1223
@ SMSG_QUERY_BATTLE_PET_NAME_RESPONSE
Definition Opcodes.h:2135
@ SMSG_BATTLE_PET_JOURNAL
Definition Opcodes.h:1222
@ SMSG_PET_BATTLE_SLOT_UPDATES
Definition Opcodes.h:2068
@ SMSG_BATTLE_PET_ERROR
Definition Opcodes.h:1221
@ SMSG_BATTLE_PET_DELETED
Definition Opcodes.h:1220
@ SMSG_BATTLE_PET_JOURNAL_LOCK_DENIED
Definition Opcodes.h:1224
@ SMSG_BATTLE_PET_UPDATES
Definition Opcodes.h:1228
@ CMSG_BATTLE_PET_REQUEST_JOURNAL_LOCK
Definition Opcodes.h:129
@ CMSG_BATTLE_PET_REQUEST_JOURNAL
Definition Opcodes.h:128
@ CMSG_QUERY_BATTLE_PET_NAME
Definition Opcodes.h:758
@ CMSG_BATTLE_PET_SUMMON
Definition Opcodes.h:132
@ CMSG_BATTLE_PET_DELETE_PET
Definition Opcodes.h:126
@ CMSG_BATTLE_PET_SET_BATTLE_SLOT
Definition Opcodes.h:130
@ CMSG_BATTLE_PET_UPDATE_NOTIFY
Definition Opcodes.h:134
@ CMSG_CAGE_BATTLE_PET
Definition Opcodes.h:148
@ CMSG_BATTLE_PET_MODIFY_NAME
Definition Opcodes.h:127
@ CMSG_BATTLE_PET_CLEAR_FANFARE
Definition Opcodes.h:125
@ CMSG_BATTLE_PET_SET_FLAGS
Definition Opcodes.h:131
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition Optional.h:25
WorldPacket const * Write() override
std::vector< std::reference_wrapper< BattlePet > > Pets
std::vector< std::reference_wrapper< BattlePetSlot > > Slots
std::unique_ptr< DeclinedName > DeclinedNames
std::vector< std::reference_wrapper< BattlePet const > > Pets
WorldPacket _worldPacket
Definition Packet.h:43
STL namespace.
Optional< BattlePetOwnerInfo > OwnerInfo