示例#1
0
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
0
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
0
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
0
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]);
        data.WriteByteSeq(grpGUID[7]);

        data << uint8(checkCompleted);

        data.WriteByteSeq(grpGUID[0]);
        data.WriteByteSeq(grpGUID[3]);
        data.WriteByteSeq(grpGUID[6]);
        data.WriteByteSeq(grpGUID[5]);
        data.WriteByteSeq(grpGUID[2]);
        data.WriteByteSeq(grpGUID[1]);

        group->BroadcastPacket(&data, true);
    }
}