当前位置: 首页>>代码示例>>C++>>正文


C++ WorldPacket::ReadBytesSeq方法代码示例

本文整理汇总了C++中WorldPacket::ReadBytesSeq方法的典型用法代码示例。如果您正苦于以下问题:C++ WorldPacket::ReadBytesSeq方法的具体用法?C++ WorldPacket::ReadBytesSeq怎么用?C++ WorldPacket::ReadBytesSeq使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WorldPacket的用法示例。


在下文中一共展示了WorldPacket::ReadBytesSeq方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: HandleRequestPartyMemberStatsOpcode

/*this procedure handles clients CMSG_REQUEST_PARTY_MEMBER_STATS request*/
void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recvData)
{
    sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_REQUEST_PARTY_MEMBER_STATS");

    ObjectGuid Guid;
    auto isFull = recvData.read<uint8>();

    uint8 bitOrder[8] = { 5, 3, 4, 1, 6, 0, 2, 7 };
    recvData.ReadBitInOrder(Guid, bitOrder);

    recvData.FlushBits();

    uint8 byteOrder[8] = { 0, 3, 1, 2, 7, 5, 4, 6 };
    recvData.ReadBytesSeq(Guid, byteOrder);

    Player* player = HashMapHolder<Player>::Find(Guid);
    if (player && player->GetGroup() != GetPlayer()->GetGroup())
        return;

    uint32 mask = GROUP_UPDATE_FLAG_STATUS;
    if (player)
    {
        mask |= GROUP_UPDATE_PLAYER;

        if (player->GetPet())
            mask |= GROUP_UPDATE_PET;
    }

    WorldPacket data;
    BuildPartyMemberStatsChangedPacket(player, &data, mask, Guid, true);
    SendPacket(&data);
}
开发者ID:Expery,项目名称:Core,代码行数:33,代码来源:GroupHandler.cpp

示例2: HandleGroupAssistantLeaderOpcode

void WorldSession::HandleGroupAssistantLeaderOpcode(WorldPacket& recvData)
{
    sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_ASSISTANT_LEADER");

    Group* group = GetPlayer()->GetGroup();
    if (!group)
        return;

    if (!group->IsLeader(GetPlayer()->GetGUID()))
        return;

    ObjectGuid guid;
    bool apply;
    uint8 unk = 0;
    recvData >> unk;
    guid[0] = recvData.ReadBit();
    guid[7] = recvData.ReadBit();
    guid[5] = recvData.ReadBit();
    guid[2] = recvData.ReadBit();
    apply = recvData.ReadBit();
    guid[3] = recvData.ReadBit();
    guid[6] = recvData.ReadBit();
    guid[4] = recvData.ReadBit();
    guid[1] = recvData.ReadBit();

    recvData.FlushBits();

    uint8 byteOrder[8] = { 6, 3, 2, 5, 7, 1, 0, 4 };
    recvData.ReadBytesSeq(guid, byteOrder);

    group->SetGroupMemberFlag(guid, apply, MEMBER_FLAG_ASSISTANT);

    group->SendUpdate();
}
开发者ID:cooler-SAI,项目名称:PandaFire,代码行数:34,代码来源:GroupHandler.cpp

示例3: HandleLootMethodOpcode

void WorldSession::HandleLootMethodOpcode(WorldPacket & recvData)
{
    sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_LOOT_METHOD");

    uint8 lootMethod;
    ObjectGuid lootMaster;
    uint32 lootThreshold;

    recvData >> lootThreshold;
    recvData >> lootMethod;
    recvData.read_skip<uint32>();

    uint8 bitOrder[8] = { 7, 1, 2, 0, 4, 5, 6, 3 };
    recvData.ReadBitInOrder(lootMaster, bitOrder);

    uint8 byteOrder[8] = { 7, 1, 3, 4, 6, 5, 0, 2 };
    recvData.ReadBytesSeq(lootMaster, byteOrder);

    Group* group = GetPlayer()->GetGroup();
    if (!group)
        return;

    /** error handling **/
    if (!group->IsLeader(GetPlayer()->GetGUID()))
        return;
    /********************/

    // everything's fine, do it
    group->SetLootMethod((LootMethod)lootMethod);
    group->SetLooterGuid(lootMaster);
    group->SetLootThreshold((ItemQualities)lootThreshold);
    group->SendUpdate();
}
开发者ID:cooler-SAI,项目名称:PandaFire,代码行数:33,代码来源:GroupHandler.cpp

示例4: HandleLootRoll

void WorldSession::HandleLootRoll(WorldPacket& recvData)
{
    ObjectGuid guid;
    uint8 itemSlot;
    uint8  rollType;

    recvData >> itemSlot; //always 0
    recvData >> rollType;              // 0: pass, 1: need, 2: greed

    uint8 bitOrder[8] = {4, 5, 3, 2, 6, 1, 0, 7};
    recvData.ReadBitInOrder(guid, bitOrder);

    uint8 byteOrder[8] = {5, 6, 1, 3, 2, 4, 7, 0};
    recvData.ReadBytesSeq(guid, byteOrder);

    Group* group = GetPlayer()->GetGroup();
    if (!group)
        return;

    group->CountRollVote(GetPlayer()->GetGUID(), itemSlot, rollType);

    switch (rollType)
    {
    case ROLL_NEED:
        GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED, 1);
        break;
    case ROLL_GREED:
        GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED, 1);
        break;
    }
}
开发者ID:cooler-SAI,项目名称:PandaFire,代码行数:31,代码来源:GroupHandler.cpp

示例5: HandlePetitionDeclineOpcode

void WorldSession::HandlePetitionDeclineOpcode(WorldPacket& recvData)
{
    sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_DECLINE");

    ObjectGuid petitionGuid;

    uint8 bitsOrder[8] = { 1, 4, 6, 7, 3, 2, 0, 5 };
    recvData.ReadBitInOrder(petitionGuid, bitsOrder);

    recvData.FlushBits();

    uint8 bytesOrder[8] = { 5, 3, 4, 6, 0, 7, 2, 1 };
    recvData.ReadBytesSeq(petitionGuid, bytesOrder);

    sLog->outDebug(LOG_FILTER_NETWORKIO, "Petition %u declined by %u", GUID_LOPART(petitionGuid), _player->GetGUIDLow());

    PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION);
    stmt->setUInt32(0, GUID_LOPART(petitionGuid));
    PreparedQueryResult result = CharacterDatabase.Query(stmt);

    if (!result)
        return;

    Field* fields = result->Fetch();
    ObjectGuid ownerGuid = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER);

    Player* owner = ObjectAccessor::FindPlayer(ownerGuid);
    if (owner)
        owner->GetSession()->SendPetitionSignResult(ownerGuid, petitionGuid, PETITION_SIGN_DECLINED);
}
开发者ID:Expery,项目名称:Core,代码行数:30,代码来源:PetitionsHandler.cpp

示例6: HandleActivateTaxiOpcode

void WorldSession::HandleActivateTaxiOpcode(WorldPacket& recvData)
{
    sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXI");

    ObjectGuid guid;
    std::vector<uint32> nodes;
    nodes.resize(2);

    recvData >> nodes[0] >> nodes[1];

    uint8 bitsOrder[8] = { 3, 6, 0, 7, 4, 1, 5, 2 };
    recvData.ReadBitInOrder(guid, bitsOrder);

    recvData.FlushBits();

    uint8 bytesOrder[8] = { 3, 0, 4, 5, 7, 1, 6, 2 };
    recvData.ReadBytesSeq(guid, bytesOrder);

    sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXI from %d to %d", nodes[0], nodes[1]);

    Creature* npc = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER);
    if (!npc)
    {
        sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleActivateTaxiOpcode - Unit (GUID: %u) not found or you can't interact with it.", uint32(GUID_LOPART(guid)));
        return;
    }

    GetPlayer()->ActivateTaxiPathTo(nodes, npc);
}
开发者ID:Expery,项目名称:Core,代码行数:29,代码来源:TaxiHandler.cpp

示例7: HandleBfQueueInviteResponse

//Send by client when he click on accept for queue
void WorldSession::HandleBfQueueInviteResponse(WorldPacket& recvData)
{
    uint8 accepted;
    ObjectGuid guid;

    uint8 bitOrder[8] = {4, 7, 6, 1, 2, 5, 0, 3};
    recvData.ReadBitInOrder(guid, bitOrder);

    accepted = recvData.ReadBit();
    
    recvData.FlushBits();

    uint8 byteOrder[8] = {6, 4, 0, 1, 5, 7, 3, 2};
    recvData.ReadBytesSeq(guid, byteOrder);

    sLog->outError(LOG_FILTER_GENERAL, "HandleQueueInviteResponse: GUID:" UI64FMTD " Accepted:%u", (uint64)guid, accepted);

    if (!accepted)
        return;

    Battlefield* bf = sBattlefieldMgr->GetBattlefieldByGUID(guid);
    if (!bf)
        return;
    
    bf->PlayerAcceptInviteToQueue(_player);
}
开发者ID:Expery,项目名称:Core,代码行数:27,代码来源:BattlefieldHandler.cpp

示例8: HandleBfEntryInviteResponse

//Send by client on clicking in accept or refuse of invitation windows for join game
void WorldSession::HandleBfEntryInviteResponse(WorldPacket& recvData)
{
    uint8 accepted;
    ObjectGuid guid;

    guid[1] = recvData.ReadBit();
    guid[3] = recvData.ReadBit();
    guid[7] = recvData.ReadBit();
    guid[6] = recvData.ReadBit();
    guid[4] = recvData.ReadBit();
    guid[2] = recvData.ReadBit();

    accepted = recvData.ReadBit();

    guid[5] = recvData.ReadBit();
    guid[0] = recvData.ReadBit();

    recvData.FlushBits();

    uint8 byteOrder[8] = {3, 2, 4, 0, 5, 7, 6, 1};
    recvData.ReadBytesSeq(guid, byteOrder);

    sLog->outError(LOG_FILTER_GENERAL, "HandleBattlefieldInviteResponse: GUID:" UI64FMTD " Accepted:%u", uint64(guid), accepted);

    Battlefield* bf = sBattlefieldMgr->GetBattlefieldByGUID(guid);
    if (!bf)
        return;

    if (accepted)
        bf->PlayerAcceptInviteToWar(_player);
    else
        if (_player->GetZoneId() == bf->GetZoneId())
            bf->KickPlayerFromBattlefield(_player->GetGUID());
}
开发者ID:Expery,项目名称:Core,代码行数:35,代码来源:BattlefieldHandler.cpp

示例9: HandleBfQueueRequest

void WorldSession::HandleBfQueueRequest(WorldPacket& recvData)
{
    ObjectGuid guid;

    uint8 bitOrder[8] = {3, 5, 7, 0, 6, 2, 1, 4};
    recvData.ReadBitInOrder(guid, bitOrder);

    recvData.FlushBits();

    uint8 byteOrder[8] = {1, 0, 3, 2, 4, 7, 5, 6};
    recvData.ReadBytesSeq(guid, byteOrder);

    sLog->outError(LOG_FILTER_GENERAL, "HandleBfQueueRequest: GUID:" UI64FMTD " ", (uint64)guid);

    if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldByGUID(guid))
    {
        if (bf->IsWarTime())
            bf->InvitePlayerToWar(_player);
        else
        {
            uint32 timer = bf->GetTimer() / 1000;
            if (timer < 15 * MINUTE)
                bf->InvitePlayerToQueue(_player);
        }
    }
}
开发者ID:Expery,项目名称:Core,代码行数:26,代码来源:BattlefieldHandler.cpp

示例10: HandleSummonResponseOpcode

void WorldSession::HandleSummonResponseOpcode(WorldPacket& recvData)
{
    if (!_player->isAlive() || _player->isInCombat())
        return;

    ObjectGuid summonerGuid;
    bool agree;

    summonerGuid[4] = recvData.ReadBit();
    summonerGuid[1] = recvData.ReadBit();
    summonerGuid[5] = recvData.ReadBit();
    summonerGuid[6] = recvData.ReadBit();
    summonerGuid[2] = recvData.ReadBit();
    agree = recvData.ReadBit();
    summonerGuid[0] = recvData.ReadBit();
    summonerGuid[3] = recvData.ReadBit();
    summonerGuid[7] = recvData.ReadBit();

    recvData.FlushBits();

    uint8 bytesOrder[8] = { 3, 7, 1, 2, 0, 5, 4, 6 };
    recvData.ReadBytesSeq(summonerGuid, bytesOrder);

    _player->SummonIfPossible(agree);
}
开发者ID:Expery,项目名称:Core,代码行数:25,代码来源:MovementHandler.cpp

示例11: HandleMoveTeleportAck

void WorldSession::HandleMoveTeleportAck(WorldPacket& recvPacket)
{
    sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_MOVE_TELEPORT_ACK");

    ObjectGuid guid;
    uint32 flags, time;
    recvPacket >> flags >> time;

    uint8 bitOrder[8] = {0, 7, 6, 2, 5, 1, 4, 3};
    recvPacket.ReadBitInOrder(guid, bitOrder);

    uint8 byteOrder[8] = {5, 4, 0, 1, 3, 7, 6, 2};
    recvPacket.ReadBytesSeq(guid, byteOrder);

    sLog->outDebug(LOG_FILTER_NETWORKIO, "Guid " UI64FMTD, uint64(guid));
    sLog->outDebug(LOG_FILTER_NETWORKIO, "Flags %u, time %u", flags, time/IN_MILLISECONDS);

    Player* plMover = _player->m_mover->ToPlayer();

    if (!plMover || !plMover->IsBeingTeleportedNear())
        return;

    if (guid != plMover->GetGUID())
        return;

    plMover->SetSemaphoreTeleportNear(false);
    plMover->SetIgnoreMovementCount(5);

    uint32 old_zone = plMover->GetZoneId();

    WorldLocation const& dest = plMover->GetTeleportDest();

    plMover->UpdatePosition(dest, true);

    uint32 newzone, newarea;
    plMover->GetZoneAndAreaId(newzone, newarea);
    plMover->UpdateZone(newzone, newarea);

    // new zone
    if (old_zone != newzone)
    {
        // honorless target
        if (plMover->pvpInfo.inHostileArea)
            plMover->CastSpell(plMover, 2479, true);

        // in friendly area
        else if (plMover->IsPvP() && !plMover->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP))
            plMover->UpdatePvP(false, false);
    }

    // resummon pet
    plMover->ResummonPetTemporaryUnSummonedIfAny();

    //lets process all delayed operations on successful teleport
    plMover->ProcessDelayedOperations();
}
开发者ID:Expery,项目名称:Core,代码行数:56,代码来源:MovementHandler.cpp

示例12: HandlePartyAssignmentOpcode

void WorldSession::HandlePartyAssignmentOpcode(WorldPacket& recvData)
{
    sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_ASSIGNMENT");

    Group* group = GetPlayer()->GetGroup();
    if (!group)
        return;

    uint64 senderGuid = GetPlayer()->GetGUID();
    if (!group->IsLeader(senderGuid) && !group->IsAssistant(senderGuid) && !(group->GetGroupType() & GROUPTYPE_EVERYONE_IS_ASSISTANT))
        return;

    uint8 assignment;
    bool apply;
    ObjectGuid guid;

    recvData >> assignment;

    recvData.read_skip<uint8>(); // Unknown.

    guid[0] = recvData.ReadBit();
    guid[5] = recvData.ReadBit();
    guid[6] = recvData.ReadBit();
    guid[7] = recvData.ReadBit();
    guid[3] = recvData.ReadBit();
    guid[1] = recvData.ReadBit();
    guid[2] = recvData.ReadBit();

    apply = recvData.ReadBit();

    guid[4] = recvData.ReadBit();

    recvData.FlushBits();

    uint8 byteOrder[8] = { 4, 3, 1, 5, 2, 6, 7, 0 };
    recvData.ReadBytesSeq(guid, byteOrder);

    switch (assignment)
    {
        case GROUP_ASSIGN_MAINASSIST:
            group->RemoveUniqueGroupMemberFlag(MEMBER_FLAG_MAINASSIST);
            group->SetGroupMemberFlag(guid, apply, MEMBER_FLAG_MAINASSIST);
            break;

        case GROUP_ASSIGN_MAINTANK:
            group->RemoveUniqueGroupMemberFlag(MEMBER_FLAG_MAINTANK);           // Remove main assist flag from current if any.
            group->SetGroupMemberFlag(guid, apply, MEMBER_FLAG_MAINTANK);
            break;

        default: break;
    }

    group->SendUpdate();
}
开发者ID:Expery,项目名称:Core,代码行数:54,代码来源:GroupHandler.cpp

示例13: HandleLootMasterAskForRoll

void WorldSession::HandleLootMasterAskForRoll(WorldPacket& recvData)
{
    ObjectGuid guid = 0;
    uint8 slot = 0;

    recvData >> slot;

    uint8 bitOrder[8] = {4, 3, 7, 6, 5, 1, 0, 2};
    recvData.ReadBitInOrder(guid, bitOrder);

    uint8 byteOrder[8] = {4, 1, 0, 2, 5, 6, 7, 3};
    recvData.ReadBytesSeq(guid, byteOrder);

    if (!_player->GetGroup() || _player->GetGroup()->GetLooterGuid() != _player->GetGUID())
    {
        _player->SendLootRelease(GetPlayer()->GetLootGUID());
        return;
    }

    Loot* loot = NULL;

    if (IS_CRE_OR_VEH_GUID(GetPlayer()->GetLootGUID()))
    {
        Creature* creature = GetPlayer()->GetMap()->GetCreature(guid);
        if (!creature)
            return;

        loot = &creature->loot;
    }
    else if (IS_GAMEOBJECT_GUID(GetPlayer()->GetLootGUID()))
    {
        GameObject* pGO = GetPlayer()->GetMap()->GetGameObject(guid);
        if (!pGO)
            return;

        loot = &pGO->loot;
    }

    if (!loot || loot->alreadyAskedForRoll)
        return;

    if (slot >= loot->items.size() + loot->quest_items.size())
    {
        sLog->outDebug(LOG_FILTER_LOOT, "MasterLootItem: Player %s might be using a hack! (slot %d, size %lu)", GetPlayer()->GetName(), slot, (unsigned long)loot->items.size());
        return;
    }

    LootItem& item = slot >= loot->items.size() ? loot->quest_items[slot - loot->items.size()] : loot->items[slot];

    loot->alreadyAskedForRoll = true;

    _player->GetGroup()->DoRollForAllMembers(guid, slot, _player->GetMapId(), loot, item, _player);
}
开发者ID:CATACLYSMDEV,项目名称:JadeCore-5.4.8-18291--dev-,代码行数:53,代码来源:LootHandler.cpp

示例14: HandleGuildRemoveOpcode

void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket)
{
    sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_REMOVE");

    ObjectGuid playerGuid;

    uint8 bitOrder[8] = {5, 0, 7, 2, 6, 3, 4, 1};
    recvPacket.ReadBitInOrder(playerGuid, bitOrder);

    uint8 byteOrder[8] = {1, 4, 2, 5, 0, 7, 6, 3};
    recvPacket.ReadBytesSeq(playerGuid, byteOrder);

    if (Guild* guild = _GetPlayerGuild(this, true))
        guild->HandleRemoveMember(this, playerGuid);
}
开发者ID:3DViking,项目名称:MistCore,代码行数:15,代码来源:GuildHandler.cpp

示例15: HandleGuildDemoteOpcode

void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket)
{
    sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_DEMOTE");

    ObjectGuid targetGuid;

    uint8 bitOrder[8] = {7, 1, 5, 6, 2, 3, 0, 4};
    recvPacket.ReadBitInOrder(targetGuid, bitOrder);

    uint8 byteOrder[8] = {1, 2, 7, 5, 6, 0, 4, 3};
    recvPacket.ReadBytesSeq(targetGuid, byteOrder);

    if (Guild* guild = _GetPlayerGuild(this, true))
        guild->HandleUpdateMemberRank(this, targetGuid, 0);
}
开发者ID:3DViking,项目名称:MistCore,代码行数:15,代码来源:GuildHandler.cpp


注:本文中的WorldPacket::ReadBytesSeq方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。