TrinityCore
LFGPackets.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 LFGPackets_h__
19#define LFGPackets_h__
20
21#include "Packet.h"
22#include "PacketUtilities.h"
23#include "ItemPacketsCommon.h"
24#include "LFGPacketsCommon.h"
25#include "Optional.h"
26
27namespace lfg
28{
30}
31
32namespace WorldPackets
33{
34 namespace LFG
35 {
36 class DFJoin final : public ClientPacket
37 {
38 public:
39 DFJoin(WorldPacket&& packet) : ClientPacket(CMSG_DF_JOIN, std::move(packet)) { }
40
41 void Read() override;
42
43 bool QueueAsGroup = false;
44 bool Unknown = false; // Always false in 7.2.5
48 };
49
50 class DFLeave final : public ClientPacket
51 {
52 public:
53 DFLeave(WorldPacket&& packet) : ClientPacket(CMSG_DF_LEAVE, std::move(packet)) { }
54
55 void Read() override;
56
58 };
59
60 class DFProposalResponse final : public ClientPacket
61 {
62 public:
64
65 void Read() override;
66
70 bool Accepted = false;
71 };
72
73 class DFSetRoles final : public ClientPacket
74 {
75 public:
77
78 void Read() override;
79
82 };
83
84 class DFBootPlayerVote final : public ClientPacket
85 {
86 public:
88
89 void Read() override;
90
91 bool Vote = false;
92 };
93
94 class DFTeleport final : public ClientPacket
95 {
96 public:
97 DFTeleport(WorldPacket&& packet) : ClientPacket(CMSG_DF_TELEPORT, std::move(packet)) { }
98
99 void Read() override;
100
101 bool TeleportOut = false;
102 };
103
104 class DFGetSystemInfo final : public ClientPacket
105 {
106 public:
108
109 void Read() override;
110
112 bool Player = false;
113 };
114
115 class DFGetJoinStatus final : public ClientPacket
116 {
117 public:
119
120 void Read() override { }
121 };
122
124 {
125 LFGBlackListSlot() = default;
126 LFGBlackListSlot(uint32 slot, uint32 reason, int32 subReason1, int32 subReason2, uint32 softLock)
127 : Slot(slot), Reason(reason), SubReason1(subReason1), SubReason2(subReason2), SoftLock(softLock) { }
128
134 };
135
137 {
139 std::vector<LFGBlackListSlot> Slot;
140 };
141
143 {
145 LfgPlayerQuestRewardItem(int32 itemId, int32 quantity) : ItemID(itemId), Quantity(quantity) { }
146
149 };
150
152 {
154 LfgPlayerQuestRewardCurrency(int32 currencyID, int32 quantity) : CurrencyID(currencyID), Quantity(quantity) { }
155
158 };
159
161 {
162 uint8 Mask = 0; // Roles required for this reward, only used by ShortageReward in SMSG_LFG_PLAYER_INFO
163 int32 RewardMoney = 0; // Only used by SMSG_LFG_PLAYER_INFO
165 std::vector<LfgPlayerQuestRewardItem> Item;
166 std::vector<LfgPlayerQuestRewardCurrency> Currency; // Only used by SMSG_LFG_PLAYER_INFO
167 std::vector<LfgPlayerQuestRewardCurrency> BonusCurrency; // Only used by SMSG_LFG_PLAYER_INFO
168 Optional<int32> RewardSpellID; // Only used by SMSG_LFG_PLAYER_INFO
171 Optional<int32> Honor; // Only used by SMSG_REQUEST_PVP_REWARDS_RESPONSE
172 };
173
175 {
191 bool FirstReward = false;
192 bool ShortageEligible = false;
194 std::vector<LfgPlayerQuestReward> ShortageReward;
195 };
196
197 class LfgPlayerInfo final : public ServerPacket
198 {
199 public:
201
202 WorldPacket const* Write() override;
203
205 std::vector<LfgPlayerDungeonInfo> Dungeon;
206 };
207
208 class LfgPartyInfo final : public ServerPacket
209 {
210 public:
212
213 WorldPacket const* Write() override;
214
215 std::vector<LFGBlackList> Player;
216 };
217
218 class LFGUpdateStatus final : public ServerPacket
219 {
220 public:
222
223 WorldPacket const* Write() override;
224
228 std::vector<uint32> Slots;
230 std::vector<ObjectGuid> SuspendedPlayers;
232 bool NotifyUI = false;
233 bool IsParty = false;
234 bool Joined = false;
235 bool LfgJoined = false;
236 bool Queued = false;
237 bool Unused = false;
238 };
239
240 class RoleChosen final : public ServerPacket
241 {
242 public:
244
245 WorldPacket const* Write() override;
246
249 bool Accepted = false;
250 };
251
253 {
255 LFGRoleCheckUpdateMember(ObjectGuid guid, uint8 rolesDesired, uint8 level, bool roleCheckComplete)
256 : Guid(guid), RolesDesired(rolesDesired), Level(level), RoleCheckComplete(roleCheckComplete) { }
257
261 bool RoleCheckComplete = false;
262 };
263
264 class LFGRoleCheckUpdate final : public ServerPacket
265 {
266 public:
268
269 WorldPacket const* Write() override;
270
273 std::vector<uint32> JoinSlots;
274 std::vector<uint64> BgQueueIDs;
276 std::vector<LFGRoleCheckUpdateMember> Members;
277 bool IsBeginning = false;
278 bool IsRequeue = false;
279 };
280
281 class LFGJoinResult final : public ServerPacket
282 {
283 public:
285
286 WorldPacket const* Write() override;
287
291 std::vector<LFGBlackList> BlackList;
292 std::vector<std::string const*> BlackListNames;
293 };
294
295 class LFGQueueStatus final : public ServerPacket
296 {
297 public:
298 LFGQueueStatus() : ServerPacket(SMSG_LFG_QUEUE_STATUS, 16 + 4 + 4 + 4 + 4 + 4 + 4 + 4 * 3 + 3 + 4) { }
299
300 WorldPacket const* Write() override;
301
309 };
310
312 {
313 LFGPlayerRewards() = default;
314 LFGPlayerRewards(int32 id, uint32 quantity, int32 bonusQuantity, bool isCurrency)
315 : Quantity(quantity), BonusQuantity(bonusQuantity)
316 {
317 if (!isCurrency)
318 {
319 RewardItem.emplace();
320 RewardItem->ItemID = id;
321 }
322 else
323 {
324 RewardCurrency = id;
325 }
326 }
327
332 };
333
334 class LFGPlayerReward final : public ServerPacket
335 {
336 public:
338
339 WorldPacket const* Write() override;
340
345 std::vector<LFGPlayerRewards> Rewards;
346 };
347
349 {
350 bool VoteInProgress = false;
351 bool VotePassed = false;
352 bool MyVoteCompleted = false;
353 bool MyVote = false;
359 std::string Reason;
360 };
361
362 class LfgBootPlayer final : public ServerPacket
363 {
364 public:
366
367 WorldPacket const* Write() override;
368
370 };
371
373 {
375 bool Me = false;
376 bool SameParty = false;
377 bool MyParty = false;
378 bool Responded = false;
379 bool Accepted = false;
380 };
381
382 class LFGProposalUpdate final : public ServerPacket
383 {
384 public:
386
387 WorldPacket const* Write() override;
388
397 bool ValidCompletedMask = false;
398 bool ProposalSilent = false;
399 bool IsRequeue = false;
400 std::vector<LFGProposalUpdatePlayer> Players;
401 };
402
403 class LFGDisabled final : public ServerPacket
404 {
405 public:
407
408 WorldPacket const* Write() override { return &_worldPacket; }
409 };
410
411 class LFGOfferContinue final : public ServerPacket
412 {
413 public:
415
416 WorldPacket const* Write() override;
417
419 };
420
421 class LFGTeleportDenied final : public ServerPacket
422 {
423 public:
425
426 WorldPacket const* Write() override;
427
429 };
430 }
431}
432
433#endif // LFGPackets_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
DFBootPlayerVote(WorldPacket &&packet)
Definition: LFGPackets.h:87
DFGetJoinStatus(WorldPacket &&packet)
Definition: LFGPackets.h:118
DFGetSystemInfo(WorldPacket &&packet)
Definition: LFGPackets.h:107
DFJoin(WorldPacket &&packet)
Definition: LFGPackets.h:39
void Read() override
Definition: LFGPackets.cpp:20
Array< uint32, 50 > Slots
Definition: LFGPackets.h:47
Optional< uint8 > PartyIndex
Definition: LFGPackets.h:45
DFLeave(WorldPacket &&packet)
Definition: LFGPackets.h:53
DFProposalResponse(WorldPacket &&packet)
Definition: LFGPackets.h:63
DFSetRoles(WorldPacket &&packet)
Definition: LFGPackets.h:76
Optional< uint8 > PartyIndex
Definition: LFGPackets.h:81
DFTeleport(WorldPacket &&packet)
Definition: LFGPackets.h:97
WorldPacket const * Write() override
Definition: LFGPackets.h:408
std::vector< std::string const * > BlackListNames
Definition: LFGPackets.h:292
WorldPacket const * Write() override
Definition: LFGPackets.cpp:271
std::vector< LFGBlackList > BlackList
Definition: LFGPackets.h:291
WorldPacket const * Write() override
Definition: LFGPackets.cpp:397
std::vector< LFGPlayerRewards > Rewards
Definition: LFGPackets.h:345
WorldPacket const * Write() override
Definition: LFGPackets.cpp:324
std::vector< LFGProposalUpdatePlayer > Players
Definition: LFGPackets.h:400
WorldPacket const * Write() override
Definition: LFGPackets.cpp:375
WorldPacket const * Write() override
Definition: LFGPackets.cpp:292
std::vector< LFGRoleCheckUpdateMember > Members
Definition: LFGPackets.h:276
WorldPacket const * Write() override
Definition: LFGPackets.cpp:246
std::vector< uint32 > JoinSlots
Definition: LFGPackets.h:273
std::vector< uint64 > BgQueueIDs
Definition: LFGPackets.h:274
WorldPacket const * Write() override
Definition: LFGPackets.cpp:404
LFGTeleportDenied(lfg::LfgTeleportResult reason)
Definition: LFGPackets.h:424
lfg::LfgTeleportResult Reason
Definition: LFGPackets.h:428
WorldPacket const * Write() override
Definition: LFGPackets.cpp:198
std::vector< ObjectGuid > SuspendedPlayers
Definition: LFGPackets.h:230
std::vector< uint32 > Slots
Definition: LFGPackets.h:228
WorldPacket const * Write() override
Definition: LFGPackets.cpp:355
WorldPacket const * Write() override
Definition: LFGPackets.cpp:189
std::vector< LFGBlackList > Player
Definition: LFGPackets.h:215
std::vector< LfgPlayerDungeonInfo > Dungeon
Definition: LFGPackets.h:205
WorldPacket const * Write() override
Definition: LFGPackets.cpp:179
WorldPacket const * Write() override
Definition: LFGPackets.cpp:225
WorldPacket _worldPacket
Definition: Packet.h:43
@ CMSG_DF_LEAVE
Definition: Opcodes.h:321
@ CMSG_DF_GET_SYSTEM_INFO
Definition: Opcodes.h:319
@ CMSG_DF_BOOT_PLAYER_VOTE
Definition: Opcodes.h:316
@ CMSG_DF_TELEPORT
Definition: Opcodes.h:325
@ CMSG_DF_JOIN
Definition: Opcodes.h:320
@ CMSG_DF_SET_ROLES
Definition: Opcodes.h:324
@ CMSG_DF_GET_JOIN_STATUS
Definition: Opcodes.h:318
@ CMSG_DF_PROPOSAL_RESPONSE
Definition: Opcodes.h:322
@ SMSG_LFG_TELEPORT_DENIED
Definition: Opcodes.h:1500
@ SMSG_LFG_PARTY_INFO
Definition: Opcodes.h:1491
@ SMSG_LFG_ROLE_CHECK_UPDATE
Definition: Opcodes.h:1498
@ SMSG_LFG_UPDATE_STATUS
Definition: Opcodes.h:1501
@ SMSG_ROLE_CHOSEN
Definition: Opcodes.h:1870
@ SMSG_LFG_DISABLED
Definition: Opcodes.h:1476
@ SMSG_LFG_PLAYER_INFO
Definition: Opcodes.h:1492
@ SMSG_LFG_QUEUE_STATUS
Definition: Opcodes.h:1495
@ SMSG_LFG_PROPOSAL_UPDATE
Definition: Opcodes.h:1494
@ SMSG_LFG_JOIN_RESULT
Definition: Opcodes.h:1479
@ SMSG_LFG_PLAYER_REWARD
Definition: Opcodes.h:1493
@ SMSG_LFG_OFFER_CONTINUE
Definition: Opcodes.h:1490
@ SMSG_LFG_BOOT_PLAYER
Definition: Opcodes.h:1475
Definition: LFG.cpp:24
LfgTeleportResult
Teleport errors.
Definition: LFGMgr.h:95
STL namespace.
LFGBlackListSlot(uint32 slot, uint32 reason, int32 subReason1, int32 subReason2, uint32 softLock)
Definition: LFGPackets.h:126
Optional< ObjectGuid > PlayerGuid
Definition: LFGPackets.h:138
std::vector< LFGBlackListSlot > Slot
Definition: LFGPackets.h:139
LFGPlayerRewards(int32 id, uint32 quantity, int32 bonusQuantity, bool isCurrency)
Definition: LFGPackets.h:314
Optional< Item::ItemInstance > RewardItem
Definition: LFGPackets.h:328
LFGRoleCheckUpdateMember(ObjectGuid guid, uint8 rolesDesired, uint8 level, bool roleCheckComplete)
Definition: LFGPackets.h:255
std::vector< LfgPlayerQuestReward > ShortageReward
Definition: LFGPackets.h:194
LfgPlayerQuestRewardCurrency(int32 currencyID, int32 quantity)
Definition: LFGPackets.h:154
LfgPlayerQuestRewardItem(int32 itemId, int32 quantity)
Definition: LFGPackets.h:145
std::vector< LfgPlayerQuestRewardCurrency > Currency
Definition: LFGPackets.h:166
std::vector< LfgPlayerQuestRewardItem > Item
Definition: LFGPackets.h:165
std::vector< LfgPlayerQuestRewardCurrency > BonusCurrency
Definition: LFGPackets.h:167