本文整理汇总了C++中PlayerList::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerList::clear方法的具体用法?C++ PlayerList::clear怎么用?C++ PlayerList::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerList
的用法示例。
在下文中一共展示了PlayerList::clear方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RemoveOfflinePlayers
bool LfgGroup::RemoveOfflinePlayers() // Return true if group is empty after check
{
sLfgMgr.LfgLog("Remove Offline %u, premade %u", GetId(), premadePlayers.empty() ? 0 : 1);
if (m_memberSlots.empty())
{
sLfgMgr.LfgLog("Group %u add to delete", GetId());
sLfgMgr.AddGroupToDelete(this);
return true;
}
PlayerList toRemove;
for(member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
{
sLfgMgr.LfgLog("guid %u", citr->guid);
Player *plr = sObjectMgr.GetPlayer(citr->guid);
if (!plr || (!plr->GetSession() && !plr->IsBeingTeleported()) ||
(plr->GetGroup() && plr->GetGroup() != this && plr->GetGroup()->isLfgGroup() &&
((LfgGroup*)plr->GetGroup())->IsInDungeon()))
{
sLfgMgr.LfgLog("Add to remove");
toRemove.insert(citr->guid);
}
}
for(PlayerList::iterator itr = toRemove.begin(); itr != toRemove.end(); ++itr)
{
sLfgMgr.LfgLog("Check for premade %u", *itr);
PlayerList::iterator premade = premadePlayers.find(*itr);
if(premade != premadePlayers.end())
{
sLfgMgr.LfgLog("premade yes");
for(PlayerList::iterator prm = premadePlayers.begin(); prm != premadePlayers.end(); ++prm)
{
Player *plr = sObjectMgr.GetPlayer(*prm);
if(!plr || !plr->GetSession())
continue;
Group* group = plr->GetGroup();
if(group)
{
sLfgMgr.RemoveFromQueue(plr, false);
return true;
}
}
for(PlayerList::iterator prm = premadePlayers.begin(); prm != premadePlayers.end(); ++prm)
RemoveMember(*prm, 0);
}
}
for(PlayerList::iterator itr = toRemove.begin(); itr != toRemove.end(); ++itr)
{
sLfgMgr.LfgLog("Remove %u", *itr);
RemoveMember(*itr, 0);
}
toRemove.clear();
//flush empty group
if (GetMembersCount() == 0)
{
sLfgMgr.LfgLog("Group %u add to delete 2", GetId());
sLfgMgr.AddGroupToDelete(this);
return true;
}
return false;
}
示例2: stopAll
void QBSoundWin::stopAll()
{
//printf("stopAll\n");
QBSoundLocker locker(&mMutex);
#ifdef __USE_OGG_VORBIS__
{
PlayerList::iterator it = streamTrack.begin();
while(it != streamTrack.end()) {
delete (*it).second;
++it;
}
streamTrack.clear();
}
{
EffectList::iterator it = sharedList().begin();
while(it != sharedList().end())
{
delete (*it).second;
++it;
}
sharedList().clear();
}
#endif
return QBSound::stopAll();
}
示例3: streamReset
void QBSoundMac::streamReset()
{
QBSoundLocker locker(&mMutex,"streamReset");
streamTrack.clear();
// PlayerList::iterator it = streamTrack.begin();
// while(it != streamTrack.end()) {
// ++it;
// }
}
示例4: SelectRandomDungeon
bool LfgGroup::SelectRandomDungeon()
{
m_originalInfo = m_dungeonInfo;
m_lfgFlags |= LFG_GRP_RANDOM;
LfgLocksMap *groupLocks = GetLocksList();
std::vector<LFGDungeonEntry const*> options;
LFGDungeonEntry const *currentRow = NULL;
//Possible dungeons
LfgDungeonList* list = sLfgMgr.GetRandomOptions(m_dungeonInfo->ID);
for(LfgDungeonList::iterator itr = list->begin(); itr != list->end(); ++itr)
options.push_back(*itr);
//And now get only without locks
for(LfgLocksMap::iterator itr = groupLocks->begin(); itr != groupLocks->end(); ++itr)
{
for(LfgLocksList::iterator itr2 = itr->second->begin(); itr2 != itr->second->end(); ++itr2)
{
for(std::vector<LFGDungeonEntry const*>::iterator itrDung = options.begin(); itrDung != options.end(); ++itrDung)
{
if ((*itrDung)->ID != (*itr2)->dungeonInfo->ID)
continue;
DungeonInfo* dungeonInfo = sLfgMgr.GetDungeonInfo((*itr2)->dungeonInfo->ID);
if (dungeonInfo->locked || (*itr2)->lockType != LFG_LOCKSTATUS_RAID_LOCKED)
{
options.erase(itrDung);
break;
}
}
}
}
//This should not happen
if (options.empty())
{
PlayerList toRemove;
for(member_witerator itr = m_memberSlots.begin(); itr != m_memberSlots.end(); ++itr)
{
Player *plr = sObjectMgr.GetPlayer(itr->guid);
if (!plr)
continue;
sLfgMgr.SendLfgUpdatePlayer(plr, LFG_UPDATETYPE_GROUP_DISBAND);
sLog.outError("LfgMgr: Cannot find any random dungeons for player %s", plr->GetName());
plr->GetSession()->SendNotification("Cannot find any random dungeons for this group, you have to find new group. We are sorry");
toRemove.insert(plr->GetGUID());
}
for(PlayerList::iterator itr = toRemove.begin(); itr != toRemove.end(); ++itr)
RemoveMember(*itr, 0);
toRemove.clear();
sLfgMgr.AddGroupToDelete(this);
return false;
}
//Select dungeon, there should be also bind check
uint32 tmp = time(NULL)%options.size();
m_dungeonInfo = options[tmp];
return true;
}
示例5: close_comms
void close_comms()
{
// Disconnect players
for (PlayerListIterator i = playerList.begin(); i != playerList.end(); ++i) {
if ((*i)->socket != NO_SOCKET) {
close((*i)->socket);
delete (*i);
}
}
playerList.clear();
// Disconnect irc
if (ircSocket != NO_SOCKET) {
close(ircSocket);
}
}
示例6: stopAll
void QBSoundMac::stopAll()
{
QBSoundLocker locker(&mMutex,"stopAll");
#ifdef __USE_OGG_VORBIS__
{
PlayerList::iterator it = streamTrack.begin();
while(it != streamTrack.end()) {
delete (*it).second;
++it;
}
streamTrack.clear();
}
{
EffectList::iterator it = effectTrack.begin();
while(it != effectTrack.end())
{
delete (*it).second;
++it;
}
effectTrack.clear();
}
#endif
return QBSound::stopAll();
}
示例7: streamReset
void QBSoundWin::streamReset()
{
QBSoundLocker locker(&mMutex,"streamReset");
streamTrack.clear();
}