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


C++ Group::CalculateLFGRoles方法代码示例

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


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

示例1: AddToQueue

// Add group or player into queue. If player has group and he's a leader then whole party will be added to queue.
void LFGQueue::AddToQueue(Player* leader, uint32 queAreaID)
{
    if(!leader)
        return;

    if (AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(queAreaID))
    {
        if (DisableMgr::IsDisabledFor(DISABLE_TYPE_MAP, areaEntry->mapid))
        {
            ChatHandler(leader->GetSession()).SendSysMessage(LANG_MAP_IS_DISABLED);
            return;
        }
    }

    Group* grp = leader->GetGroup();

    //add players from group to queue list & group to group list
    // Calculate what roles group need and add it to the GroupQueueList, (DONT'ADD PLAYERS!)
    if (grp && grp->IsLeader(leader->GetObjectGuid()))
    {
        // Add group to queued groups list
        LFGGroupQueueInfo& i_Group = m_QueuedGroups[grp->GetId()];

        grp->CalculateLFGRoles(i_Group);
       i_Group.team = leader->GetTeam();
        i_Group.areaId = queAreaID;
        i_Group.groupTimer = 5 * MINUTE * IN_MILLISECONDS; // Minute timer for SMSG_MEETINGSTONE_IN_PROGRESS

        grp->SetLFGAreaId(queAreaID);

        WorldPacket data;
        BuildSetQueuePacket(data, queAreaID, MEETINGSTONE_STATUS_JOINED_QUEUE);

        grp->BroadcastPacket(&data, true);
    }
    else if(!grp)
    {
        // Add player to queued players list
        LFGPlayerQueueInfo& i_Player = m_QueuedPlayers[leader->GetObjectGuid()];

        i_Player.roleMask = CalculateRoles((Classes)leader->getClass());
       i_Player.team = leader->GetTeam();
        i_Player.areaId = queAreaID;
        i_Player.hasQueuePriority = false;

        leader->GetSession()->SendMeetingstoneSetqueue(queAreaID, MEETINGSTONE_STATUS_JOINED_QUEUE);
    }
    else                                                    // Player is in group, but it's not leader
        MANGOS_ASSERT(false && "LFGQueue::AddToQueue called while player is not leader and in group.");
}
开发者ID:billy1arm,项目名称:MangosMC,代码行数:51,代码来源:LFGMgr.cpp

示例2: UpdateGroup

void LFGQueue::UpdateGroup(uint32 groupId)
{
    QueuedGroupsMap::iterator qGroup = m_QueuedGroups.find(groupId);

    if(qGroup != m_QueuedGroups.end())
    {
        Group* grp = sObjectMgr.GetGroupById(qGroup->first);

        if(grp)
        {
            grp->CalculateLFGRoles(qGroup->second);
        }

    }
}
开发者ID:billy1arm,项目名称:MangosMC,代码行数:15,代码来源:LFGMgr.cpp


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