TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
BattlegroundPackets.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
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 "Common.h"
22 #include "ObjectGuid.h"
23 #include "LFGPackets.h"
24 #include "PacketUtilities.h"
25 #include "Packet.h"
26 
27 namespace WorldPackets
28 {
29  namespace Battleground
30  {
31  class PVPSeason final : public ServerPacket
32  {
33  public:
35 
36  WorldPacket const* Write() override;
37 
40  };
41 
42  class AreaSpiritHealerQuery final : public ClientPacket
43  {
44  public:
46 
47  void Read() override;
48 
50  };
51 
52  class AreaSpiritHealerQueue final : public ClientPacket
53  {
54  public:
56 
57  void Read() override;
58 
60  };
61 
62  class AreaSpiritHealerTime final : public ServerPacket
63  {
64  public:
66 
67  WorldPacket const* Write() override;
68 
71  };
72 
73  class HearthAndResurrect final : public ClientPacket
74  {
75  public:
77 
78  void Read() override { }
79  };
80 
81  class PVPLogDataRequest final : public ClientPacket
82  {
83  public:
85 
86  void Read() override { }
87  };
88 
89  class PVPLogData final : public ServerPacket
90  {
91  public:
93 
94  WorldPacket const* Write() override;
95 
96  struct RatingData
97  {
98  int32 Prematch[2] = { };
99  int32 Postmatch[2] = { };
100  int32 PrematchMMR[2] = { };
101  };
102 
103  struct HonorData
104  {
108  };
109 
110  struct PlayerData
111  {
115  bool IsInWorld = false;
123  std::vector<int32> Stats;
125  uint32 PrimaryTalentTreeNameIndex = 0; // controls which name field from ChrSpecialization.dbc will be sent to lua
127  };
128 
130  std::vector<PlayerData> Players;
132  int8 PlayerCount[2] = { };
133  };
134 
136  {
143  bool RegisteredMatch = false;
144  bool TournamentRules = false;
145  };
146 
147  class BattlefieldStatusNone final : public ServerPacket
148  {
149  public:
151 
152  WorldPacket const* Write() override;
153 
155  };
156 
158  {
159  public:
161 
162  WorldPacket const* Write() override;
163 
167  uint8 Role = 0;
168  };
169 
171  {
172  public:
174 
175  WorldPacket const* Write() override;
176 
180  bool LeftEarly = false;
183  };
184 
186  {
187  public:
189 
190  WorldPacket const* Write() override;
191 
194  bool AsGroup = false;
195  bool SuspendedQueue = false;
198  };
199 
201  {
202  public:
204 
205  WorldPacket const* Write() override;
206 
211  };
212 
213  class BattlemasterJoin final : public ClientPacket
214  {
215  public:
217 
218  void Read() override;
219 
220  bool JoinAsGroup = false;
223  int32 BlacklistMap[2] = { };
224  };
225 
226  class BattlemasterJoinArena final : public ClientPacket
227  {
228  public:
230 
231  void Read() override;
232 
234  };
235 
236  class BattlefieldLeave final : public ClientPacket
237  {
238  public:
240 
241  void Read() override { }
242  };
243 
244  class BattlefieldPort final : public ClientPacket
245  {
246  public:
248 
249  void Read() override;
250 
252  bool AcceptedInvite = false;
253  };
254 
256  {
257  public:
259 
260  void Read() override;
261 
263  };
264 
265  class BattlefieldList final : public ServerPacket
266  {
267  public:
268  BattlefieldList() : ServerPacket(SMSG_BATTLEFIELD_LIST, 1 + 1 + 16 + 1 + 1 + 1 + 4 + 1 + 4) { }
269 
270  WorldPacket const* Write() override;
271 
273  bool PvpAnywhere = false;
275  bool IsRandomBG = false;
277  bool HasHolidayWinToday = false;
279  bool HasRandomWinToday = false;
280  std::vector<int32> Battlefields; // Players cannot join a specific battleground instance anymore - this is always empty
281  };
282 
283  class GetPVPOptionsEnabled final : public ClientPacket
284  {
285  public:
287 
288  void Read() override { }
289  };
290 
291  class PVPOptionsEnabled final : public ServerPacket
292  {
293  public:
295 
296  WorldPacket const* Write() override;
297 
298  bool WargameArenas = false;
299  bool RatedArenas = false;
300  bool WargameBattlegrounds = false;
301  bool ArenaSkirmish = false;
302  bool PugBattlegrounds = false;
303  bool RatedBattlegrounds = false;
304  };
305 
307  {
308  public:
310 
311  void Read() override { }
312  };
313 
314  class ReportPvPPlayerAFK final : public ClientPacket
315  {
316  public:
318 
319  void Read() override;
320 
322  };
323 
325  {
326  public:
328 
329  WorldPacket const* Write() override;
330 
332  {
334  PVP_REPORT_AFK_GENERIC_FAILURE = 1, // there are more error codes but they are impossible to receive without modifying the client
337  };
338 
343  };
344 
346  {
351  };
352 
354  {
355  public:
357 
358  WorldPacket const* Write() override;
359 
360  std::vector<BattlegroundPlayerPosition> FlagCarriers;
361  };
362 
364  {
365  public:
367 
368  WorldPacket const* Write() override;
369 
371  };
372 
374  {
375  public:
377 
378  WorldPacket const* Write() override;
379 
381  };
382 
383  class DestroyArenaUnit final : public ServerPacket
384  {
385  public:
387 
388  WorldPacket const* Write() override;
389 
391  };
392 
393  class RequestPVPRewards final : public ClientPacket
394  {
395  public:
397 
398  void Read() override { }
399  };
400 
402  {
403  public:
405 
406  void Read() override { }
407  };
408  }
409 }
410 
411 #endif // BattlegroundPackets_h__
WorldPacket const * Write() override
Definition: BattlegroundPackets.cpp:20
BattlegroundPlayerLeft()
Definition: BattlegroundPackets.h:376
std::vector< int32 > Stats
Definition: BattlegroundPackets.h:123
Definition: Opcodes.h:783
uint32 Kills
Definition: BattlegroundPackets.h:113
Definition: BattlegroundPackets.h:147
Definition: Opcodes.h:87
BattlefieldStatusNone()
Definition: BattlegroundPackets.h:150
WorldPacket const * Write() override
Definition: BattlegroundPackets.cpp:209
Definition: Vector2.h:40
uint8 TeamSizeIndex
Definition: BattlegroundPackets.h:233
BattlegroundPlayerJoined()
Definition: BattlegroundPackets.h:366
Optional< uint8 > Winner
Definition: BattlegroundPackets.h:129
Definition: Opcodes.h:780
Definition: Opcodes.h:1390
bool AsGroup
Definition: BattlegroundPackets.h:194
int8 IconID
Definition: BattlegroundPackets.h:349
Definition: Opcodes.h:789
bool RatedArenas
Definition: BattlegroundPackets.h:299
uint8 NumPlayersIHaveReported
Definition: BattlegroundPackets.h:340
WorldPacket const * Write() override
Definition: BattlegroundPackets.cpp:165
Definition: BattlegroundPackets.h:200
int8_t int8
Definition: Define.h:148
Definition: Opcodes.h:748
WorldPacket const * Write() override
Definition: BattlegroundPackets.cpp:283
ReportPvPPlayerAFK(WorldPacket &&packet)
Definition: BattlegroundPackets.h:317
ObjectGuid Guid
Definition: BattlegroundPackets.h:347
WorldPacket const * Write() override
Definition: BattlegroundPackets.cpp:277
BattlefieldStatusHeader Hdr
Definition: BattlegroundPackets.h:166
void Read() override
Definition: BattlegroundPackets.h:78
Definition: Opcodes.h:294
WorldPackets::LFG::RideTicket Ticket
Definition: BattlegroundPackets.h:251
Definition: Opcodes.h:59
WorldPacket const * Write() override
Definition: BattlegroundPackets.cpp:177
ObjectGuid HealerGuid
Definition: BattlegroundPackets.h:49
AreaSpiritHealerQuery(WorldPacket &&packet)
Definition: BattlegroundPackets.h:45
WorldPacket const * Write() override
Definition: BattlegroundPackets.cpp:150
ReportPvPPlayerAFKResult()
Definition: BattlegroundPackets.h:327
std::vector< int32 > Battlefields
Definition: BattlegroundPackets.h:280
int8 ArenaSlot
Definition: BattlegroundPackets.h:350
Definition: Opcodes.h:778
uint32 Deaths
Definition: BattlegroundPackets.h:106
Faction
Definition: boss_zum_rah.cpp:50
Definition: BattlegroundPackets.h:306
Definition: BattlegroundPackets.h:244
BattlefieldStatusActive()
Definition: BattlegroundPackets.h:173
Definition: BattlegroundPackets.h:96
Optional< RatingData > Ratings
Definition: BattlegroundPackets.h:131
Definition: Opcodes.h:88
WorldPacket const * Write() override
Definition: BattlegroundPackets.cpp:156
Definition: BattlegroundPackets.h:283
int32 Postmatch[2]
Definition: BattlegroundPackets.h:99
bool WargameBattlegrounds
Definition: BattlegroundPackets.h:300
uint32 Race
Definition: BattlegroundPackets.h:126
BattlefieldList()
Definition: BattlegroundPackets.h:268
Definition: Opcodes.h:1388
STL namespace.
BattlefieldStatusFailed()
Definition: BattlegroundPackets.h:203
Definition: Opcodes.h:1389
uint32 WaitTime
Definition: BattlegroundPackets.h:197
HearthAndResurrect(WorldPacket &&packet)
Definition: BattlegroundPackets.h:76
BattlefieldLeave(WorldPacket &&packet)
Definition: BattlegroundPackets.h:239
BattlemasterJoin(WorldPacket &&packet)
Definition: BattlegroundPackets.h:216
uint8 TeamSize
Definition: BattlegroundPackets.h:141
uint32 DamageDone
Definition: BattlegroundPackets.h:117
bool RatedBattlegrounds
Definition: BattlegroundPackets.h:303
int32 PrematchMMR[2]
Definition: BattlegroundPackets.h:100
Definition: BattlegroundPackets.h:345
BattlemasterJoinArena(WorldPacket &&packet)
Definition: BattlegroundPackets.h:229
void Read() override
Definition: BattlegroundPackets.cpp:123
BattlegroundPlayerPositions()
Definition: BattlegroundPackets.h:356
bool AcceptedInvite
Definition: BattlegroundPackets.h:252
Definition: BattlegroundPackets.h:110
Definition: BattlegroundPackets.h:73
WorldPacket const * Write() override
Definition: BattlegroundPackets.cpp:189
Optional< HonorData > Honor
Definition: BattlegroundPackets.h:116
Definition: Opcodes.h:83
ObjectGuid Guid
Definition: BattlegroundPackets.h:390
bool RegisteredMatch
Definition: BattlegroundPackets.h:143
int32 TimeLeft
Definition: BattlegroundPackets.h:70
uint8 Role
Definition: BattlegroundPackets.h:167
Definition: BattlegroundPackets.h:185
Optional< int32 > MmrChange
Definition: BattlegroundPackets.h:122
Optional< uint32 > PreMatchRating
Definition: BattlegroundPackets.h:119
ObjectGuid BattlemasterGuid
Definition: BattlegroundPackets.h:274
Definition: BattlegroundPackets.h:401
int8 PlayerCount[2]
Definition: BattlegroundPackets.h:132
Definition: BattlegroundPackets.h:89
uint8 Roles
Definition: BattlegroundPackets.h:221
Definition: BattlegroundPackets.h:62
ObjectGuid ClientID
Definition: BattlegroundPackets.h:208
BattlefieldStatusHeader Hdr
Definition: BattlegroundPackets.h:193
uint32 HonorKills
Definition: BattlegroundPackets.h:105
Definition: Packet.h:59
uint32 HealingDone
Definition: BattlegroundPackets.h:118
Definition: BattlegroundPackets.h:103
Definition: Opcodes.h:1446
ObjectGuid Offender
Definition: BattlegroundPackets.h:339
Definition: BattlegroundPackets.h:373
bool ArenaSkirmish
Definition: BattlegroundPackets.h:301
bool HasRandomWinToday
Definition: BattlegroundPackets.h:279
Definition: Opcodes.h:573
RequestBattlefieldStatus(WorldPacket &&packet)
Definition: BattlegroundPackets.h:309
uint8 NumBlackMarksOnOffender
Definition: BattlegroundPackets.h:341
bool PugBattlegrounds
Definition: BattlegroundPackets.h:302
uint64 QueueID
Definition: BattlegroundPackets.h:222
uint32 StartTimer
Definition: BattlegroundPackets.h:181
BattlefieldStatusQueued()
Definition: BattlegroundPackets.h:188
uint8 RangeMin
Definition: BattlegroundPackets.h:139
RequestPVPRewards(WorldPacket &&packet)
Definition: BattlegroundPackets.h:396
void Read() override
Definition: BattlegroundPackets.h:288
Definition: Opcodes.h:348
ObjectGuid Offender
Definition: BattlegroundPackets.h:321
bool PvpAnywhere
Definition: BattlegroundPackets.h:273
Definition: BattlegroundPackets.h:291
WorldPacket const * Write() override
Definition: BattlegroundPackets.cpp:102
Definition: Opcodes.h:558
uint32 ShutdownTimer
Definition: BattlegroundPackets.h:178
Definition: Packet.h:46
BattlefieldStatusHeader Hdr
Definition: BattlegroundPackets.h:177
int32 Prematch[2]
Definition: BattlegroundPackets.h:98
void Read() override
Definition: BattlegroundPackets.cpp:131
Definition: BattlegroundPackets.h:324
Definition: BattlegroundPackets.h:236
Optional< uint32 > PreMatchMMR
Definition: BattlegroundPackets.h:121
uint64 QueueID
Definition: BattlegroundPackets.h:207
Definition: BattlegroundPackets.h:81
Definition: BattlegroundPackets.h:314
RequestRatedBattlefieldInfo(WorldPacket &&packet)
Definition: BattlegroundPackets.h:404
Definition: BattlegroundPackets.h:31
void Read() override
Definition: BattlegroundPackets.cpp:198
WorldPacket const * Write() override
Definition: BattlegroundPackets.cpp:244
DestroyArenaUnit()
Definition: BattlegroundPackets.h:386
uint8 Result
Definition: BattlegroundPackets.h:342
int32_t int32
Definition: Define.h:146
G3D::Vector2 Pos
Definition: BattlegroundPackets.h:348
Definition: Opcodes.h:790
void Read() override
Definition: BattlegroundPackets.h:241
Definition: BattlegroundPackets.h:226
uint32_t uint32
Definition: Define.h:150
bool JoinAsGroup
Definition: BattlegroundPackets.h:220
uint64_t uint64
Definition: Define.h:149
void Read() override
Definition: BattlegroundPackets.cpp:33
std::vector< BattlegroundPlayerPosition > FlagCarriers
Definition: BattlegroundPackets.h:360
uint32 CurrentSeason
Definition: BattlegroundPackets.h:39
ObjectGuid HealerGuid
Definition: BattlegroundPackets.h:59
void Read() override
Definition: BattlegroundPackets.h:86
uint32 AverageWaitTime
Definition: BattlegroundPackets.h:192
boost::optional< T > Optional
Optional helper class to wrap optional values within.
Definition: Common.h:170
ResultCode
Definition: BattlegroundPackets.h:331
WorldPacket const * Write() override
Definition: BattlegroundPackets.cpp:271
GetPVPOptionsEnabled(WorldPacket &&packet)
Definition: BattlegroundPackets.h:286
uint8 RangeMax
Definition: BattlegroundPackets.h:140
bool WargameArenas
Definition: BattlegroundPackets.h:298
PVPOptionsEnabled()
Definition: BattlegroundPackets.h:294
uint32 PrimaryTalentTreeNameIndex
Definition: BattlegroundPackets.h:125
uint64 QueueID
Definition: BattlegroundPackets.h:138
Definition: BattlegroundMgr.h:57
Optional< int32 > RatingChange
Definition: BattlegroundPackets.h:120
void Read() override
Definition: BattlegroundPackets.h:311
WorldPackets::LFG::RideTicket Ticket
Definition: BattlegroundPackets.h:154
ObjectGuid PlayerGUID
Definition: BattlegroundPackets.h:112
Definition: BattlegroundPackets.h:255
void Read() override
Definition: BattlegroundPackets.cpp:204
Definition: Opcodes.h:788
Definition: Opcodes.h:85
ObjectGuid Guid
Definition: BattlegroundPackets.h:370
void Read() override
Definition: BattlegroundPackets.h:398
uint8 MinLevel
Definition: BattlegroundPackets.h:276
WorldPacket const * Write() override
Definition: BattlegroundPackets.cpp:262
BattlefieldListRequest(WorldPacket &&packet)
Definition: BattlegroundPackets.h:258
uint32 Mapid
Definition: BattlegroundPackets.h:165
bool SuspendedQueue
Definition: BattlegroundPackets.h:195
int32 ListID
Definition: BattlegroundPackets.h:262
bool LeftEarly
Definition: BattlegroundPackets.h:180
ObjectGuid HealerGuid
Definition: BattlegroundPackets.h:69
uint32 Mapid
Definition: BattlegroundPackets.h:182
Definition: Opcodes.h:948
AreaSpiritHealerQueue(WorldPacket &&packet)
Definition: BattlegroundPackets.h:55
Definition: Opcodes.h:60
Definition: BattlegroundPackets.h:170
BattlefieldStatusNeedConfirmation()
Definition: BattlegroundPackets.h:160
Definition: Opcodes.h:781
Definition: BattlegroundPackets.h:363
Definition: LFGPackets.h:27
bool EligibleForMatchmaking
Definition: BattlegroundPackets.h:196
Definition: BattlegroundPackets.h:135
int32 BattlemasterListID
Definition: BattlegroundPackets.h:278
uint8_t uint8
Definition: Define.h:152
Definition: Opcodes.h:512
Definition: Opcodes.h:575
Definition: BattlegroundPackets.h:383
BattlefieldPort(WorldPacket &&packet)
Definition: BattlegroundPackets.h:247
Definition: BattlegroundPackets.h:393
Definition: Battleground.h:235
bool HasHolidayWinToday
Definition: BattlegroundPackets.h:277
uint32 ContributionPoints
Definition: BattlegroundPackets.h:107
PVPLogDataRequest(WorldPacket &&packet)
Definition: BattlegroundPackets.h:84
uint32 PreviousSeason
Definition: BattlegroundPackets.h:38
WorldPackets::LFG::RideTicket Ticket
Definition: BattlegroundPackets.h:210
WorldPacket const * Write() override
Definition: BattlegroundPackets.cpp:227
void Read() override
Definition: BattlegroundPackets.h:406
Definition: ObjectGuid.h:189
ObjectGuid Guid
Definition: BattlegroundPackets.h:380
WorldPacket const * Write() override
Definition: BattlegroundPackets.cpp:38
PVPSeason()
Definition: BattlegroundPackets.h:34
Definition: Opcodes.h:560
int32 BlacklistMap[2]
Definition: BattlegroundPackets.h:223
Definition: Opcodes.h:84
uint32 Timeout
Definition: BattlegroundPackets.h:164
Definition: BattlegroundPackets.h:353
WorldPackets::LFG::RideTicket Ticket
Definition: BattlegroundPackets.h:137
Definition: BattlegroundPackets.h:265
Definition: Opcodes.h:784
Definition: WorldPacket.h:26
std::vector< PlayerData > Players
Definition: BattlegroundPackets.h:130
int32 Reason
Definition: BattlegroundPackets.h:209
Definition: BattlegroundPackets.h:52
uint8 MaxLevel
Definition: BattlegroundPackets.h:272
uint8 ArenaFaction
Definition: BattlegroundPackets.h:179
bool TournamentRules
Definition: BattlegroundPackets.h:144
void Read() override
Definition: BattlegroundPackets.cpp:28
bool IsInWorld
Definition: BattlegroundPackets.h:115
void Read() override
Definition: BattlegroundPackets.cpp:239
int32 PrimaryTalentTree
Definition: BattlegroundPackets.h:124
AreaSpiritHealerTime()
Definition: BattlegroundPackets.h:65
bool IsRandomBG
Definition: BattlegroundPackets.h:275
Definition: BattlegroundPackets.h:42
uint32 InstanceID
Definition: BattlegroundPackets.h:142
Definition: BattlegroundPackets.h:213
PVPLogData()
Definition: BattlegroundPackets.h:92