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


C++ MembershipRequest::GetClass方法代码示例

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


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

示例1: HandleGuildFinderGetRecruits

// Lists all recruits for a guild - Misses times
void WorldSession::HandleGuildFinderGetRecruits(WorldPacket& recvPacket)
{
    sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_LF_GUILD_GET_RECRUITS");

    uint32 unkTime = 0;
    //recvPacket >> unkTime;

    Player* player = GetPlayer();
    if (!player->GetGuildId())
        return;

    std::vector<MembershipRequest> recruitsList = sGuildFinderMgr->GetAllMembershipRequestsForGuild(player->GetGuildId());
    uint32 recruitCount = recruitsList.size();

    ByteBuffer dataBuffer(53 * recruitCount);
    WorldPacket data(SMSG_LF_GUILD_RECRUIT_LIST_UPDATED, 7 + 26 * recruitCount + 53 * recruitCount);
    data.WriteBits(recruitCount, 20);

    for (std::vector<MembershipRequest>::const_iterator itr = recruitsList.begin(); itr != recruitsList.end(); ++itr)
    {
        MembershipRequest request = *itr;
        ObjectGuid playerGuid(MAKE_NEW_GUID(request.GetPlayerGUID(), 0, HIGHGUID_PLAYER));
        
        data.WriteBit(playerGuid[1]);
        data.WriteBit(playerGuid[4]);
        data.WriteBit(playerGuid[2]);
        data.WriteBit(playerGuid[6]);
        data.WriteBits(request.GetName().size(), 7);
        data.WriteBit(playerGuid[3]);
        data.WriteBit(playerGuid[7]);
        data.WriteBit(playerGuid[5]);
        data.WriteBits(request.GetComment().size(), 11);
        data.WriteBit(playerGuid[0]);
        
        dataBuffer << int32(request.GetAvailability());
        dataBuffer.WriteByteSeq(playerGuid[1]);
        dataBuffer << int32(time(NULL) <= request.GetExpiryTime());
        dataBuffer << int32(request.GetInterests());
        dataBuffer << int32(request.GetClassRoles());
        dataBuffer << int32(time(NULL) - request.GetSubmitTime()); // Time in seconds since application submitted.
        dataBuffer.WriteString(request.GetName());
        dataBuffer.WriteByteSeq(playerGuid[4]);
        dataBuffer.WriteByteSeq(playerGuid[6]);
        dataBuffer.WriteByteSeq(playerGuid[3]);
        dataBuffer.WriteByteSeq(playerGuid[7]);
        dataBuffer.WriteString(request.GetComment());
        dataBuffer << int32(request.GetLevel());
        dataBuffer << int32(request.GetExpiryTime() - time(NULL)); // TIme in seconds until application expires.
        dataBuffer.WriteByteSeq(playerGuid[2]);
        dataBuffer.WriteByteSeq(playerGuid[0]);
        dataBuffer << int32(request.GetClass());
        dataBuffer.WriteByteSeq(playerGuid[5]);
    }

    data.FlushBits();
    data.append(dataBuffer);
    data << uint32(time(NULL)); // Unk time

    player->SendDirectMessage(&data);
}
开发者ID:cooler-SAI,项目名称:PandaFire,代码行数:61,代码来源:GuildFinderHandler.cpp


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