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
47 };
48
50 {
51 public:
53
54 void Read() override;
55
57 };
58
60 {
61 public:
63
64 void Read() override;
65
67 };
68
70 {
71 public:
73
74 WorldPacket const* Write() override;
75
78 };
79
80 class HearthAndResurrect final : public ClientPacket
81 {
82 public:
84
85 void Read() override { }
86 };
87
88 class PVPLogDataRequest final : public ClientPacket
89 {
90 public:
92
93 void Read() override { }
94 };
95
97 {
99 {
100 RatingData() { } // work around clang bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101227
101
102 int32 Prematch[2] = { };
103 int32 Postmatch[2] = { };
105 };
106
108 {
109 HonorData() { } // work around clang bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101227
110
114 };
115
117 {
119 PVPMatchPlayerPVPStat(int32 pvpStatID, int32 pvpStatValue) : PvpStatID(pvpStatID), PvpStatValue(pvpStatValue) { }
120
123 };
124
126 {
130 bool IsInWorld = false;
139 std::vector<PVPMatchPlayerPVPStat> Stats;
147 };
148
149 std::vector<PVPMatchPlayerStatistics> Statistics;
151 std::array<int8, 2> PlayerCount = { };
152 };
153
155 {
156 public:
158
159 WorldPacket const* Write() override;
160
162 };
163
165 {
167 std::vector<uint64> QueueID;
172 bool RegisteredMatch = false;
173 bool TournamentRules = false;
174 };
175
177 {
178 public:
180
181 WorldPacket const* Write() override;
182
184 };
185
187 {
188 public:
190
191 WorldPacket const* Write() override;
192
197 };
198
200 {
201 public:
203
204 WorldPacket const* Write() override;
205
209 bool LeftEarly = false;
212 };
213
215 {
216 public:
218
219 WorldPacket const* Write() override;
220
223 bool AsGroup = false;
224 bool SuspendedQueue = false;
228 };
229
231 {
232 public:
234
235 WorldPacket const* Write() override;
236
241 };
242
243 class BattlemasterJoin final : public ClientPacket
244 {
245 public:
247
248 void Read() override;
249
253 };
254
256 {
257 public:
259
260 void Read() override;
261
264 };
265
266 class BattlefieldLeave final : public ClientPacket
267 {
268 public:
270
271 void Read() override { }
272 };
273
274 class BattlefieldPort final : public ClientPacket
275 {
276 public:
278
279 void Read() override;
280
282 bool AcceptedInvite = false;
283 };
284
286 {
287 public:
289
290 void Read() override;
291
293 };
294
295 class BattlefieldList final : public ServerPacket
296 {
297 public:
298 BattlefieldList() : ServerPacket(SMSG_BATTLEFIELD_LIST, 1 + 1 + 16 + 1 + 1 + 1 + 4 + 1 + 4) { }
299
300 WorldPacket const* Write() override;
301
306 std::vector<int32> Battlefields; // Players cannot join a specific battleground instance anymore - this is always empty
307 bool PvpAnywhere = false;
308 bool HasRandomWinToday = false;
309 };
310
312 {
313 public:
315
316 void Read() override { }
317 };
318
319 class PVPOptionsEnabled final : public ServerPacket
320 {
321 public:
323
324 WorldPacket const* Write() override;
325
326 bool RatedBattlegrounds = false;
327 bool PugBattlegrounds = false;
329 bool WargameArenas = false;
330 bool RatedArenas = false;
331 bool ArenaSkirmish = false;
332 bool SoloShuffle = false;
333 bool RatedSoloShuffle = false;
334 bool BattlegroundBlitz = false;
335 bool RatedBattlegroundBlitz = false; // solo rbg
336 };
337
339 {
340 public:
342
343 void Read() override { }
344 };
345
346 class ReportPvPPlayerAFK final : public ClientPacket
347 {
348 public:
350
351 void Read() override;
352
354 };
355
357 {
358 public:
360
361 WorldPacket const* Write() override;
362
364 {
366 PVP_REPORT_AFK_GENERIC_FAILURE = 1, // there are more error codes but they are impossible to receive without modifying the client
369 };
370
375 };
376
378 {
383 };
384
386 {
387 public:
389
390 WorldPacket const* Write() override;
391
392 std::vector<BattlegroundPlayerPosition> FlagCarriers;
393 };
394
396 {
397 public:
399
400 WorldPacket const* Write() override;
401
403 };
404
406 {
407 public:
409
410 WorldPacket const* Write() override;
411
413 };
414
415 class DestroyArenaUnit final : public ServerPacket
416 {
417 public:
419
420 WorldPacket const* Write() override;
421
423 };
424
425 class RequestPVPRewards final : public ClientPacket
426 {
427 public:
429
430 void Read() override { }
431 };
432
434 {
435 public:
437
438 void Read() override { }
439 };
440
441 class RatedPvpInfo final : public ServerPacket
442 {
443 public:
445
446 WorldPacket const* Write() override;
447
449 {
469 bool Disqualified = false;
471 };
472
474 {
478 };
479
480 enum class PVPMatchState : uint8
481 {
482 Waiting = 0,
483 StartUp = 1,
484 Engaged = 2,
485 PostRound = 3,
486 Inactive = 4,
487 Complete = 5
488 };
489
490 class PVPMatchInitialize final : public ServerPacket
491 {
492 public:
494
495 WorldPacket const* Write() override;
496
504 bool Registered = false;
505 bool AffectsRating = false;
506 };
507
508 class PVPMatchSetState final : public ServerPacket
509 {
510 public:
512
513 WorldPacket const* Write() override;
514
516 };
517
518 class PVPMatchComplete final : public ServerPacket
519 {
520 public:
522
523 WorldPacket const* Write() override;
524
529 };
530
532 {
533 Neutral = 1,
534 ContestedHorde = 2,
536 HordeCaptured = 4,
538 };
539
541 {
547 };
548
549 class UpdateCapturePoint final : public ServerPacket
550 {
551 public:
553
554 WorldPacket const* Write() override;
555
557 };
558
560 {
561 public:
564
565 WorldPacket const* Write() override;
566
568 };
569 }
570}
571
572#endif // BattlegroundPackets_h__
uint8_t uint8
Definition: Define.h:144
int8_t int8
Definition: Define.h:140
int32_t int32
Definition: Define.h:138
uint64_t uint64
Definition: Define.h:141
uint32_t uint32
Definition: Define.h:142
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
@ CMSG_PVP_LOG_DATA
Definition: Opcodes.h:636
@ CMSG_BATTLEMASTER_JOIN
Definition: Opcodes.h:113
@ CMSG_GET_PVP_OPTIONS_ENABLED
Definition: Opcodes.h:379
@ CMSG_REQUEST_BATTLEFIELD_STATUS
Definition: Opcodes.h:708
@ CMSG_AREA_SPIRIT_HEALER_QUEUE
Definition: Opcodes.h:67
@ CMSG_BATTLEFIELD_LIST
Definition: Opcodes.h:110
@ CMSG_REQUEST_PVP_REWARDS
Definition: Opcodes.h:726
@ CMSG_AREA_SPIRIT_HEALER_QUERY
Definition: Opcodes.h:66
@ CMSG_BATTLEMASTER_JOIN_ARENA
Definition: Opcodes.h:114
@ CMSG_HEARTH_AND_RESURRECT
Definition: Opcodes.h:434
@ CMSG_REQUEST_RATED_PVP_INFO
Definition: Opcodes.h:728
@ CMSG_BATTLEFIELD_PORT
Definition: Opcodes.h:111
@ CMSG_BATTLEFIELD_LEAVE
Definition: Opcodes.h:109
@ CMSG_REPORT_PVP_PLAYER_AFK
Definition: Opcodes.h:703
@ SMSG_BATTLEFIELD_STATUS_NEED_CONFIRMATION
Definition: Opcodes.h:991
@ SMSG_BATTLEFIELD_LIST
Definition: Opcodes.h:986
@ SMSG_UPDATE_CAPTURE_POINT
Definition: Opcodes.h:2026
@ SMSG_BATTLEFIELD_STATUS_ACTIVE
Definition: Opcodes.h:988
@ SMSG_AREA_SPIRIT_HEALER_TIME
Definition: Opcodes.h:938
@ SMSG_REPORT_PVP_PLAYER_AFK_RESULT
Definition: Opcodes.h:1844
@ SMSG_BATTLEGROUND_PLAYER_POSITIONS
Definition: Opcodes.h:999
@ SMSG_PVP_MATCH_SET_STATE
Definition: Opcodes.h:1769
@ SMSG_PVP_MATCH_COMPLETE
Definition: Opcodes.h:1767
@ SMSG_SEASON_INFO
Definition: Opcodes.h:1889
@ SMSG_DESTROY_ARENA_UNIT
Definition: Opcodes.h:1199
@ SMSG_BATTLEFIELD_STATUS_NONE
Definition: Opcodes.h:992
@ SMSG_BATTLEFIELD_STATUS_QUEUED
Definition: Opcodes.h:993
@ SMSG_BATTLEGROUND_PLAYER_LEFT
Definition: Opcodes.h:998
@ SMSG_PVP_MATCH_INITIALIZE
Definition: Opcodes.h:1768
@ SMSG_PVP_OPTIONS_ENABLED
Definition: Opcodes.h:1772
@ SMSG_PVP_MATCH_STATISTICS
Definition: Opcodes.h:1771
@ SMSG_BATTLEFIELD_STATUS_FAILED
Definition: Opcodes.h:989
@ SMSG_BATTLEGROUND_PLAYER_JOINED
Definition: Opcodes.h:997
@ SMSG_RATED_PVP_INFO
Definition: Opcodes.h:1827
@ SMSG_CAPTURE_POINT_REMOVED
Definition: Opcodes.h:1081
STL namespace.
std::vector< PVPMatchPlayerStatistics > Statistics
WorldPackets::Duration< Milliseconds, int32 > QueuePenaltyDuration