Core/Groups: Fix setting the group roles and Role Check feature

This commit is contained in:
horn committed 2014-09-14 12:06:00 +02:00
1 parent a91e0eed80
commit cd2f8412e5
3 files changed
+46 -4

No files matched your search

+43 -2
View File
@@ -582,8 +582,12 @@ void WorldSession::HandleGroupSetRolesOpcode(WorldPacket& recvData)
data.WriteByteSeq(guid1[1]);
data << uint32(0); // Old Role
if (GetPlayer()->GetGroup())
GetPlayer()->GetGroup()->BroadcastPacket(&data, false);
if (Group* group = GetPlayer()->GetGroup())
{
/// @todo probably should be sent only if (oldRole != newRole)
group->BroadcastPacket(&data, false);
group->SetLfgRoles(guid2, newRole);
}
else
SendPacket(&data);
}
@@ -1392,3 +1396,40 @@ void WorldSession::HandleOptOutOfLootOpcode(WorldPacket& recvData)
GetPlayer()->SetPassOnGroupLoot(passOnLoot != 0);
}
void WorldSession::HandleRolePollBeginOpcode(WorldPacket& recvData)
{
TC_LOG_DEBUG("network", "WORLD: Received CMSG_ROLE_POLL_BEGIN");
Group* group = GetPlayer()->GetGroup();
if (!group)
return;
if (recvData.empty())
{
if (!group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID()))
return;
ObjectGuid guid = GetPlayer()->GetGUID();
WorldPacket data(SMSG_ROLE_POLL_BEGIN, 8);
data.WriteBit(guid[1]);
data.WriteBit(guid[5]);
data.WriteBit(guid[7]);
data.WriteBit(guid[3]);
data.WriteBit(guid[2]);
data.WriteBit(guid[4]);
data.WriteBit(guid[0]);
data.WriteBit(guid[6]);
data.WriteByteSeq(guid[4]);
data.WriteByteSeq(guid[7]);
data.WriteByteSeq(guid[0]);
data.WriteByteSeq(guid[5]);
data.WriteByteSeq(guid[1]);
data.WriteByteSeq(guid[6]);
data.WriteByteSeq(guid[2]);
data.WriteByteSeq(guid[3]);
GetPlayer()->GetGroup()->BroadcastPacket(&data, true);
}
}