本文整理汇总了C++中SubGroup::RemovePlayer方法的典型用法代码示例。如果您正苦于以下问题:C++ SubGroup::RemovePlayer方法的具体用法?C++ SubGroup::RemovePlayer怎么用?C++ SubGroup::RemovePlayer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SubGroup
的用法示例。
在下文中一共展示了SubGroup::RemovePlayer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MovePlayer
void Group::MovePlayer(Player *pPlayer, uint8 subgroup)
{
ASSERT(subgroup < m_SubGroupCount);
SubGroup *sgr = GetSubGroup(pPlayer->GetSubGroup());
sgr->RemovePlayer(pPlayer);
// Grab the new group, and insert
sgr = m_SubGroups[subgroup];
sgr->AddPlayer(pPlayer);
Update();
}
示例2: MovePlayer
void Group::MovePlayer(PlayerInfo *info, uint8 subgroup)
{
if( subgroup >= m_SubGroupCount )
return;
if( m_SubGroups[subgroup]->IsFull() )
return;
m_groupLock.Acquire();
SubGroup *sg = NULL;
if( info->subGroup > 0 && info->subGroup <= 8 )
sg = m_SubGroups[info->subGroup];
if( sg == NULL || sg->m_GroupMembers.find(info) == sg->m_GroupMembers.end() )
{
for( uint8 i = 0; i < m_SubGroupCount; ++i )
{
if( m_SubGroups[i] != NULL )
{
if( m_SubGroups[i]->m_GroupMembers.find(info) != m_SubGroups[i]->m_GroupMembers.end() )
{
sg = m_SubGroups[i];
break;
}
}
}
}
if( sg == NULL )
{
m_groupLock.Release();
return;
}
sg->RemovePlayer( info );
// Grab the new group, and insert
sg = m_SubGroups[subgroup];
if( !sg->AddPlayer( info ) )
{
RemovePlayer( info );
}
else
{
info->subGroup = (int8)sg->GetID();
}
Update();
m_groupLock.Release();
}
示例3: RemovePlayer
void Group::RemovePlayer(Player* pPlayer)
{
WorldPacket data;
SubGroup *sg = GetSubGroup(pPlayer->GetSubGroup());
ASSERT(sg); // something wrong here if that isn't right
sg->RemovePlayer(pPlayer);
pPlayer->SetGroup(NULL);
if(pPlayer->GetSession() != NULL)
{
SendNullUpdate(pPlayer);
//pPlayer->RemoveAllAreaAuras();
data.SetOpcode(SMSG_GROUP_DESTROYED);
pPlayer->GetSession()->SendPacket(&data);
data.Initialize(SMSG_PARTY_COMMAND_RESULT);
data << uint32(2) << uint8(0) << uint32(0); // you leave the group
pPlayer->GetSession()->SendPacket(&data);
}
if(m_MemberCount < 2)
{
Disband();
return;
}
Player *newPlayer = FindFirstPlayer();
if(m_Looter == pPlayer)
m_Looter = newPlayer;
if(m_Leader == pPlayer)
SetLeader(newPlayer);
else
Update();
}
示例4: RemovePlayer
void Group::RemovePlayer(PlayerInfo * info)
{
WorldPacket data(50);
Player * pPlayer = info->m_loggedInPlayer;
m_groupLock.Acquire();
if(m_isqueued)
{
m_isqueued = false;
BattlegroundManager.RemoveGroupFromQueues(this);
}
SubGroup *sg = NULL;
if( info->subGroup >= 0 && info->subGroup <= 8 )
sg = m_SubGroups[info->subGroup];
if( sg == NULL || sg->m_GroupMembers.find(info) == sg->m_GroupMembers.end() )
{
for( uint8 i = 0; i < m_SubGroupCount; ++i )
{
if( m_SubGroups[i] != NULL )
{
if( m_SubGroups[i]->m_GroupMembers.find(info) != m_SubGroups[i]->m_GroupMembers.end() )
{
sg = m_SubGroups[i];
break;
}
}
}
}
info->m_Group = NULL;
info->subGroup = -1;
if(sg == NULL)
{
m_groupLock.Release();
return;
}
m_dirty = true;
sg->RemovePlayer( info );
--m_MemberCount;
// remove team member from the instance
if( info->m_loggedInPlayer != NULL )
{
sInstanceMgr.PlayerLeftGroup( this, info->m_loggedInPlayer );
}
if( pPlayer != NULL )
{
if( pPlayer->GetSession() != NULL )
{
SendNullUpdate( pPlayer );
data.SetOpcode( SMSG_GROUP_DESTROYED );
pPlayer->GetSession()->SendPacket( &data );
data.Initialize( SMSG_PARTY_COMMAND_RESULT );
data << uint32(2) << uint8(0) << uint32(0); // you leave the group
pPlayer->GetSession()->SendPacket( &data );
}
//Remove some party auras.
for (uint32 i=MAX_POSITIVE_AURAS_EXTEDED_START;i<MAX_POSITIVE_AURAS_EXTEDED_END;i++)
{
if (pPlayer->m_auras[i] && pPlayer->m_auras[i]->m_areaAura)
{
Player * caster = pPlayer->m_auras[i]->GetPlayerCaster();
if( caster != NULL && pPlayer->GetLowGUID() != caster->GetLowGUID() )
pPlayer->m_auras[i]->Remove();
}
}
}
if( m_MemberCount < 2 )
{
if( m_disbandOnNoMembers )
{
m_groupLock.Release();
Disband();
return;
}
}
/* eek! ;P */
Player *newPlayer = NULL;
if(m_Looter == info)
{
newPlayer = FindFirstPlayer();
if( newPlayer != NULL )
m_Looter = newPlayer->getPlayerInfo();
else
m_Looter = NULL;
}
if(m_Leader == info)
{
if( newPlayer== NULL )
//.........这里部分代码省略.........