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;
215 };
216
218 {
219 public:
221
222 WorldPacket const* Write() override;
223
226 bool AsGroup = false;
227 bool SuspendedQueue = false;
231 };
232
234 {
235 public:
237
238 WorldPacket const* Write() override;
239
244 };
245
246 class BattlemasterJoin final : public ClientPacket
247 {
248 public:
250
251 void Read() override;
252
256 };
257
259 {
260 public:
262
263 void Read() override;
264
267 };
268
269 class BattlefieldLeave final : public ClientPacket
270 {
271 public:
273
274 void Read() override { }
275 };
276
277 class BattlefieldPort final : public ClientPacket
278 {
279 public:
281
282 void Read() override;
283
285 bool AcceptedInvite = false;
286 };
287
289 {
290 public:
292
293 void Read() override;
294
296 };
297
298 class BattlefieldList final : public ServerPacket
299 {
300 public:
301 BattlefieldList() : ServerPacket(SMSG_BATTLEFIELD_LIST, 1 + 1 + 16 + 1 + 1 + 1 + 4 + 1 + 4) { }
302
303 WorldPacket const* Write() override;
304
309 std::vector<int32> Battlefields; // Players cannot join a specific battleground instance anymore - this is always empty
310 bool PvpAnywhere = false;
311 bool HasRandomWinToday = false;
312 };
313
315 {
316 public:
318
319 void Read() override { }
320 };
321
322 class PVPOptionsEnabled final : public ServerPacket
323 {
324 public:
326
327 WorldPacket const* Write() override;
328
329 bool RatedBattlegrounds = false;
330 bool PugBattlegrounds = false;
332 bool WargameArenas = false;
333 bool RatedArenas = false;
334 bool ArenaSkirmish = false;
335 bool SoloShuffle = false;
336 bool RatedSoloShuffle = false;
337 bool BattlegroundBlitz = false;
338 bool RatedBattlegroundBlitz = false; // solo rbg
339 };
340
342 {
343 public:
345
346 void Read() override { }
347 };
348
349 class ReportPvPPlayerAFK final : public ClientPacket
350 {
351 public:
353
354 void Read() override;
355
357 };
358
360 {
361 public:
363
364 WorldPacket const* Write() override;
365
367 {
369 PVP_REPORT_AFK_GENERIC_FAILURE = 1, // there are more error codes but they are impossible to receive without modifying the client
372 };
373
378 };
379
381 {
386 };
387
389 {
390 public:
392
393 WorldPacket const* Write() override;
394
395 std::vector<BattlegroundPlayerPosition> FlagCarriers;
396 };
397
399 {
400 public:
402
403 WorldPacket const* Write() override;
404
406 };
407
409 {
410 public:
412
413 WorldPacket const* Write() override;
414
416 };
417
418 class DestroyArenaUnit final : public ServerPacket
419 {
420 public:
422
423 WorldPacket const* Write() override;
424
426 };
427
428 class RequestPVPRewards final : public ClientPacket
429 {
430 public:
432
433 void Read() override { }
434 };
435
437 {
438 public:
440
441 void Read() override { }
442 };
443
444 class RatedPvpInfo final : public ServerPacket
445 {
446 public:
448
449 WorldPacket const* Write() override;
450
452 {
472 bool Disqualified = false;
474 };
475
477 {
481 };
482
483 enum class PVPMatchState : uint8
484 {
485 Waiting = 0,
486 StartUp = 1,
487 Engaged = 2,
488 PostRound = 3,
489 Inactive = 4,
490 Complete = 5
491 };
492
493 class PVPMatchInitialize final : public ServerPacket
494 {
495 public:
497
498 WorldPacket const* Write() override;
499
507 bool Registered = false;
508 bool AffectsRating = false;
509 };
510
511 class PVPMatchSetState final : public ServerPacket
512 {
513 public:
515
516 WorldPacket const* Write() override;
517
519 };
520
521 class PVPMatchComplete final : public ServerPacket
522 {
523 public:
525
526 WorldPacket const* Write() override;
527
532 };
533
535 {
536 Neutral = 1,
537 ContestedHorde = 2,
539 HordeCaptured = 4,
541 };
542
544 {
550 };
551
552 class UpdateCapturePoint final : public ServerPacket
553 {
554 public:
556
557 WorldPacket const* Write() override;
558
560 };
561
563 {
564 public:
567
568 WorldPacket const* Write() override;
569
571 };
572 }
573}
574
575#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
@ SMSG_BATTLEFIELD_STATUS_NEED_CONFIRMATION
Definition: Opcodes.h:1048
@ SMSG_BATTLEFIELD_LIST
Definition: Opcodes.h:1043
@ SMSG_UPDATE_CAPTURE_POINT
Definition: Opcodes.h:2107
@ SMSG_BATTLEFIELD_STATUS_ACTIVE
Definition: Opcodes.h:1045
@ SMSG_AREA_SPIRIT_HEALER_TIME
Definition: Opcodes.h:995
@ SMSG_REPORT_PVP_PLAYER_AFK_RESULT
Definition: Opcodes.h:1920
@ SMSG_BATTLEGROUND_PLAYER_POSITIONS
Definition: Opcodes.h:1056
@ SMSG_PVP_MATCH_SET_STATE
Definition: Opcodes.h:1844
@ SMSG_PVP_MATCH_COMPLETE
Definition: Opcodes.h:1842
@ SMSG_SEASON_INFO
Definition: Opcodes.h:1965
@ SMSG_DESTROY_ARENA_UNIT
Definition: Opcodes.h:1262
@ SMSG_BATTLEFIELD_STATUS_NONE
Definition: Opcodes.h:1049
@ SMSG_BATTLEFIELD_STATUS_QUEUED
Definition: Opcodes.h:1050
@ SMSG_BATTLEGROUND_PLAYER_LEFT
Definition: Opcodes.h:1055
@ SMSG_PVP_MATCH_INITIALIZE
Definition: Opcodes.h:1843
@ SMSG_PVP_OPTIONS_ENABLED
Definition: Opcodes.h:1847
@ SMSG_PVP_MATCH_STATISTICS
Definition: Opcodes.h:1846
@ SMSG_BATTLEFIELD_STATUS_FAILED
Definition: Opcodes.h:1046
@ SMSG_BATTLEGROUND_PLAYER_JOINED
Definition: Opcodes.h:1054
@ SMSG_RATED_PVP_INFO
Definition: Opcodes.h:1902
@ SMSG_CAPTURE_POINT_REMOVED
Definition: Opcodes.h:1138
@ CMSG_PVP_LOG_DATA
Definition: Opcodes.h:656
@ CMSG_BATTLEMASTER_JOIN
Definition: Opcodes.h:112
@ CMSG_GET_PVP_OPTIONS_ENABLED
Definition: Opcodes.h:385
@ CMSG_REQUEST_BATTLEFIELD_STATUS
Definition: Opcodes.h:728
@ CMSG_AREA_SPIRIT_HEALER_QUEUE
Definition: Opcodes.h:66
@ CMSG_BATTLEFIELD_LIST
Definition: Opcodes.h:109
@ CMSG_REQUEST_PVP_REWARDS
Definition: Opcodes.h:746
@ CMSG_AREA_SPIRIT_HEALER_QUERY
Definition: Opcodes.h:65
@ CMSG_BATTLEMASTER_JOIN_ARENA
Definition: Opcodes.h:113
@ CMSG_HEARTH_AND_RESURRECT
Definition: Opcodes.h:440
@ CMSG_REQUEST_RATED_PVP_INFO
Definition: Opcodes.h:748
@ CMSG_BATTLEFIELD_PORT
Definition: Opcodes.h:110
@ CMSG_BATTLEFIELD_LEAVE
Definition: Opcodes.h:108
@ CMSG_REPORT_PVP_PLAYER_AFK
Definition: Opcodes.h:723
STL namespace.
std::vector< PVPMatchPlayerStatistics > Statistics
WorldPackets::Duration< Milliseconds, int32 > QueuePenaltyDuration