当前位置: 首页>>代码示例>>C++>>正文


C++ IPlayer::Destroy方法代码示例

本文整理汇总了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;
	}
}
开发者ID:XeanoRRR,项目名称:mmo-resourse,代码行数:31,代码来源:PlayerManager.cpp

示例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() );
}
开发者ID:XeanoRRR,项目名称:mmo-resourse,代码行数:58,代码来源:PlayerManager.cpp


注:本文中的IPlayer::Destroy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。