本文整理汇总了C++中LfgLockPartyMap类的典型用法代码示例。如果您正苦于以下问题:C++ LfgLockPartyMap类的具体用法?C++ LfgLockPartyMap怎么用?C++ LfgLockPartyMap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LfgLockPartyMap类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetPlayer
void WorldSession::HandleLfgPartyLockInfoRequestOpcode(WorldPacket& /*recv_data*/)
{
uint64 guid = GetPlayer()->GetGUID();
sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFD_PARTY_LOCK_INFO_REQUEST [" UI64FMTD "]", guid);
Group* group = GetPlayer()->GetGroup();
if (!group)
return;
// Get the locked dungeons of the other party members
LfgLockPartyMap lockMap;
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
{
Player* plrg = itr->getSource();
if (!plrg)
continue;
uint64 pguid = plrg->GetGUID();
if (pguid == guid)
continue;
lockMap[pguid] = sLFGMgr->GetLockedDungeons(pguid);
}
uint32 size = 0;
for (LfgLockPartyMap::const_iterator it = lockMap.begin(); it != lockMap.end(); ++it)
size += 8 + 4 + uint32(it->second.size()) * (4 + 4);
sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_PARTY_INFO [" UI64FMTD "]", guid);
WorldPacket data(SMSG_LFG_PARTY_INFO, 1 + size);
BuildPartyLockDungeonBlock(data, lockMap);
SendPacket(&data);
}
示例2: HandleLfgPartyLockInfoRequestOpcode
void WorldSession::HandleLfgPartyLockInfoRequestOpcode(WorldPacket& /*recvData*/)
{
ObjectGuid guid = _player->GetObjectGuid();
sLog.outDebug("CMSG_LFG_PARTY_LOCK_INFO_REQUEST %s", guid.GetString().c_str());
Group* grp = _player->GetGroup();
if (!grp)
return;
// Get the locked dungeons of the other party members
LfgLockPartyMap lockMap;
for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
{
Player* plrg = itr->getSource();
if (!plrg)
continue;
ObjectGuid pguid = plrg->GetObjectGuid();
if (pguid == guid)
continue;
lockMap[pguid] = sLFGMgr.GetLockedDungeons(pguid);
}
uint32 size = 0;
for (LfgLockPartyMap::const_iterator it = lockMap.begin(); it != lockMap.end(); ++it)
size += 8 + 4 + uint32(it->second.size()) * (4 + 4 + 4 + 4);
sLog.outDebug("SMSG_LFG_PARTY_INFO %s", _player->GetGuidStr().c_str());
WorldPacket data(SMSG_LFG_PARTY_INFO, 1 + size);
BuildPartyLockDungeonBlock(data, lockMap);
SendPacket(&data);
}
示例3: BuildPartyLockDungeonBlock
void BuildPartyLockDungeonBlock(WorldPacket& data, const LfgLockPartyMap& lockMap)
{
data << uint8(lockMap.size());
for (LfgLockPartyMap::const_iterator it = lockMap.begin(); it != lockMap.end(); ++it)
{
data << uint64(it->first); // Player guid
BuildPlayerLockDungeonBlock(data, it->second);
}
}
示例4: BuildPartyLockDungeonBlock
void BuildPartyLockDungeonBlock(WorldPacket& data, const LfgLockPartyMap& lockMap)
{
Log.Debug("LfgHandler", "BUILD PARTY LOCK DUNGEON BLOCK");
data << uint8(lockMap.size());
for (LfgLockPartyMap::const_iterator it = lockMap.begin(); it != lockMap.end(); ++it)
{
data << uint64(it->first); // Player guid
BuildPlayerLockDungeonBlock(data, it->second);
}
}
示例5: GetPlayer
void WorldSession::HandleLfgPartyLockInfoRequestOpcode(WorldPacket& recv_data)
{
Log.Debug("LfgHandler", "CMSG_LFD_PARTY_LOCK_INFO_REQUEST");
uint64 guid = GetPlayer()->GetGUID();
Log.Debug("LfgHandler", "CMSG_LFD_PARTY_LOCK_INFO_REQUEST %u", guid);
Group* grp = GetPlayer()->GetGroup();
if (!grp)
return;
// Get the locked dungeons of the other party members
LfgLockPartyMap lockMap;
GroupMembersSet::iterator itx;
for (itx = grp->GetSubGroup(0)->GetGroupMembersBegin(); itx != grp->GetSubGroup(0)->GetGroupMembersEnd(); ++itx)
{
Player* plrg = (*itx)->m_loggedInPlayer;
if (!plrg)
continue;
uint64 pguid = plrg->GetGUID();
if (pguid == guid)
continue;
lockMap[pguid] = sLfgMgr.GetLockedDungeons(pguid);
}
uint32 size = 0;
for (LfgLockPartyMap::const_iterator it = lockMap.begin(); it != lockMap.end(); ++it)
size += 8 + 4 + uint32(it->second.size()) * (4 + 4);
Log.Debug("LfgHandler", "SMSG_LFG_PARTY_INFO %u", guid);
WorldPacket data(SMSG_LFG_PARTY_INFO, 1 + size);
BuildPartyLockDungeonBlock(data, lockMap);
SendPacket(&data);
}