Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
GroupHandler.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#include "Common.h"
7#include "DatabaseEnv.h"
8#include "Group.h"
9#include "GroupMgr.h"
10#include "LFGMgr.h"
11#include "Log.h"
12#include "ObjectMgr.h"
13#include "Opcodes.h"
14#include "Pet.h"
15#include "Player.h"
16#include "SocialMgr.h"
17#include "SpellAuras.h"
18#include "Util.h"
19#include "Vehicle.h"
20#include "World.h"
21#include "WorldPacket.h"
22#include "WorldSession.h"
23
24class Aura;
25
26/* differeces from off:
27 -you can uninvite yourself - is is useful
28 -you can accept invitation even if leader went offline
29*/
30/* todo:
31 -group_destroyed msg is sent but not shown
32 -reduce xp gaining when in raid group
33 -quest sharing has to be corrected
34 -FIX sending PartyMemberStats
35*/
36
37void WorldSession::SendPartyResult(PartyOperation operation, const std::string& member, PartyResult res, uint32 val /* = 0 */)
38{
39 WorldPacket data(SMSG_PARTY_COMMAND_RESULT, 4 + member.size() + 1 + 4 + 4 + 8);
40 data << uint32(operation);
41 data << member;
42 data << uint32(res);
43 data << uint32(val); // LFD cooldown related (used with ERR_PARTY_LFG_BOOT_COOLDOWN_S and ERR_PARTY_LFG_BOOT_NOT_ELIGIBLE_S)
44 data << uint64(0); // player who caused error (in some cases).
45
46 SendPacket(&data);
47}
48
49void WorldSession::SendGroupInviteNotification(const std::string& inviterName, const std::string& realmName, bool inGroup)
50{
51 SF_LOG_DEBUG("network", "WORLD: sending SMSG_GROUP_INVITE");
52 ObjectGuid invitedGuid = GetPlayer()->GetGUID();
53
54 WorldPacket data(SMSG_GROUP_INVITE, 6 + 1 + 8 + 8 + 4 + 4 + 4 + inviterName.size() + realmName.size());
55 data.WriteBits(realmName.size(), 8);
56 data.WriteBits(0, 8);
57 data.WriteBit(invitedGuid[2]);
58 data.WriteBit(0);
59 data.WriteBits(inviterName.size(), 6); // inviter name length
60 data.WriteBit(invitedGuid[7]);
61 data.WriteBit(invitedGuid[5]);
62 data.WriteBit(!inGroup); // inverse already in group
63 data.WriteBit(0); // auto decline
64 data.WriteBit(invitedGuid[1]);
65 data.WriteBit(1); // cross realm invite (includes hyphen between inviter and server name)
66 data.WriteBit(1); // realm transfer warning("Accepting this invitation may transfer you to another realm")
67 data.WriteBits(0, 22); // counter
68 data.WriteBit(invitedGuid[3]);
69 data.WriteBit(invitedGuid[0]);
70 data.WriteBit(invitedGuid[4]);
71 data.WriteBit(invitedGuid[6]);
72 data.FlushBits();
73
74 data.WriteByteSeq(invitedGuid[6]);
75 data.WriteString(realmName);
76 data.WriteByteSeq(invitedGuid[7]);
77 data.WriteByteSeq(invitedGuid[2]);
78 data.WriteByteSeq(invitedGuid[0]);
79 data << uint64(0); // BnetAccID
80 data << uint32(0);
81 data << uint32(0);
82 data.WriteByteSeq(invitedGuid[1]);
83 data.WriteByteSeq(invitedGuid[5]);
84 data.WriteByteSeq(invitedGuid[4]);
85 data << int32(0);
86 data.WriteString(inviterName);
87 data.WriteByteSeq(invitedGuid[3]);
88 data << uint32(0);
89
90 /*for (int i = 0; i < counter; i++)
91 data << int32(0);*/
92
93 SendPacket(&data);
94}
95
97{
98 SF_LOG_DEBUG("network", "WORLD: Received CMSG_GROUP_INVITE");
99
100 ObjectGuid crossRealmGuid; // unused
101
102 recvData.read_skip<uint32>(); // Non-zero in cross realm invites
103 recvData.read_skip<uint8>(); // Unknown
104 recvData.read_skip<uint32>(); // Always 0
105
106 recvData.ReadGuidMask(crossRealmGuid, 7);
107 uint8 realmLen = recvData.ReadBits(9);
108 recvData.ReadGuidMask(crossRealmGuid, 3);
109 uint8 nameLen = recvData.ReadBits(9);
110 recvData.ReadGuidMask(crossRealmGuid, 2, 5, 4, 0, 1, 6);
111
112 recvData.ReadGuidBytes(crossRealmGuid, 7, 6, 0, 4);
113 std::string realmName = recvData.ReadString(realmLen);
114 recvData.ReadGuidBytes(crossRealmGuid, 1, 2, 3);
115 std::string memberName = recvData.ReadString(nameLen);
116 recvData.ReadGuidBytes(crossRealmGuid, 5);
117
118 if (realmName.empty())
119 {
120 CharacterNameData const* nameData = sWorld->GetCharacterNameData(GUID_LOPART(_player->GetGUID()));
121 RealmNameMap::const_iterator iter = realmNameStore.find(nameData->m_realm);
122 if (iter != realmNameStore.end()) // Add local realm
123 {
124 realmName = iter->second;
125 }
126 }
127
128 // attempt add selected player
129 // cheating
130 if (!normalizePlayerName(memberName))
131 {
133 return;
134 }
135
136 memberName = memberName.substr(0, memberName.find("-"));
137 Player* player = sObjectAccessor->FindPlayerByName(memberName);
138
139 // no player
140 if (!player)
141 {
143 return;
144 }
145
146 // restrict invite to GMs
147 if (!sWorld->GetBoolConfig(WorldBoolConfigs::CONFIG_ALLOW_GM_GROUP) && !GetPlayer()->IsGameMaster() && player->IsGameMaster())
148 {
150 return;
151 }
152
153 // can't group with
154 if (!GetPlayer()->IsGameMaster() && !sWorld->GetBoolConfig(WorldBoolConfigs::CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && GetPlayer()->GetTeam() != player->GetTeam())
155 {
157 return;
158 }
159
160 if (GetPlayer()->GetInstanceId() != 0 && player->GetInstanceId() != 0 && GetPlayer()->GetInstanceId() != player->GetInstanceId() && GetPlayer()->GetMapId() == player->GetMapId())
161 {
163 return;
164 }
165
166 // just ignore us
167 if (player->GetInstanceId() != 0 && player->GetDungeonDifficulty() != GetPlayer()->GetDungeonDifficulty())
168 {
170 return;
171 }
172
173 if (player->GetSocial()->HasIgnore(GetPlayer()->GetGUIDLow()))
174 {
176 return;
177 }
178
179 Group* group = GetPlayer()->GetGroup();
180 if (group && group->isBGGroup())
181 group = GetPlayer()->GetOriginalGroup();
182
183 Group* group2 = player->GetGroup();
184 if (group2 && group2->isBGGroup())
185 group2 = player->GetOriginalGroup();
186 // player already in another group or invited
187 if (group2 || player->GetGroupInvite())
188 {
190
191 if (group2)
192 {
193 // tell the player that they were invited but it failed as they were already in a group
194 player->GetSession()->SendGroupInviteNotification(GetPlayer()->GetName(), realmName, true);
195 }
196
197 return;
198 }
199
200 if (group)
201 {
202 // not have permissions for invite
203 if (!group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID()))
204 {
206 return;
207 }
208 // not have place
209 if (group->IsFull())
210 {
212 return;
213 }
214 }
215
216 // ok, but group not exist, start a new group
217 // but don't create and save the group to the DB until
218 // at least one person joins
219 if (!group)
220 {
221 group = new Group;
222 // new group: if can't add then delete
223 if (!group->AddLeaderInvite(GetPlayer()))
224 {
225 delete group;
226 return;
227 }
228 if (!group->AddInvite(player))
229 {
230 delete group;
231 return;
232 }
233 }
234 else
235 {
236 // already existed group: if can't add then just leave
237 if (!group->AddInvite(player))
238 {
239 return;
240 }
241 }
242
243 // ok, we do it
244 player->GetSession()->SendGroupInviteNotification(GetPlayer()->GetName(), realmName, false);
245
247}
248
250{
251 SF_LOG_DEBUG("network", "WORLD: Received CMSG_GROUP_INVITE_RESPONSE");
252
253 recvData.read_skip<uint8>(); // Unknown
254 bool unknown = recvData.ReadBit(); // Unknown
255 bool accept = recvData.ReadBit();
256
257 /*if (unknown)
258 recvData.read_skip<uint32>();*/
259
260 Group* group = GetPlayer()->GetGroupInvite();
261
262 if (!group)
263 return;
264
265 if (accept)
266 {
267 // Remove player from invitees in any case
268 group->RemoveInvite(GetPlayer());
269
270 if (group->GetLeaderGUID() == GetPlayer()->GetGUID())
271 {
272 SF_LOG_ERROR("network", "HandleGroupAcceptOpcode: player %s(%d) tried to accept an invite to his own group", GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow());
273 return;
274 }
275
276 // Group is full
277 if (group->IsFull())
278 {
280 return;
281 }
282
284
285 // Forming a new group, create it
286 if (!group->IsCreated())
287 {
288 // This can happen if the leader is zoning. To be removed once delayed actions for zoning are implemented
289 if (!leader)
290 {
291 group->RemoveAllInvites();
292 return;
293 }
294
295 // If we're about to create a group there really should be a leader present
296 ASSERT(leader);
297 group->RemoveInvite(leader);
298 group->Create(leader);
299 sGroupMgr->AddGroup(group);
300 }
301
302 // Everything is fine, do it, PLAYER'S GROUP IS SET IN ADDMEMBER!!!
303 if (!group->AddMember(GetPlayer()))
304 return;
305
306 group->BroadcastGroupUpdate();
307 }
308 else
309 {
310 // Remember leader if online (group pointer will be invalid if group gets disbanded)
312
313 // uninvite, group can be deleted
315
316 if (!leader || !leader->GetSession())
317 return;
318
319 // report
320 WorldPacket data(SMSG_GROUP_DECLINE, GetPlayer()->GetName().size());
321 data << GetPlayer()->GetName();
322 leader->GetSession()->SendPacket(&data);
323 }
324}
325
327{
328 SF_LOG_DEBUG("network", "WORLD: Received CMSG_GROUP_UNINVITE_GUID");
329
330 ObjectGuid guid;
331
332 recvData.read_skip<uint8>();
333
334 guid[6] = recvData.ReadBit();
335 guid[4] = recvData.ReadBit();
336 guid[3] = recvData.ReadBit();
337 guid[2] = recvData.ReadBit();
338 guid[0] = recvData.ReadBit();
339 guid[1] = recvData.ReadBit();
340 guid[7] = recvData.ReadBit();
341 guid[5] = recvData.ReadBit();
342
343 uint8 reasonLen = recvData.ReadBits(8);
344 std::string reason = recvData.ReadString(reasonLen);
345 recvData.ReadByteSeq(guid[5]);
346 recvData.ReadByteSeq(guid[6]);
347 recvData.ReadByteSeq(guid[1]);
348 recvData.ReadByteSeq(guid[4]);
349 recvData.ReadByteSeq(guid[3]);
350 recvData.ReadByteSeq(guid[2]);
351 recvData.ReadByteSeq(guid[7]);
352 recvData.ReadByteSeq(guid[0]);
353
354 //can't uninvite yourself
355 if (guid == GetPlayer()->GetGUID())
356 {
357 SF_LOG_ERROR("network", "WorldSession::HandleGroupUninviteGuidOpcode: leader %s(%d) tried to uninvite himself from the group.",
358 GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow());
359 return;
360 }
361
364 {
366 return;
367 }
368
369 Group* grp = GetPlayer()->GetGroup();
370 if (!grp)
371 return;
372
373 if (grp->IsLeader(guid))
374 {
376 return;
377 }
378
379 if (grp->IsMember(guid))
380 {
381 Player::RemoveFromGroup(grp, guid, GROUP_REMOVEMETHOD_KICK, GetPlayer()->GetGUID(), reason.c_str());
382 return;
383 }
384
385 if (Player* player = grp->GetInvited(guid))
386 {
387 player->UninviteFromGroup();
388 return;
389 }
390
392}
393
395{
396 SF_LOG_DEBUG("network", "WORLD: Received CMSG_GROUP_SET_LEADER");
397
398 ObjectGuid guid;
399
400 recvData.read_skip<uint8>();
401
402 recvData.ReadGuidMask(guid, 1, 7, 0, 2, 5, 3, 4, 6);
403 recvData.ReadGuidBytes(guid, 1, 5, 7, 6, 0, 2, 4, 3);
404
405 Player* player = ObjectAccessor::FindPlayer(guid);
406 Group* group = GetPlayer()->GetGroup();
407
408 if (!group || !player)
409 return;
410
411 if (!group->IsLeader(GetPlayer()->GetGUID()) || player->GetGroup() != group)
412 return;
413
414 // Everything's fine, accepted.
415 group->ChangeLeader(guid);
416 group->SendUpdate();
417}
418
420{
421 SF_LOG_DEBUG("network", "WORLD: Received CMSG_GROUP_SET_ROLES");
422
423 uint32 newRole;
424 ObjectGuid targetGuid;
425
426 recvData.read_skip<uint8>();
427 recvData >> newRole;
428
429 recvData.ReadGuidMask(targetGuid, 2, 0, 7, 4, 1, 3, 6, 5);
430 recvData.ReadGuidBytes(targetGuid, 1, 5, 2, 6, 7, 0, 4, 3);
431
432 Player* tPlayer = ObjectAccessor::FindPlayer(targetGuid);
433 Group* group = GetPlayer()->GetGroup();
434
435 if (!tPlayer || !group)
436 return;
437
438 if (group != tPlayer->GetGroup())
439 return;
440
441 ObjectGuid assignerGuid = GetPlayer()->GetGUID();
442
443 WorldPacket data(SMSG_GROUP_SET_ROLE, 1 + 8 + 1 + 8 + 4 + 1 + 4);
444 data.WriteGuidMask(assignerGuid, 1);
445 data.WriteGuidMask(targetGuid, 7, 6, 4, 1, 0);
446 data.WriteGuidMask(assignerGuid, 0, 7);
447 data.WriteGuidMask(targetGuid, 3);
448 data.WriteGuidMask(assignerGuid, 6);
449 data.WriteGuidMask(targetGuid, 2);
450 data.WriteGuidMask(assignerGuid, 4, 5, 2);
451 data.WriteGuidMask(targetGuid, 5);
452 data.WriteGuidMask(assignerGuid, 3);
453
454 data.WriteGuidBytes(assignerGuid, 1, 6, 2);
455 data.WriteGuidBytes(targetGuid, 3);
456 data << uint32(group->GetMemberRole(targetGuid));
457 data.WriteGuidBytes(assignerGuid, 7);
458 data.WriteGuidBytes(targetGuid, 5);
459 data.WriteGuidBytes(assignerGuid, 3);
460 data.WriteGuidBytes(targetGuid, 4, 7);
461 data.WriteGuidBytes(assignerGuid, 5);
462 data.WriteGuidBytes(targetGuid, 6, 2, 1, 0);
463 data.WriteGuidBytes(assignerGuid, 4);
464 data << uint8(0); // unknown
465 data.WriteGuidBytes(assignerGuid, 0);
466 data << uint32(newRole);
467
468 group->BroadcastPacket(&data, false);
469 group->SetMemberRole(targetGuid, newRole);
470 group->SendUpdate();
471}
472
474{
475 SF_LOG_DEBUG("network", "WORLD: Received CMSG_GROUP_DISBAND");
476
477 Group* grp = GetPlayer()->GetGroup();
478 if (!grp)
479 return;
480
481 if (_player->InBattleground())
482 {
484 return;
485 }
486
488 /********************/
489
490 // everything's fine, do it
492
493 if (grp->isLFGGroup())
494 {
495 lfg::LfgState const state = sLFGMgr->GetState(grp->GetGUID());
497 {
498 grp->Disband();
499 return;
500 }
501 }
502
504}
505
507{
508 SF_LOG_DEBUG("network", "WORLD: Received CMSG_LOOT_METHOD");
509
510 ObjectGuid lootMaster;
511 uint8 lootMethod;
512 uint32 lootThreshold;
513
514 recvData.read_skip<uint8>(); // PartyIndex
515 recvData >> lootMethod; // Method
516 recvData >> lootThreshold; // Threshold
517 recvData.ReadGuidMask(lootMaster, 7, 1, 2, 0, 4, 5, 6, 3);
518 recvData.ReadGuidBytes(lootMaster, 7, 1, 3, 4, 6, 5, 0, 2);
519
520 Group* group = GetPlayer()->GetGroup();
521 if (!group)
522 return;
523
525 if (!group->IsLeader(GetPlayer()->GetGUID()))
526 return;
527 /********************/
528
529 // everything's fine, do it
530 group->SetLootMethod((LootMethod)lootMethod);
531 group->SetLooterGuid(lootMaster);
532 group->SetLootThreshold((ItemQualities)lootThreshold);
533 group->SendUpdate();
534}
535
537{
538 ObjectGuid guid;
539 uint8 rollType, itemSlot;
540
541 recvData >> itemSlot;
542 recvData >> rollType; // 0: pass, 1: need, 2: greed
543
544 recvData.ReadGuidMask(guid, 7, 1, 2, 0, 6, 3, 4, 5);
545 recvData.ReadGuidBytes(guid, 0, 2, 7, 3, 1, 5, 4, 6);
546
547 Group* group = GetPlayer()->GetGroup();
548 if (!group)
549 return;
550
551 RollType type = RollType(rollType);
552 group->CountRollVote(GetPlayer()->GetGUID(), guid, type);
553
554 switch (type)
555 {
558 break;
561 break;
562 default:
563 break;
564 }
565}
566
568{
569 SF_LOG_DEBUG("network", "WORLD: Received CMSG_MINIMAP_PING");
570
571 if (!GetPlayer()->GetGroup())
572 return;
573
574 float x, y;
575 recvData >> y;
576 recvData >> x;
577 recvData.read_skip<uint8>();
578
579 //SF_LOG_DEBUG("misc", "Received opcode MSG_MINIMAP_PING X: %f, Y: %f", x, y);
580
582 /********************/
583
584 ObjectGuid guid = GetPlayer()->GetGUID();
585
586 // everything's fine, do it
587 WorldPacket data(SMSG_MINIMAP_PING, 1 + 8 + 4 + 4);
588 data << float(y);
589 data << float(x);
590
591 data.WriteGuidMask(guid, 0, 5, 2, 7, 1, 3, 6, 4);
592 data.WriteGuidBytes(guid, 6, 5, 7, 2, 0, 3, 1, 4);
593
594 GetPlayer()->GetGroup()->BroadcastPacket(&data, true, -1, GetPlayer()->GetGUID());
595}
596
598{
599 SF_LOG_DEBUG("network", "WORLD: Received CMSG_RANDOM_ROLL");
600
601 uint32 minimum, maximum, roll;
602 recvData >> maximum;
603 recvData >> minimum;
604 recvData.read_skip<uint8>();
605
607 if (minimum > maximum || maximum > 10000) // < 32768 for urand call
608 return;
609 /********************/
610
611 // everything's fine, do it
612 roll = std::rand() % maximum + minimum;
613
614 //SF_LOG_DEBUG("misc", "ROLL: MIN: %u, MAX: %u, ROLL: %u", minimum, maximum, roll);
615
616 ObjectGuid guid = GetPlayer()->GetGUID();
617
618 WorldPacket data(SMSG_RANDOM_ROLL, 4 + 4 + 4 + 1 + 8);
619 data << uint32(roll);
620 data << uint32(minimum);
621 data << uint32(maximum);
622
623 data.WriteGuidMask(guid, 0, 6, 7, 1, 4, 5, 2, 3);
624 data.WriteGuidBytes(guid, 5, 4, 2, 0, 3, 1, 6, 7);
625
626 if (GetPlayer()->GetGroup())
627 GetPlayer()->GetGroup()->BroadcastPacket(&data, false);
628 else
629 SendPacket(&data);
630}
631
633{
634 SF_LOG_DEBUG("network", "WORLD: Received MSG_RAID_TARGET_UPDATE");
635
636 Group* group = GetPlayer()->GetGroup();
637 if (!group)
638 return;
639
640 uint8 Symbol, Index;
641 recvData >> Symbol >> Index;
642
644 /********************/
645
646 // everything's fine, do it
647 if (Symbol == 0xFF) // target icon request
648 group->SendTargetIconList(this);
649 else // target icon update
650 {
651 if (!group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID()))
652 return;
653
654 ObjectGuid targetGuid;
655
656 recvData.ReadGuidMask(targetGuid, 3, 2, 1, 5, 0, 6, 7, 4);
657 recvData.ReadGuidBytes(targetGuid, 2, 3, 0, 7, 5, 1, 6, 4);
658
659 group->SetTargetIcon(Symbol, _player->GetGUID(), targetGuid, Index);
660 }
661}
662
664{
665 SF_LOG_DEBUG("network", "WORLD: Received CMSG_GROUP_RAID_CONVERT");
666
667 Group* group = GetPlayer()->GetGroup();
668 if (!group)
669 return;
670
671 if (_player->InBattleground())
672 return;
673
674 // error handling
675 if (!group->IsLeader(GetPlayer()->GetGUID()) || group->GetMembersCount() < 2)
676 return;
677
678 // everything's fine, do it (is it 0 (PARTY_OP_INVITE) correct code)
680
681 // New 4.x: it is now possible to convert a raid to a group if member count is 5 or less
682
683 bool toRaid;
684 toRaid = recvData.ReadBit();
685
686 if (toRaid)
687 group->ConvertToRaid();
688 else
689 group->ConvertToGroup();
690}
691
693{
694 SF_LOG_DEBUG("network", "WORLD: Received CMSG_GROUP_CHANGE_SUB_GROUP");
695
696 // we will get correct pointer for group here, so we don't have to check if group is BG raid
697 Group* group = GetPlayer()->GetGroup();
698 if (!group)
699 return;
700
701 ObjectGuid TargetGUID;
702
703 uint8 PartyIndex;
704 uint8 groupNr;
705
706 recvData >> PartyIndex;
707 recvData >> groupNr;
708
709 recvData.ReadGuidMask(TargetGUID, 1, 4, 6, 3, 7, 2, 0, 5); //17, 20, 22, 19, 23, 18, 16, 21
710 recvData.ReadGuidBytes(TargetGUID, 2, 6, 1, 5, 3, 4, 0, 7); //18, 22, 17, 21, 19, 20, 16, 23
711
712 if (groupNr >= MAX_RAID_SUBGROUPS)
713 return;
714
715 uint64 senderGuid = GetPlayer()->GetGUID();
716 if (!group->IsLeader(senderGuid) && !group->IsAssistant(senderGuid))
717 return;
718
719 if (!group->HasFreeSlotSubGroup(groupNr))
720 return;
721
722 if (Player* movedPlayer = sObjectAccessor->FindPlayer(TargetGUID))
723 group->ChangeMembersGroup(movedPlayer, groupNr);
724}
725
727{
728 SF_LOG_DEBUG("network", "WORLD: Received CMSG_GROUP_SWAP_SUB_GROUP");
729 std::string unk1;
730 std::string unk2;
731
732 recvData >> unk1;
733 recvData >> unk2;
734}
735
737{
738 SF_LOG_DEBUG("network", "WORLD: Received CMSG_GROUP_ASSISTANT_LEADER");
739
740 Group* group = GetPlayer()->GetGroup();
741 if (!group)
742 return;
743
744 if (!group->IsLeader(GetPlayer()->GetGUID()))
745 return;
746
747 ObjectGuid guid;
748
749 uint8 unk = 0;
750 recvData >> unk;
751
752 recvData.ReadGuidMask(guid, 2, 0, 6, 3, 1);
753 bool apply = recvData.ReadBit();
754 recvData.ReadGuidMask(guid, 4, 5, 7);
755
756 recvData.ReadGuidBytes(guid, 5, 1, 0, 7, 3, 6, 2, 4);
757
759
760 group->SendUpdate();
761}
762
764{
765 SF_LOG_DEBUG("network", "WORLD: Received CMSG_SET_EVERYONE_IS_ASSISTANT");
766
767 Group* group = GetPlayer()->GetGroup();
768 if (!group)
769 return;
770
771 if (!group->IsLeader(GetPlayer()->GetGUID()))
772 return;
773
774 recvData.read_skip<uint8>();
775 bool apply = recvData.ReadBit();
776 recvData.FlushBits();
777
778 group->ChangeFlagEveryoneAssistant(apply);
779}
780
782{
783 SF_LOG_DEBUG("network", "WORLD: Received CMSG_SET_PARTY_ASSIGNMENT");
784
785 Group* group = GetPlayer()->GetGroup();
786 if (!group)
787 return;
788
789 uint64 senderGuid = GetPlayer()->GetGUID();
790 if (!group->IsLeader(senderGuid) && !group->IsAssistant(senderGuid))
791 return;
792
793 uint8 Assignment, partyindex;
794 ObjectGuid guid;
795 recvData >> Assignment;
796 recvData >> partyindex;
797 recvData.ReadGuidMask(guid, 5, 6, 2, 3, 1, 0, 4, 7);
798 bool apply = recvData.ReadBit();
799 recvData.FlushBits();
800 recvData.ReadGuidBytes(guid, 2, 5, 1, 0, 6, 3, 4, 7);
801
802 GroupMemberAssignment assignment = GroupMemberAssignment(Assignment);
803 switch (assignment)
804 {
808 break;
812 default:
813 break;
814 }
815
816 group->SendUpdate();
817}
818
820{
821 SF_LOG_DEBUG("network", "WORLD: Received CMSG_RAID_READY_CHECK");
822
823 Group* group = GetPlayer()->GetGroup();
824 if (!group)
825 return;
826
827 ObjectGuid playerGuid = GetPlayer()->GetGUID();
828
830 if (!group->IsLeader(playerGuid) && !group->IsAssistant(playerGuid))
831 return;
832
833 // check is also done client side
834 if (group->ReadyCheckInProgress())
835 return;
836 /********************/
837
838 uint32 readyCheckDuration = 35000;
839 ObjectGuid groupGuid = group->GetGUID();
840
841 // everything's fine, do it
842 WorldPacket data(SMSG_RAID_READY_CHECK, 1 + 8 + 1 + 8 + 1 + 4);
843 data.WriteBit(groupGuid[4]);
844 data.WriteBit(groupGuid[2]);
845 data.WriteBit(playerGuid[4]);
846 data.WriteBit(groupGuid[3]);
847 data.WriteBit(groupGuid[7]);
848 data.WriteBit(groupGuid[1]);
849 data.WriteBit(groupGuid[0]);
850 data.WriteBit(playerGuid[6]);
851 data.WriteBit(playerGuid[5]);
852 data.WriteBit(groupGuid[6]);
853 data.WriteBit(groupGuid[5]);
854 data.WriteBit(playerGuid[0]);
855 data.WriteBit(playerGuid[1]);
856 data.WriteBit(playerGuid[2]);
857 data.WriteBit(playerGuid[7]);
858 data.WriteBit(playerGuid[3]);
859
860 data << uint32(readyCheckDuration);
861 data.WriteByteSeq(groupGuid[2]);
862 data.WriteByteSeq(groupGuid[7]);
863 data.WriteByteSeq(groupGuid[3]);
864 data.WriteByteSeq(playerGuid[4]);
865 data.WriteByteSeq(groupGuid[1]);
866 data.WriteByteSeq(groupGuid[0]);
867 data.WriteByteSeq(playerGuid[1]);
868 data.WriteByteSeq(playerGuid[2]);
869 data.WriteByteSeq(playerGuid[6]);
870 data.WriteByteSeq(playerGuid[5]);
871 data.WriteByteSeq(groupGuid[6]);
872 data.WriteByteSeq(playerGuid[0]);
873 data << uint8(0); // unknown
874 data.WriteByteSeq(playerGuid[7]);
875 data.WriteByteSeq(groupGuid[4]);
876 data.WriteByteSeq(playerGuid[3]);
877 data.WriteByteSeq(groupGuid[5]);
878
879 group->BroadcastPacket(&data, false);
880
881 group->ReadyCheck(true);
882 group->ReadyCheckMemberHasResponded(playerGuid);
883 group->OfflineReadyCheck();
884
885 // leader keeps track of ready check timer
886 GetPlayer()->SetReadyCheckTimer(readyCheckDuration);
887}
888
890{
891 SF_LOG_DEBUG("network", "WORLD: Received CMSG_RAID_READY_CHECK_CONFIRM");
892
893 ObjectGuid guid; // currently unused
894
895 Group* group = GetPlayer()->GetGroup();
896 if (!group)
897 return;
898
899 if (!group->ReadyCheckInProgress())
900 return;
901
902 recvData.read_skip<uint8>();
903
904 recvData.ReadGuidMask(guid, 2, 1, 0, 3, 6);
905 bool status = recvData.ReadBit();
906 recvData.ReadGuidMask(guid, 7, 4, 5);
907
908 recvData.ReadGuidBytes(guid, 1, 0, 3, 2, 4, 5, 7, 6);
909
910 ObjectGuid groupGuid = group->GetGUID();
911 ObjectGuid playerGuid = GetPlayer()->GetGUID();
912
913 WorldPacket data(SMSG_RAID_READY_CHECK_CONFIRM, 1 + 1 + 8 + 1 + 8);
914 data.WriteBit(groupGuid[4]);
915 data.WriteBit(playerGuid[5]);
916 data.WriteBit(playerGuid[3]);
917 data.WriteBit(status);
918 data.WriteBit(groupGuid[2]);
919 data.WriteBit(playerGuid[6]);
920 data.WriteBit(groupGuid[3]);
921 data.WriteBit(playerGuid[0]);
922 data.WriteBit(playerGuid[1]);
923 data.WriteBit(groupGuid[1]);
924 data.WriteBit(groupGuid[5]);
925 data.WriteBit(playerGuid[7]);
926 data.WriteBit(playerGuid[4]);
927 data.WriteBit(groupGuid[6]);
928 data.WriteBit(playerGuid[2]);
929 data.WriteBit(groupGuid[0]);
930 data.WriteBit(groupGuid[7]);
931 data.FlushBits();
932
933 data.WriteByteSeq(playerGuid[4]);
934 data.WriteByteSeq(playerGuid[2]);
935 data.WriteByteSeq(playerGuid[1]);
936 data.WriteByteSeq(groupGuid[4]);
937 data.WriteByteSeq(groupGuid[2]);
938 data.WriteByteSeq(playerGuid[0]);
939 data.WriteByteSeq(groupGuid[5]);
940 data.WriteByteSeq(groupGuid[3]);
941 data.WriteByteSeq(playerGuid[7]);
942 data.WriteByteSeq(groupGuid[6]);
943 data.WriteByteSeq(groupGuid[1]);
944 data.WriteByteSeq(playerGuid[6]);
945 data.WriteByteSeq(playerGuid[3]);
946 data.WriteByteSeq(playerGuid[5]);
947 data.WriteByteSeq(groupGuid[0]);
948 data.WriteByteSeq(groupGuid[7]);
949
950 group->BroadcastPacket(&data, false);
951 group->ReadyCheckMemberHasResponded(playerGuid);
952
953 if (group->ReadyCheckAllResponded())
954 {
956 if (leader)
957 leader->SetReadyCheckTimer(0);
958
959 group->ReadyCheck(false);
962 }
963}
964
966{
967 //Group* group = GetPlayer()->GetGroup();
968 //if (!group)
969 // return;
970
971 //if (!group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID()))
972 // return;
973
974 // Is any reaction need?
975}
976
978{
979 uint32 mask = player->GetGroupUpdateFlag();
980 ObjectGuid guid = player->GetGUID();
981 ByteBuffer databuff;
982
983 if (mask == GROUP_UPDATE_FLAG_NONE)
984 return;
985
986 std::set<uint32> const& phases = player->GetPhases();
987
988 if (mask & GROUP_UPDATE_FLAG_POWER_TYPE) // if update power type, update current/max power also
990
991 if (mask & GROUP_UPDATE_FLAG_PET_POWER_TYPE) // same for pets
993
994 data->Initialize(SMSG_PARTY_MEMBER_STATE, 80); // average value
995 data->WriteBit(guid[0]);
996 data->WriteBit(guid[5]);
997 data->WriteBit(0); // ForEnemy
998 data->WriteBit(guid[1]);
999 data->WriteBit(guid[4]);
1000 data->WriteBit(1); // FullUpdate
1001 data->WriteBit(guid[6]);
1002 data->WriteBit(guid[2]);
1003 data->WriteBit(guid[7]);
1004 data->WriteBit(guid[3]);
1005 data->FlushBits();
1006 data->WriteByteSeq(guid[3]);
1007 data->WriteByteSeq(guid[2]);
1008 data->WriteByteSeq(guid[6]);
1009 data->WriteByteSeq(guid[7]);
1010 data->WriteByteSeq(guid[5]);
1011 *data << uint32(mask); // 6
1012 data->WriteByteSeq(guid[1]);
1013 data->WriteByteSeq(guid[4]);
1014 data->WriteByteSeq(guid[0]);
1015
1016 if (mask & GROUP_UPDATE_FLAG_STATUS)
1017 {
1018 uint16 playerStatus = MEMBER_STATUS_ONLINE;
1019 if (player->IsPvP())
1020 playerStatus |= MEMBER_STATUS_PVP;
1021
1022 if (!player->IsAlive())
1023 {
1025 playerStatus |= MEMBER_STATUS_GHOST;
1026 else
1027 playerStatus |= MEMBER_STATUS_DEAD;
1028 }
1029
1031 playerStatus |= MEMBER_STATUS_PVP_FFA;
1032
1033 if (player->isAFK())
1034 playerStatus |= MEMBER_STATUS_AFK;
1035
1036 if (player->isDND())
1037 playerStatus |= MEMBER_STATUS_DND;
1038
1039 databuff << uint16(playerStatus);
1040 }
1041
1042 /*
1043 if (mask & GROUP_UPDATE_FLAG_UNK)
1044 {
1045 databuff << uint8(1); // ?
1046 databuff << uint8(0); // ?
1047 }*/
1048
1049 if (mask & GROUP_UPDATE_FLAG_CUR_HP)
1050 databuff << uint32(player->GetHealth());
1051
1052 if (mask & GROUP_UPDATE_FLAG_MAX_HP)
1053 databuff << uint32(player->GetMaxHealth());
1054
1056 databuff << uint8(player->getPowerType());
1057
1058 //if (mask & GROUP_UPDATE_FLAG_UNK2)
1059 // databuff << uint16(0);
1060
1061 if (mask & GROUP_UPDATE_FLAG_CUR_POWER)
1062 databuff << uint16(player->GetPower(player->getPowerType()));
1063
1064 if (mask & GROUP_UPDATE_FLAG_MAX_POWER)
1065 databuff << uint16(player->GetMaxPower(player->getPowerType()));
1066
1067 if (mask & GROUP_UPDATE_FLAG_LEVEL)
1068 databuff << uint16(player->getLevel());
1069
1070 if (mask & GROUP_UPDATE_FLAG_ZONE)
1071 databuff << uint16(player->GetZoneId());
1072
1073 //if (mask & GROUP_UPDATE_FLAG_UNK400)
1074 // databuff << uint16(0);
1075
1076 if (mask & GROUP_UPDATE_FLAG_POSITION)
1077 {
1078 databuff << uint16(player->GetPositionX());
1079 databuff << uint16(player->GetPositionY());
1080 databuff << uint16(player->GetPositionZ());
1081 }
1082 /*
1083 if (mask & GROUP_UPDATE_FLAG_AURAS)
1084 {
1085 databuff << uint8(0);
1086 uint64 auramask = player->GetAuraUpdateMaskForRaid();
1087 databuff << uint64(auramask);
1088 databuff << uint32(MAX_AURAS); // count
1089 for (uint32 i = 0; i < MAX_AURAS; ++i)
1090 {
1091 if (auramask & (uint64(1) << i))
1092 {
1093 AuraApplication const* aurApp = player->GetVisibleAura(i);
1094 if (!aurApp)
1095 {
1096 databuff << uint32(0);
1097 databuff << uint16(0);
1098 continue;
1099 }
1100
1101 databuff << uint32(aurApp->GetBase()->GetId());
1102 databuff << uint16(aurApp->GetFlags());
1103
1104 if (aurApp->GetFlags() & AFLAG_ANY_EFFECT_AMOUNT_SENT)
1105 {
1106 for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
1107 {
1108 if (AuraEffect const* eff = aurApp->GetBase()->GetEffect(i))
1109 databuff << int32(eff->GetAmount());
1110 else
1111 databuff << int32(0);
1112 }
1113 }
1114 }
1115 }
1116 }
1117 */
1118 Pet* pet = player->GetPet();
1119 if (mask & GROUP_UPDATE_FLAG_PET_GUID)
1120 {
1121 if (pet)
1122 databuff << uint64(pet->GetGUID());
1123 else
1124 databuff << uint64(0);
1125 }
1126
1127 if (mask & GROUP_UPDATE_FLAG_PET_NAME)
1128 {
1129 if (pet)
1130 databuff << pet->GetName();
1131 else
1132 databuff << uint8(0);
1133 }
1134
1136 {
1137 if (pet)
1138 databuff << uint16(pet->GetDisplayId());
1139 else
1140 databuff << uint16(0);
1141 }
1142
1144 {
1145 if (pet)
1146 databuff << uint32(pet->GetHealth());
1147 else
1148 databuff << uint32(0);
1149 }
1150
1152 {
1153 if (pet)
1154 databuff << uint32(pet->GetMaxHealth());
1155 else
1156 databuff << uint32(0);
1157 }
1158
1160 {
1161 if (pet)
1162 databuff << uint8(pet->getPowerType());
1163 else
1164 databuff << uint8(0);
1165 }
1166
1167 //if (mask & GROUP_UPDATE_FLAG_UNK2)
1168 // databuff << uint16(0);
1169
1171 {
1172 if (pet)
1173 databuff << uint16(pet->GetPower(pet->getPowerType()));
1174 else
1175 databuff << uint16(0);
1176 }
1177
1179 {
1180 if (pet)
1181 databuff << uint16(pet->GetMaxPower(pet->getPowerType()));
1182 else
1183 databuff << uint16(0);
1184 }
1185
1186 /*
1187 if (mask & GROUP_UPDATE_FLAG_PET_AURAS)
1188 {
1189 if (pet)
1190 {
1191 *data << uint8(0);
1192 uint64 auramask = pet->GetAuraUpdateMaskForRaid();
1193 *data << uint64(auramask);
1194 *data << uint32(MAX_AURAS); // count
1195 for (uint32 i = 0; i < MAX_AURAS; ++i)
1196 {
1197 if (auramask & (uint64(1) << i))
1198 {
1199 AuraApplication const* aurApp = pet->GetVisibleAura(i);
1200 if (!aurApp)
1201 {
1202 *data << uint32(0);
1203 *data << uint16(0);
1204 continue;
1205 }
1206
1207 *data << uint32(aurApp->GetBase()->GetId());
1208 *data << uint16(aurApp->GetFlags());
1209
1210 if (aurApp->GetFlags() & AFLAG_ANY_EFFECT_AMOUNT_SENT)
1211 {
1212 for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
1213 {
1214 if (AuraEffect const* eff = aurApp->GetBase()->GetEffect(i))
1215 *data << int32(eff->GetAmount());
1216 else
1217 *data << int32(0);
1218 }
1219 }
1220 }
1221 }
1222 }
1223 else
1224 {
1225 *data << uint8(0);
1226 *data << uint64(0);
1227 }
1228 }
1229 */
1230
1232 {
1233 if (Vehicle* veh = player->GetVehicle())
1234 databuff << uint32(veh->GetVehicleInfo()->m_seatID[player->m_movementInfo.transport.seat]);
1235 else
1236 databuff << uint32(0);
1237 }
1238
1239 if (mask & GROUP_UPDATE_FLAG_PHASE)
1240 {
1241 databuff << uint32(phases.empty() ? 8 : 0);
1242 databuff << uint32(phases.size());
1243 for (std::set<uint32>::const_iterator itr = phases.begin(); itr != phases.end(); ++itr)
1244 *data << uint16(*itr);
1245 }
1246
1247 *data << uint32(databuff.size());
1248 data->append(databuff);
1249}
1250
1251/*this procedure handles clients CMSG_REQUEST_PARTY_MEMBER_STATS request*/
1253{
1254 SF_LOG_DEBUG("network", "WORLD: Received CMSG_REQUEST_PARTY_MEMBER_STATS");
1255 ObjectGuid guid;
1256
1257 recvData.read_skip<uint8>(); // flags
1258
1259 recvData.ReadGuidMask(guid, 7, 4, 0, 1, 3, 6, 2, 5);
1260 recvData.ReadGuidBytes(guid, 3, 6, 5, 2, 1, 4, 0, 7);
1261
1262 Player* player = HashMapHolder<Player>::Find(guid);
1263 if (!player)
1264 return;
1265
1266 WorldPacket data;
1268}
1269
1271{
1272 // every time the player checks the character screen
1273 _player->SendRaidInfo();
1274}
1275
1277{
1278 SF_LOG_DEBUG("network", "WORLD: Received CMSG_OPT_OUT_OF_LOOT");
1279
1280 bool passOnLoot = recvData.ReadBit(); // 1 always pass, 0 do not pass
1281
1282 // ignore if player not loaded
1283 if (!GetPlayer()) // needed because STATUS_AUTHED
1284 {
1285 if (passOnLoot)
1286 SF_LOG_ERROR("network", "CMSG_OPT_OUT_OF_LOOT value<>0 for not-loaded character!");
1287 return;
1288 }
1289
1290 GetPlayer()->SetPassOnGroupLoot(passOnLoot);
1291}
1292
1294{
1295 SF_LOG_DEBUG("network", "WORLD: Received CMSG_GROUP_INITIATE_ROLE_POLL");
1296
1297 uint8 Index = 0;
1298 recvData >> Index;
1299}
1300
1302{
1304 data.WriteGuidMask(guid, 5, 7, 3, 1, 2, 0, 4, 6);
1305 data.WriteGuidBytes(guid, 7);
1306 data << uint8(Index);
1307 data.WriteGuidBytes(guid, 6, 5, 0, 1, 4, 2, 3);
1308 GetPlayer()->GetGroup()->BroadcastPacket(&data, false, -1);
1309}
@ ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED
Definition DBCEnums.h:254
@ ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED
Definition DBCEnums.h:253
std::int32_t int32
Definition Define.h:73
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
std::uint64_t uint64
Definition Define.h:76
std::uint16_t uint16
Definition Define.h:78
#define ASSERT
Definition Errors.h:29
GroupMemberAssignment
Definition Group.h:55
@ MEMBER_STATUS_AFK
Definition Group.h:43
@ MEMBER_STATUS_PVP
Definition Group.h:38
@ MEMBER_STATUS_ONLINE
Definition Group.h:37
@ MEMBER_STATUS_DEAD
Definition Group.h:39
@ MEMBER_STATUS_GHOST
Definition Group.h:40
@ MEMBER_STATUS_DND
Definition Group.h:44
@ MEMBER_STATUS_PVP_FFA
Definition Group.h:41
@ MEMBER_FLAG_MAINASSIST
Definition Group.h:51
@ MEMBER_FLAG_ASSISTANT
Definition Group.h:49
@ MEMBER_FLAG_MAINTANK
Definition Group.h:50
@ GROUP_UPDATE_FLAG_PHASE
Definition Group.h:99
@ GROUP_UPDATE_FLAG_CUR_HP
Definition Group.h:77
@ GROUP_UPDATE_FLAG_PET_CUR_HP
Definition Group.h:91
@ GROUP_UPDATE_FLAG_POWER_TYPE
Definition Group.h:79
@ GROUP_UPDATE_FLAG_PET_CUR_POWER
Definition Group.h:95
@ GROUP_UPDATE_FLAG_PET_MAX_POWER
Definition Group.h:96
@ GROUP_UPDATE_FLAG_MAX_HP
Definition Group.h:78
@ GROUP_UPDATE_FLAG_VEHICLE_SEAT
Definition Group.h:98
@ GROUP_UPDATE_FLAG_STATUS
Definition Group.h:75
@ GROUP_UPDATE_FLAG_PET_POWER_TYPE
Definition Group.h:93
@ GROUP_UPDATE_FLAG_MAX_POWER
Definition Group.h:82
@ GROUP_UPDATE_FLAG_ZONE
Definition Group.h:84
@ GROUP_UPDATE_FLAG_NONE
Definition Group.h:74
@ GROUP_UPDATE_FLAG_POSITION
Definition Group.h:86
@ GROUP_UPDATE_FLAG_PET_MODEL_ID
Definition Group.h:90
@ GROUP_UPDATE_FLAG_PET_NAME
Definition Group.h:89
@ GROUP_UPDATE_FLAG_LEVEL
Definition Group.h:83
@ GROUP_UPDATE_FLAG_PET_GUID
Definition Group.h:88
@ GROUP_UPDATE_FLAG_PET_MAX_HP
Definition Group.h:92
@ GROUP_UPDATE_FLAG_CUR_POWER
Definition Group.h:81
#define MAX_RAID_SUBGROUPS
Definition Group.h:31
#define sGroupMgr
Definition GroupMgr.h:44
#define sLFGMgr
Definition LFGMgr.h:518
#define SF_LOG_DEBUG(filterType__,...)
Definition Log.h:134
#define SF_LOG_ERROR(filterType__,...)
Definition Log.h:143
RollType
Definition LootMgr.h:21
@ ROLL_NEED
Definition LootMgr.h:23
@ ROLL_GREED
Definition LootMgr.h:24
LootMethod
Definition LootMgr.h:47
#define sObjectAccessor
uint32 GUID_LOPART(uint64 x)
bool normalizePlayerName(std::string &name)
@ PLAYER_FLAGS_GHOST
Definition Player.h:541
@ GROUP_REMOVEMETHOD_KICK
@ GROUP_REMOVEMETHOD_LEAVE
ItemQualities
PartyResult
@ ERR_TARGET_NOT_IN_INSTANCE_S
@ UNIT_BYTE2_FLAG_FFA_PVP
Definition Unit.h:257
@ UNIT_FIELD_SHAPESHIFT_FORM
@ PLAYER_FIELD_PLAYER_FLAGS
void WriteGuidBytes(const ObjectGuid &guid, Offsets... offsets)
Definition ByteBuffer.h:264
bool WriteBit(uint32 bit)
Definition ByteBuffer.h:164
void read_skip()
Definition ByteBuffer.h:502
void WriteGuidMask(const ObjectGuid &guid, Offsets... offsets)
Definition ByteBuffer.h:248
void WriteString(std::string const &str)
Definition ByteBuffer.h:578
uint32 ReadBits(size_t bits)
Definition ByteBuffer.h:198
void ReadGuidBytes(ObjectGuid &guid, Offsets... offsets)
Definition ByteBuffer.h:256
void ReadByteSeq(uint8 &b)
Definition ByteBuffer.h:215
void append(T value)
Definition ByteBuffer.h:147
std::string ReadString(size_t length)
Definition ByteBuffer.h:565
void ReadGuidMask(ObjectGuid &guid, Offsets... offsets)
Definition ByteBuffer.h:240
void WriteBits(T value, size_t bits)
Definition ByteBuffer.h:192
size_t size() const
Definition ByteBuffer.h:609
void WriteByteSeq(uint8 b)
Definition ByteBuffer.h:227
void FlushBits()
Definition ByteBuffer.h:154
bool ReadBit()
Definition ByteBuffer.h:180
Definition Group.h:147
void BroadcastGroupUpdate(void)
Definition Group.cpp:2485
bool isLFGGroup() const
Definition Group.cpp:2543
void ReadyCheckMemberHasResponded(uint64 guid)
Definition Group.cpp:2855
bool AddLeaderInvite(Player *player)
Definition Group.cpp:305
void SendTargetIconList(WorldSession *session)
Definition Group.cpp:1566
void SetTargetIcon(uint8 id, ObjectGuid whoGuid, ObjectGuid targetGuid, uint8 Index)
Definition Group.cpp:1525
bool IsCreated() const
Definition Group.cpp:2563
void SetLootMethod(LootMethod method)
Definition Group.cpp:2513
void ChangeFlagEveryoneAssistant(bool apply)
Definition Group.cpp:202
void RemoveAllInvites()
Definition Group.cpp:324
void SetLootThreshold(ItemQualities threshold)
Definition Group.cpp:2523
void Disband(bool hideDestroy=false)
Definition Group.cpp:700
bool AddMember(Player *player)
Definition Group.cpp:353
void SetGroupMemberFlag(uint64 guid, bool apply, GroupMemberFlags flag)
Definition Group.cpp:2669
void SendUpdate()
Definition Group.cpp:1594
void BroadcastPacket(WorldPacket *packet, bool ignorePlayersInBGRaid, int group=-1, uint64 ignore=0)
Definition Group.cpp:1907
void RemoveInvite(Player *player)
Definition Group.cpp:315
bool isBGGroup() const
Definition Group.cpp:2553
void ConvertToRaid()
Definition Group.cpp:229
bool ReadyCheckInProgress() const
Definition Group.h:213
uint32 GetMembersCount() const
Definition Group.h:227
uint64 GetGUID() const
Definition Group.cpp:2573
void SetLooterGuid(uint64 guid)
Definition Group.cpp:2518
bool ReadyCheckAllResponded() const
Definition Group.cpp:2870
bool IsMember(uint64 guid) const
Definition Group.cpp:2603
Player * GetInvited(uint64 guid) const
Definition Group.cpp:333
bool HasFreeSlotSubGroup(uint8 subgroup) const
Definition Group.cpp:2645
void SetMemberRole(uint64 guid, uint32 role)
Definition Group.cpp:2822
bool AddInvite(Player *player)
Definition Group.cpp:284
void ConvertToGroup()
Definition Group.cpp:253
void CountRollVote(uint64 playerGUID, uint64 Guid, RollType Choise)
Definition Group.cpp:1333
uint32 GetMemberRole(uint64 guid) const
Definition Group.cpp:2837
bool Create(Player *leader)
Definition Group.cpp:81
void ReadyCheckResetResponded()
Definition Group.cpp:2864
bool IsFull() const
Definition Group.cpp:2538
void ReadyCheck(bool state)
Definition Group.h:258
bool IsAssistant(uint64 guid) const
Definition Group.cpp:2621
uint64 GetLeaderGUID() const
Definition Group.cpp:2568
bool IsLeader(uint64 guid) const
Definition Group.cpp:2608
void SendReadyCheckCompleted()
Definition Group.cpp:1861
void RemoveUniqueGroupMemberFlag(GroupMemberFlags flag)
Definition Group.cpp:2807
void ChangeMembersGroup(uint64 guid, uint8 group)
Definition Group.cpp:2021
void OfflineReadyCheck()
Definition Group.cpp:1931
void ChangeLeader(uint64 guid)
Definition Group.cpp:628
static T * Find(uint64 guid)
static Player * FindPlayer(uint64)
uint64 GetGUID() const
Definition Object.h:119
bool HasFlag(uint16 index, uint32 flag) const
Definition Object.cpp:1309
bool HasByteFlag(uint16 index, uint8 offset, uint8 flag) const
Definition Object.cpp:1376
Definition Pet.h:28
uint32 GetTeam() const
Definition Player.h:2527
Pet * GetPet() const
Definition Player.cpp:15640
WorldSession * GetSession() const
Definition Player.h:2417
void SetPassOnGroupLoot(bool bPassOnGroupLoot)
Definition Player.h:3029
Group * GetGroup()
Definition Player.h:2972
bool IsGameMaster() const
Definition Player.h:1369
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint64 miscValue1=0, uint64 miscValue2=0, uint64 miscValue3=0, Unit *unit=NULL)
Definition Player.cpp:21033
PartyResult CanUninviteFromGroup() const
Definition Player.cpp:20050
static void RemoveFromGroup(Group *group, uint64 guid, RemoveMethod method=GROUP_REMOVEMETHOD_DEFAULT, uint64 kicker=0, const char *reason=NULL)
Definition Player.cpp:3059
bool isDND() const
Definition Player.h:1337
PlayerSocial * GetSocial()
Definition Player.h:1346
uint32 GetGroupUpdateFlag() const
Definition Player.h:2989
void SetReadyCheckTimer(uint32 timer)
Definition Player.h:3007
void UninviteFromGroup()
Definition Player.cpp:3037
bool isAFK() const
Definition Player.h:1333
DifficultyID GetDungeonDifficulty() const
Definition Player.h:2315
Group * GetGroupInvite()
Definition Player.h:2964
Group * GetOriginalGroup()
Definition Player.h:3015
bool HasIgnore(uint32 ignore_guid)
Vehicle * GetVehicle() const
Definition Unit.h:2743
bool IsPvP() const
Definition Unit.h:1716
uint32 GetMaxHealth() const
Definition Unit.h:1604
bool IsAlive() const
Definition Unit.h:2032
int32 GetMaxPower(Powers power) const
Definition Unit.cpp:5246
uint32 GetDisplayId() const
Definition Unit.h:2490
uint32 GetHealth() const
Definition Unit.h:1600
int32 GetPower(Powers power) const
Definition Unit.cpp:5237
Powers getPowerType() const
Definition Unit.h:1651
uint8 getLevel() const
Definition Unit.h:1528
uint32 GetMapId() const
Definition Object.h:546
std::set< uint32 > const & GetPhases() const
Definition Object.h:647
uint32 GetInstanceId() const
Definition Object.h:638
std::string const & GetName() const
Definition Object.h:664
uint32 GetZoneId() const
Definition Object.cpp:1597
MovementInfo m_movementInfo
Definition Object.h:807
void Initialize(Opcodes opcode, size_t newres=200)
Definition WorldPacket.h:31
void HandleGroupUninviteGuidOpcode(WorldPacket &recvPacket)
void HandleMinimapPingOpcode(WorldPacket &recvData)
void HandleGroupAssistantLeaderOpcode(WorldPacket &recvData)
void HandleRandomRollOpcode(WorldPacket &recvData)
void HandleGroupEveryoneIsAssistantOpcode(WorldPacket &recvData)
void HandleSetPartyAssignmentOpcode(WorldPacket &recvData)
void HandleGroupSetRolesOpcode(WorldPacket &recvData)
void HandleGroupRaidConvertOpcode(WorldPacket &recvData)
void HandleRaidTargetUpdateOpcode(WorldPacket &recvData)
void HandleRaidReadyCheckConfirmOpcode(WorldPacket &recvData)
void HandleLootMethodOpcode(WorldPacket &recvPacket)
Player * GetPlayer() const
void HandleGroupInviteOpcode(WorldPacket &recvPacket)
void HandleLootRoll(WorldPacket &recvData)
void HandleGroupDisbandOpcode(WorldPacket &recvPacket)
void HandleOptOutOfLootOpcode(WorldPacket &recvData)
void HandleGroupChangeSubGroupOpcode(WorldPacket &recvData)
void HandleGroupInitiatePollRole(WorldPacket &recvData)
void BuildPartyMemberStatsChangedPacket(Player *player, WorldPacket *data)
void SendPacket(WorldPacket const *packet, bool forced=false)
Send a packet to the client.
void HandleGroupSwapSubGroupOpcode(WorldPacket &recvData)
void HandleGroupSetLeaderOpcode(WorldPacket &recvPacket)
void HandleRequestPartyMemberStatsOpcode(WorldPacket &recvData)
void SendGroupInviteNotification(const std::string &inviterName, const std::string &realmName, bool inGroup)
void HandleGroupInviteResponseOpcode(WorldPacket &recvPacket)
Player * _player
void SendPartyResult(PartyOperation operation, std::string const &member, PartyResult res, uint32 val=0)
void HandleRaidReadyCheckOpcode(WorldPacket &recvData)
void SendRolePollInform(ObjectGuid guid, uint8 Index)
void HandleRaidReadyCheckFinishedOpcode(WorldPacket &recvData)
void HandleRequestRaidInfoOpcode(WorldPacket &recvData)
PartyOperation
@ SMSG_PARTY_COMMAND_RESULT
Definition Opcodes.h:844
@ SMSG_RAID_READY_CHECK_CONFIRM
Definition Opcodes.h:922
@ SMSG_RANDOM_ROLL
Definition Opcodes.h:926
@ SMSG_GROUP_ROLE_POLL_INFORM
Definition Opcodes.h:675
@ SMSG_PARTY_MEMBER_STATE
Definition Opcodes.h:845
@ SMSG_GROUP_SET_ROLE
Definition Opcodes.h:677
@ SMSG_GROUP_INVITE
Definition Opcodes.h:673
@ SMSG_GROUP_DECLINE
Definition Opcodes.h:671
@ SMSG_MINIMAP_PING
Definition Opcodes.h:780
@ SMSG_RAID_READY_CHECK
Definition Opcodes.h:920
#define sWorld
Definition World.h:910
RealmNameMap realmNameStore
Definition Main.cpp:72
@ CONFIG_ALLOW_GM_GROUP
Definition World.h:107
@ CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP
Definition World.h:98
LfgState
Definition LFG.h:61
@ LFG_STATE_FINISHED_DUNGEON
Definition LFG.h:68
@ LFG_STATE_DUNGEON
Definition LFG.h:67
uint32 m_realm
Definition World.h:547
struct MovementInfo::TransportInfo transport
float GetPositionZ() const
Definition Object.h:330
float GetPositionX() const
Definition Object.h:328
float GetPositionY() const
Definition Object.h:329