本文整理汇总了C++中IPlayer::Destroy方法的典型用法代码示例。如果您正苦于以下问题:C++ IPlayer::Destroy方法的具体用法?C++ IPlayer::Destroy怎么用?C++ IPlayer::Destroy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPlayer
的用法示例。
在下文中一共展示了IPlayer::Destroy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _PlayerEventNotify
void CPlayerManager::_PlayerEventNotify( const unsigned long &ulnID,
const unsigned long &ulnEventType )
{
CCriticalSection::Owner locker( m_csUsedClientList );
switch( ulnEventType )
{
case enumClientConnectCreate:
m_usedClientNode.push_back( ulnID );
break;
case enumClientConnectClose:
PLAYER_MAP::iterator it;
if ( m_thePlayers.end() != ( it = m_thePlayers.find( ulnID ) ) )
{
IPlayer *pPlayer = m_thePlayers[ulnID];
ASSERT( pPlayer );
pPlayer->Destroy( NULL );
}
m_usedClientNode.remove( ulnID );
break;
}
}
示例2: CleanNetwork
void CPlayerManager::CleanNetwork()
{
if ( m_pDBRoleClient )
{
m_pDBRoleClient->Shutdown();
m_pDBRoleClient->Cleanup();
SAFE_RELEASE( m_pDBRoleClient );
}
if ( m_pPlayerServer )
{
/* CCriticalSection::Owner locker( m_csUsedClientList );
LIST::iterator it;
for ( it = m_usedClientNode.begin(); it != m_usedClientNode.end(); it ++ )
{
size_t index = *it;
m_pPlayerServer->ShutdownClient( index );
}
*/
m_pPlayerServer->CloseService();
m_pPlayerServer->Cleanup();
SAFE_RELEASE( m_pPlayerServer );
}
CCriticalSection::Owner lock( m_csSystemAction );
/*
* Repeat until stack is empty
*/
while ( !m_freeClientNode.empty() )
{
m_freeClientNode.pop();
}
CCriticalSection::Owner locker( m_csUsedClientList );
m_usedClientNode.erase( m_usedClientNode.begin(), m_usedClientNode.end() );
PLAYER_MAP::iterator it;
for ( it = m_thePlayers.begin(); it != m_thePlayers.end(); it ++ )
{
IPlayer *pPlayer = ( IPlayer * )( ( *it ).second );
ASSERT( pPlayer );
pPlayer->Destroy( NULL );
SAFE_DELETE( pPlayer );
}
m_thePlayers.erase( m_thePlayers.begin(), m_thePlayers.end() );
}