TrinityCore
Loading...
Searching...
No Matches
BattlegroundPackets.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_BATTLEGROUND_PACKETS_H
19#define TRINITYCORE_BATTLEGROUND_PACKETS_H
20
21#include "Packet.h"
22#include "LFGPacketsCommon.h"
23#include "ObjectGuid.h"
24#include "Optional.h"
25#include "PacketUtilities.h"
26#include "Position.h"
27#include <array>
28
29namespace WorldPackets
30{
31 namespace Battleground
32 {
51
53 {
54 public:
56
57 void Read() override;
58
60 };
61
63 {
64 public:
66
67 void Read() override;
68
70 };
71
73 {
74 public:
76
77 WorldPacket const* Write() override;
78
81 };
82
83 class HearthAndResurrect final : public ClientPacket
84 {
85 public:
87
88 void Read() override { }
89 };
90
91 class PVPLogDataRequest final : public ClientPacket
92 {
93 public:
94 explicit PVPLogDataRequest(WorldPacket&& packet) : ClientPacket(CMSG_PVP_LOG_DATA, std::move(packet)) { }
95
96 void Read() override { }
97 };
98
100 {
102 {
103 RatingData() { } // work around clang bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101227
104
105 int32 Prematch[2] = { };
106 int32 Postmatch[2] = { };
108 };
109
111 {
112 HonorData() { } // work around clang bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101227
113
117 };
118
120 {
122 PVPMatchPlayerPVPStat(int32 pvpStatID, int32 pvpStatValue) : PvpStatID(pvpStatID), PvpStatValue(pvpStatValue) { }
123
126 };
127
151
152 std::vector<PVPMatchPlayerStatistics> Statistics;
154 std::array<int8, 2> PlayerCount = { };
155 };
156
158 {
159 public:
161
162 WorldPacket const* Write() override;
163
165 };
166
178
180 {
181 public:
183
184 WorldPacket const* Write() override;
185
187 };
188
201
203 {
204 public:
206
207 WorldPacket const* Write() override;
208
212 bool LeftEarly = false;
213 bool Brawl = false;
216 };
217
219 {
220 public:
222
223 WorldPacket const* Write() override;
224
227 bool AsGroup = false;
228 bool SuspendedQueue = false;
232 };
233
235 {
236 public:
237 explicit BattlefieldStatusFailed() : ServerPacket(SMSG_BATTLEFIELD_STATUS_FAILED, 8 + 16 + 4 + 16 + 4 + 4 + 4) { }
238
239 WorldPacket const* Write() override;
240
245 };
246
247 class BattlemasterJoin final : public ClientPacket
248 {
249 public:
250 explicit BattlemasterJoin(WorldPacket&& packet) : ClientPacket(CMSG_BATTLEMASTER_JOIN, std::move(packet)) { }
251
252 void Read() override;
253
256 std::array<int32, 2> BlacklistMap = { };
257 };
258
260 {
261 public:
263
264 void Read() override;
265
268 };
269
270 class BattlefieldLeave final : public ClientPacket
271 {
272 public:
273 explicit BattlefieldLeave(WorldPacket&& packet) : ClientPacket(CMSG_BATTLEFIELD_LEAVE, std::move(packet)) { }
274
275 void Read() override { }
276 };
277
278 class BattlefieldPort final : public ClientPacket
279 {
280 public:
281 explicit BattlefieldPort(WorldPacket&& packet) : ClientPacket(CMSG_BATTLEFIELD_PORT, std::move(packet)) { }
282
283 void Read() override;
284
286 bool AcceptedInvite = false;
287 };
288
290 {
291 public:
293
294 void Read() override;
295
297 };
298
299 class BattlefieldList final : public ServerPacket
300 {
301 public:
302 explicit BattlefieldList() : ServerPacket(SMSG_BATTLEFIELD_LIST, 1 + 1 + 16 + 1 + 1 + 1 + 4 + 1 + 4) { }
303
304 WorldPacket const* Write() override;
305
310 std::vector<int32> Battlefields; // Players cannot join a specific battleground instance anymore - this is always empty
311 bool PvpAnywhere = false;
312 bool HasRandomWinToday = false;
313 };
314
316 {
317 public:
319
320 void Read() override { }
321 };
322
323 class PVPOptionsEnabled final : public ServerPacket
324 {
325 public:
327
328 WorldPacket const* Write() override;
329
330 bool RatedBattlegrounds = false;
331 bool PugBattlegrounds = false;
333 bool WargameArenas = false;
334 bool RatedArenas = false;
335 bool ArenaSkirmish = false;
336 bool SoloShuffle = false;
337 bool RatedSoloShuffle = false;
338 bool BattlegroundBlitz = false;
339 bool RatedBattlegroundBlitz = false; // solo rbg
340 };
341
343 {
344 public:
346
347 void Read() override { }
348 };
349
350 class ReportPvPPlayerAFK final : public ClientPacket
351 {
352 public:
354
355 void Read() override;
356
358 };
359
361 {
362 public:
364
365 WorldPacket const* Write() override;
366
368 {
370 PVP_REPORT_AFK_GENERIC_FAILURE = 1, // there are more error codes but they are impossible to receive without modifying the client
373 };
374
379 };
380
388
390 {
391 public:
393
394 WorldPacket const* Write() override;
395
396 std::vector<BattlegroundPlayerPosition> FlagCarriers;
397 };
398
400 {
401 public:
403
404 WorldPacket const* Write() override;
405
407 };
408
410 {
411 public:
413
414 WorldPacket const* Write() override;
415
417 };
418
419 class DestroyArenaUnit final : public ServerPacket
420 {
421 public:
423
424 WorldPacket const* Write() override;
425
427 };
428
429 class RequestPVPRewards final : public ClientPacket
430 {
431 public:
433
434 void Read() override { }
435 };
436
438 {
439 public:
441
442 void Read() override { }
443 };
444
476
483
484 enum class PVPMatchState : uint8
485 {
486 Waiting = 0,
487 StartUp = 1,
488 Engaged = 2,
489 PostRound = 3,
490 Inactive = 4,
491 Complete = 5
492 };
493
511
512 class PVPMatchSetState final : public ServerPacket
513 {
514 public:
516
517 WorldPacket const* Write() override;
518
520 };
521
534
536 {
537 Neutral = 1,
538 ContestedHorde = 2,
540 HordeCaptured = 4,
542 };
543
552
553 class UpdateCapturePoint final : public ServerPacket
554 {
555 public:
557
558 WorldPacket const* Write() override;
559
561 };
562
564 {
565 public:
567 explicit CapturePointRemoved(ObjectGuid capturePointGUID) : ServerPacket(SMSG_CAPTURE_POINT_REMOVED), CapturePointGUID(capturePointGUID) { }
568
569 WorldPacket const* Write() override;
570
572 };
573 }
574}
575
576#endif // TRINITYCORE_BATTLEGROUND_PACKETS_H
uint8_t uint8
Definition Define.h:156
int8_t int8
Definition Define.h:152
int32_t int32
Definition Define.h:150
uint64_t uint64
Definition Define.h:153
uint32_t uint32
Definition Define.h:154
@ SMSG_BATTLEFIELD_STATUS_NEED_CONFIRMATION
Definition Opcodes.h:1185
@ SMSG_BATTLEFIELD_LIST
Definition Opcodes.h:1180
@ SMSG_UPDATE_CAPTURE_POINT
Definition Opcodes.h:2416
@ SMSG_BATTLEFIELD_STATUS_ACTIVE
Definition Opcodes.h:1182
@ SMSG_AREA_SPIRIT_HEALER_TIME
Definition Opcodes.h:1136
@ SMSG_REPORT_PVP_PLAYER_AFK_RESULT
Definition Opcodes.h:2212
@ SMSG_BATTLEGROUND_PLAYER_POSITIONS
Definition Opcodes.h:1193
@ SMSG_PVP_MATCH_SET_STATE
Definition Opcodes.h:2130
@ SMSG_PVP_MATCH_COMPLETE
Definition Opcodes.h:2128
@ SMSG_SEASON_INFO
Definition Opcodes.h:2257
@ SMSG_DESTROY_ARENA_UNIT
Definition Opcodes.h:1412
@ SMSG_BATTLEFIELD_STATUS_NONE
Definition Opcodes.h:1186
@ SMSG_BATTLEFIELD_STATUS_QUEUED
Definition Opcodes.h:1187
@ SMSG_BATTLEGROUND_PLAYER_LEFT
Definition Opcodes.h:1192
@ SMSG_PVP_MATCH_INITIALIZE
Definition Opcodes.h:2129
@ SMSG_PVP_OPTIONS_ENABLED
Definition Opcodes.h:2133
@ SMSG_PVP_MATCH_STATISTICS
Definition Opcodes.h:2132
@ SMSG_BATTLEFIELD_STATUS_FAILED
Definition Opcodes.h:1183
@ SMSG_BATTLEGROUND_PLAYER_JOINED
Definition Opcodes.h:1191
@ SMSG_RATED_PVP_INFO
Definition Opcodes.h:2191
@ SMSG_CAPTURE_POINT_REMOVED
Definition Opcodes.h:1278
@ CMSG_PVP_LOG_DATA
Definition Opcodes.h:757
@ CMSG_BATTLEMASTER_JOIN
Definition Opcodes.h:106
@ CMSG_GET_PVP_OPTIONS_ENABLED
Definition Opcodes.h:393
@ CMSG_REQUEST_BATTLEFIELD_STATUS
Definition Opcodes.h:832
@ CMSG_AREA_SPIRIT_HEALER_QUEUE
Definition Opcodes.h:61
@ CMSG_BATTLEFIELD_LIST
Definition Opcodes.h:103
@ CMSG_REQUEST_PVP_REWARDS
Definition Opcodes.h:852
@ CMSG_AREA_SPIRIT_HEALER_QUERY
Definition Opcodes.h:60
@ CMSG_BATTLEMASTER_JOIN_ARENA
Definition Opcodes.h:107
@ CMSG_HEARTH_AND_RESURRECT
Definition Opcodes.h:453
@ CMSG_REQUEST_RATED_PVP_INFO
Definition Opcodes.h:854
@ CMSG_BATTLEFIELD_PORT
Definition Opcodes.h:104
@ CMSG_BATTLEFIELD_LEAVE
Definition Opcodes.h:102
@ CMSG_REPORT_PVP_PLAYER_AFK
Definition Opcodes.h:827
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition Optional.h:25
std::vector< BattlegroundPlayerPosition > FlagCarriers
WorldPackets::Duration< Seconds > Duration
Optional< RatedMatchDeserterPenalty > DeserterPenalty
struct WorldPackets::Battleground::RatedPvpInfo::BracketInfo Bracket[9]
STL namespace.
std::vector< PVPMatchPlayerStatistics > Statistics
WorldPackets::Duration< Milliseconds, int32 > QueuePenaltyDuration