本文整理汇总了C++中Group::BroadcastReadyCheck方法的典型用法代码示例。如果您正苦于以下问题:C++ Group::BroadcastReadyCheck方法的具体用法?C++ Group::BroadcastReadyCheck怎么用?C++ Group::BroadcastReadyCheck使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Group
的用法示例。
在下文中一共展示了Group::BroadcastReadyCheck方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleRaidReadyCheckOpcode
void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket& recvData)
{
TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RAID_READY_CHECK");
Group* group = GetPlayer()->GetGroup();
if (!group)
return;
if (recvData.empty()) // request
{
/** error handling **/
if (!group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID()))
return;
/********************/
// everything's fine, do it
WorldPacket data(MSG_RAID_READY_CHECK, 8);
data << GetPlayer()->GetGUID();
group->BroadcastPacket(&data, false, -1);
group->OfflineReadyCheck();
}
else // answer
{
uint8 state;
recvData >> state;
// everything's fine, do it
WorldPacket data(MSG_RAID_READY_CHECK_CONFIRM, 9);
data << uint64(GetPlayer()->GetGUID());
data << uint8(state);
group->BroadcastReadyCheck(&data);
}
}
示例2: HandleRaidReadyCheckOpcode
void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket& recv_data)
{
Group* group = GetPlayer()->GetGroup();
if (!group)
return;
if (recv_data.empty()) // request
{
/** error handling **/
if (!group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID()))
return;
/********************/
// everything is fine, do it
WorldPacket data(MSG_RAID_READY_CHECK, 8);
data << GetPlayer()->GetGUID();
group->BroadcastPacket(&data, false, -1);
group->OfflineReadyCheck();
}
else // answer
{
uint8 state;
recv_data >> state;
// everything is fine, do it
WorldPacket data(MSG_RAID_READY_CHECK_CONFIRM, 9);
data << GetPlayer()->GetGUID();
data << state;
group->BroadcastReadyCheck(&data);
}
}
示例3: HandleRaidReadyCheckOpcode
void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket& recv_data)
{
if (recv_data.empty()) // request
{
Group* group = GetPlayer()->GetGroup();
if (!group)
return;
/** error handling **/
if (!group->IsLeader(GetPlayer()->GetObjectGuid()) &&
!group->IsAssistant(GetPlayer()->GetObjectGuid()))
return;
/********************/
// everything is fine, do it
WorldPacket data(SMSG_READY_CHECK_STARTED, 8);
data << ObjectGuid(GetPlayer()->GetObjectGuid());
group->BroadcastPacket(&data, false, -1);
group->OfflineReadyCheck();
}
else // answer
{
uint8 state;
recv_data >> state;
Group* group = GetPlayer()->GetGroup();
if (!group)
return;
// everything is fine, do it
WorldPacket data(SMSG_READY_CHECK_COMPLETED, 9);
data << GetPlayer()->GetObjectGuid();
data << uint8(state);
group->BroadcastReadyCheck(&data);
}
}
示例4: HandleRaidConfirmReadyCheck
void WorldSession::HandleRaidConfirmReadyCheck(WorldPacket& recvData)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_RAID_CONFIRM_READY_CHECK");
Group* group = GetPlayer()->GetGroup();
if (!group)
return;
recvData.read_skip<uint8>(); // unk, 0x00
bool ready = recvData.ReadBit();
// ========== Unknown guid reading here - probably for group guid ? ========
ObjectGuid unknownGuid;
unknownGuid[0] = recvData.ReadBit();
unknownGuid[6] = recvData.ReadBit();
unknownGuid[5] = recvData.ReadBit();
unknownGuid[2] = recvData.ReadBit();
unknownGuid[4] = recvData.ReadBit();
unknownGuid[7] = recvData.ReadBit();
unknownGuid[3] = recvData.ReadBit();
unknownGuid[1] = recvData.ReadBit();
recvData.FlushBits();
recvData.ReadByteSeq(unknownGuid[2]);
recvData.ReadByteSeq(unknownGuid[0]);
recvData.ReadByteSeq(unknownGuid[7]);
recvData.ReadByteSeq(unknownGuid[6]);
recvData.ReadByteSeq(unknownGuid[5]);
recvData.ReadByteSeq(unknownGuid[3]);
recvData.ReadByteSeq(unknownGuid[1]);
recvData.ReadByteSeq(unknownGuid[4]);
// =========================================================================
ObjectGuid playerGuid = GetPlayer()->GetGUID();
ObjectGuid groupGuid = group->GetGUID();
// Confirmed the check, increase the count.
group->SetReadyCheckCount(group->GetReadyCheckCount() + 1);
WorldPacket data(SMSG_RAID_READY_CHECK_RESPONSE, 1 + 1 + 8 + 1 + 8);
data.WriteBit(groupGuid[0]);
data.WriteBit(groupGuid[2]);
data.WriteBit(ready);
data.WriteBit(playerGuid[7]);
data.WriteBit(playerGuid[6]);
data.WriteBit(playerGuid[2]);
data.WriteBit(groupGuid[4]);
data.WriteBit(groupGuid[3]);
data.WriteBit(groupGuid[5]);
data.WriteBit(playerGuid[3]);
data.WriteBit(groupGuid[7]);
data.WriteBit(playerGuid[5]);
data.WriteBit(groupGuid[6]);
data.WriteBit(groupGuid[1]);
data.WriteBit(playerGuid[0]);
data.WriteBit(playerGuid[1]);
data.WriteBit(playerGuid[4]);
data.FlushBits();
data.WriteByteSeq(playerGuid[1]);
data.WriteByteSeq(groupGuid[5]);
data.WriteByteSeq(playerGuid[2]);
data.WriteByteSeq(groupGuid[7]);
data.WriteByteSeq(groupGuid[0]);
data.WriteByteSeq(playerGuid[4]);
data.WriteByteSeq(playerGuid[3]);
data.WriteByteSeq(groupGuid[4]);
data.WriteByteSeq(playerGuid[7]);
data.WriteByteSeq(groupGuid[6]);
data.WriteByteSeq(playerGuid[5]);
data.WriteByteSeq(groupGuid[2]);
data.WriteByteSeq(groupGuid[1]);
data.WriteByteSeq(groupGuid[3]);
data.WriteByteSeq(playerGuid[0]);
data.WriteByteSeq(playerGuid[6]);
group->BroadcastReadyCheck(&data); // BroadcastPacket(&data, true);
// Send SMSG_RAID_READY_CHECK_COMPLETED if needed.
if (group->GetReadyCheckCount() >= group->GetMembersCount())
{
ObjectGuid grpGUID = group->GetGUID();
bool checkCompleted = true;
data.Initialize(SMSG_RAID_READY_CHECK_COMPLETED);
uint8 bitOrder[8] = { 1, 5, 6, 3, 2, 7, 0, 4 };
data.WriteBitInOrder(grpGUID, bitOrder);
data.FlushBits();
data.WriteByteSeq(grpGUID[4]);
//.........这里部分代码省略.........