本文整理汇总了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.");
}
示例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);
}
}
}