Core/Groups: Fix CMSG_GROUP_SET_ROLES and SMSG_GROUP_SET_ROLE

This commit is contained in:
Tuxity committed 2012-08-27 14:22:32 +02:00
1 parent b26a7337f6
commit 9a0203cb3e
3 files changed
+77 -2

No files matched your search

+74
View File
@@ -510,6 +510,80 @@ void WorldSession::HandleGroupSetLeaderOpcode(WorldPacket& recvData)
group->SendUpdate();
}
void WorldSession::HandleGroupSetRolesOpcode(WorldPacket& recvData)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_SET_ROLES");
uint32 newRole;
ObjectGuid guid1; // Assigner GUID
ObjectGuid guid2; // Target GUID
guid1 = GetPlayer()->GetGUID();
recvData >> newRole;
guid2[2] = recvData.ReadBit();
guid2[6] = recvData.ReadBit();
guid2[3] = recvData.ReadBit();
guid2[7] = recvData.ReadBit();
guid2[5] = recvData.ReadBit();
guid2[1] = recvData.ReadBit();
guid2[0] = recvData.ReadBit();
guid2[4] = recvData.ReadBit();
recvData.ReadByteSeq(guid2[6]);
recvData.ReadByteSeq(guid2[4]);
recvData.ReadByteSeq(guid2[1]);
recvData.ReadByteSeq(guid2[3]);
recvData.ReadByteSeq(guid2[0]);
recvData.ReadByteSeq(guid2[5]);
recvData.ReadByteSeq(guid2[2]);
recvData.ReadByteSeq(guid2[7]);
WorldPacket data(SMSG_GROUP_SET_ROLE, 24);
data.WriteBit(guid1[1]);
data.WriteBit(guid2[0]);
data.WriteBit(guid2[2]);
data.WriteBit(guid2[4]);
data.WriteBit(guid2[7]);
data.WriteBit(guid2[3]);
data.WriteBit(guid1[7]);
data.WriteBit(guid2[5]);
data.WriteBit(guid1[5]);
data.WriteBit(guid1[4]);
data.WriteBit(guid1[3]);
data.WriteBit(guid2[6]);
data.WriteBit(guid1[2]);
data.WriteBit(guid1[6]);
data.WriteBit(guid2[1]);
data.WriteBit(guid1[0]);
data.WriteByteSeq(guid1[7]);
data.WriteByteSeq(guid2[3]);
data.WriteByteSeq(guid1[6]);
data.WriteByteSeq(guid2[4]);
data.WriteByteSeq(guid2[0]);
data << uint32(newRole); // New Role
data.WriteByteSeq(guid2[6]);
data.WriteByteSeq(guid2[2]);
data.WriteByteSeq(guid1[0]);
data.WriteByteSeq(guid1[4]);
data.WriteByteSeq(guid2[1]);
data.WriteByteSeq(guid1[3]);
data.WriteByteSeq(guid1[5]);
data.WriteByteSeq(guid1[2]);
data.WriteByteSeq(guid2[5]);
data.WriteByteSeq(guid2[7]);
data.WriteByteSeq(guid1[1]);
data << uint32(0); // Old Role
if (GetPlayer()->GetGroup())
GetPlayer()->GetGroup()->BroadcastPacket(&data, false);
else
SendPacket(&data);
}
void WorldSession::HandleGroupDisbandOpcode(WorldPacket& /*recvData*/)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_DISBAND");