TrinityCore
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 BattlegroundPackets_h__
19#define BattlegroundPackets_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 {
33 class SeasonInfo final : public ServerPacket
34 {
35 public:
36 SeasonInfo() : ServerPacket(SMSG_SEASON_INFO, 4 + 4 + 4 + 4 + 4 + 1) { }
37
38 WorldPacket const* Write() override;
39
50 };
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:
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
129 {
133 bool IsInWorld = false;
142 std::vector<PVPMatchPlayerPVPStat> Stats;
150 };
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
168 {
170 std::vector<uint64> QueueID;
175 bool RegisteredMatch = false;
176 bool TournamentRules = false;
177 };
178
180 {
181 public:
183
184 WorldPacket const* Write() override;
185
187 };
188
190 {
191 public:
193
194 WorldPacket const* Write() override;
195
200 };
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:
238
239 WorldPacket const* Write() override;
240
245 };
246
247 class BattlemasterJoin final : public ClientPacket
248 {
249 public:
251
252 void Read() override;
253
257 };
258
260 {
261 public:
263
264 void Read() override;
265
268 };
269
270 class BattlefieldLeave final : public ClientPacket
271 {
272 public:
274
275 void Read() override { }
276 };
277
278 class BattlefieldPort final : public ClientPacket
279 {
280 public:
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 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
382 {
387 };
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
445 class RatedPvpInfo final : public ServerPacket
446 {
447 public:
449
450 WorldPacket const* Write() override;
451
453 {
473 bool Disqualified = false;
475 };
476
478 {
482 };
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
494 class PVPMatchInitialize final : public ServerPacket
495 {
496 public:
498
499 WorldPacket const* Write() override;
500
508 bool Registered = false;
509 bool AffectsRating = false;
510 };
511
512 class PVPMatchSetState final : public ServerPacket
513 {
514 public:
516
517 WorldPacket const* Write() override;
518
520 };
521
522 class PVPMatchComplete final : public ServerPacket
523 {
524 public:
526
527 WorldPacket const* Write() override;
528
533 };
534
536 {
537 Neutral = 1,
538 ContestedHorde = 2,
540 HordeCaptured = 4,
542 };
543
545 {
551 };
552
553 class UpdateCapturePoint final : public ServerPacket
554 {
555 public:
557
558 WorldPacket const* Write() override;
559
561 };
562
564 {
565 public:
568
569 WorldPacket const* Write() override;
570
572 };
573 }
574}
575
576#endif // BattlegroundPackets_h__
uint8_t uint8
Definition: Define.h:150
int8_t int8
Definition: Define.h:146
int32_t int32
Definition: Define.h:144
uint64_t uint64
Definition: Define.h:147
uint32_t uint32
Definition: Define.h:148
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition: Optional.h:25
std::vector< BattlegroundPlayerPosition > FlagCarriers
WorldPackets::Duration< Seconds > Duration
WorldPackets::Duration< Seconds > Duration
Optional< RatedMatchDeserterPenalty > DeserterPenalty
struct WorldPackets::Battleground::RatedPvpInfo::BracketInfo Bracket[9]
WorldPacket const * Write() override
@ SMSG_BATTLEFIELD_STATUS_NEED_CONFIRMATION
Definition: Opcodes.h:1060
@ SMSG_BATTLEFIELD_LIST
Definition: Opcodes.h:1055
@ SMSG_UPDATE_CAPTURE_POINT
Definition: Opcodes.h:2129
@ SMSG_BATTLEFIELD_STATUS_ACTIVE
Definition: Opcodes.h:1057
@ SMSG_AREA_SPIRIT_HEALER_TIME
Definition: Opcodes.h:1007
@ SMSG_REPORT_PVP_PLAYER_AFK_RESULT
Definition: Opcodes.h:1941
@ SMSG_BATTLEGROUND_PLAYER_POSITIONS
Definition: Opcodes.h:1068
@ SMSG_PVP_MATCH_SET_STATE
Definition: Opcodes.h:1865
@ SMSG_PVP_MATCH_COMPLETE
Definition: Opcodes.h:1863
@ SMSG_SEASON_INFO
Definition: Opcodes.h:1987
@ SMSG_DESTROY_ARENA_UNIT
Definition: Opcodes.h:1276
@ SMSG_BATTLEFIELD_STATUS_NONE
Definition: Opcodes.h:1061
@ SMSG_BATTLEFIELD_STATUS_QUEUED
Definition: Opcodes.h:1062
@ SMSG_BATTLEGROUND_PLAYER_LEFT
Definition: Opcodes.h:1067
@ SMSG_PVP_MATCH_INITIALIZE
Definition: Opcodes.h:1864
@ SMSG_PVP_OPTIONS_ENABLED
Definition: Opcodes.h:1868
@ SMSG_PVP_MATCH_STATISTICS
Definition: Opcodes.h:1867
@ SMSG_BATTLEFIELD_STATUS_FAILED
Definition: Opcodes.h:1058
@ SMSG_BATTLEGROUND_PLAYER_JOINED
Definition: Opcodes.h:1066
@ SMSG_RATED_PVP_INFO
Definition: Opcodes.h:1923
@ SMSG_CAPTURE_POINT_REMOVED
Definition: Opcodes.h:1150
@ CMSG_PVP_LOG_DATA
Definition: Opcodes.h:668
@ CMSG_BATTLEMASTER_JOIN
Definition: Opcodes.h:112
@ CMSG_GET_PVP_OPTIONS_ENABLED
Definition: Opcodes.h:390
@ CMSG_REQUEST_BATTLEFIELD_STATUS
Definition: Opcodes.h:737
@ CMSG_AREA_SPIRIT_HEALER_QUEUE
Definition: Opcodes.h:66
@ CMSG_BATTLEFIELD_LIST
Definition: Opcodes.h:109
@ CMSG_REQUEST_PVP_REWARDS
Definition: Opcodes.h:755
@ CMSG_AREA_SPIRIT_HEALER_QUERY
Definition: Opcodes.h:65
@ CMSG_BATTLEMASTER_JOIN_ARENA
Definition: Opcodes.h:113
@ CMSG_HEARTH_AND_RESURRECT
Definition: Opcodes.h:449
@ CMSG_REQUEST_RATED_PVP_INFO
Definition: Opcodes.h:757
@ CMSG_BATTLEFIELD_PORT
Definition: Opcodes.h:110
@ CMSG_BATTLEFIELD_LEAVE
Definition: Opcodes.h:108
@ CMSG_REPORT_PVP_PLAYER_AFK
Definition: Opcodes.h:732
STL namespace.
std::vector< PVPMatchPlayerStatistics > Statistics
WorldPackets::Duration< Milliseconds, int32 > QueuePenaltyDuration