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


C++ IPlayer类代码示例

本文整理汇总了C++中IPlayer的典型用法代码示例。如果您正苦于以下问题:C++ IPlayer类的具体用法?C++ IPlayer怎么用?C++ IPlayer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了IPlayer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: locker

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: TeleportTo

		void TeleportTo(Vector3* position)
		{
			IPlayer* me = GetMe();
			if (!me) return;

			Player* playerMe = me->GetPlayer();
			if (!playerMe) return;

			IActor* actorMe = me->vfptr->GetActorInterface(me);
			if (!actorMe) return;

			IUE4Actor* ue4actor = playerMe->baseclass_0.m_target;
			if (!ue4actor) return;

			World* GameWorld = GetWorldObject();
			if (!GameWorld) return;

			//auto const logMsg = boost::str(boost::format("TeleportTo(%.2f,%.2f,%.2f)")
			//	% position->x % position->y % position->z);
			//Chat(logMsg);

			Rotation rot{ 0, 0, 0 };
			ue4actor->vfptr->GetRotation(ue4actor, &rot);
			GameWorld->vfptr->SendRespawnEvent(GameWorld, me->GetPlayer(), position, &rot);
			ue4actor->vfptr->LocalRespawn(ue4actor, position, &rot);
		}
开发者ID:Vilard,项目名称:PwnAdventure3Hacks,代码行数:26,代码来源:Hacks.cpp

示例3: while

int CPlayerManager::Helper()
{
	while ( WAIT_OBJECT_0 != ::WaitForSingleObject( m_hQuitEvent, 0L ) )
	{
		/*
		 * Get data from role-database
		 */
		size_t dataLength = 0;
		const void *pData = m_pDBRoleClient->GetPackFromServer( dataLength );

		while( pData && dataLength )
		{
			KBlock *pBlock = ( KBlock * )( pData );

			UINT uID = pBlock->ulIdentity;

			if ( uID < m_theEnviroment.lnPlayerMaxCount )
			{
				IPlayer *pPlayer = m_thePlayers[uID];

				ASSERT( pPlayer );
				
				pPlayer->AppendData( pData );
			}

			pData = m_pDBRoleClient->GetPackFromServer( dataLength );
		}

		Sleep( 1 );
	}

	return 0;
}
开发者ID:XeanoRRR,项目名称:mmo-resourse,代码行数:33,代码来源:PlayerManager.cpp

示例4: main

int main()
{
	srand((unsigned)time(NULL));

	int playerLen;
	int weaponsLen;
	GET_ARRAY_LEN(s_playerType, playerLen);
	GET_ARRAY_LEN(s_weapons, weaponsLen);

	// 假设,游戏中有十位玩家
	for (int i = 0; i < 10; i++) {
		// 获取随机玩家和武器
		int typeIndex = rand() % playerLen;
		int weaponIndex = rand() % weaponsLen;
		std::string type = s_playerType[typeIndex];
		std::string weapon = s_weapons[weaponIndex];

		// 获取玩家
		IPlayer *p = PlayerFactory::getPlayer(type);

		// 从武器库中随机分配武器
		p->assignWeapon(weapon);

		// 派玩家去执行任务
		p->mission();
	}

	getchar();

	return 0;
}
开发者ID:care101,项目名称:DesignPatterns,代码行数:31,代码来源:main.cpp

示例5: UseGuards

void UseGuards( IPlayerFactory* f )
{
	IPlayer*  guard		=  f->CreatePlayer();

	guard->PrintPosition();

	delete guard;
}
开发者ID:akhalupko,项目名称:Patterns,代码行数:8,代码来源:main.cpp

示例6: SAFE_RELEASE

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

示例7: IsValidEnemy

bool Aimbot::IsValidEnemy( int entityNum )
{
	IPlayer * ent = ImportExport::Entities->GetPlayer (entityNum);
	if(ent != nullptr && ImportExport::User != nullptr && ent->IsValid())
	{
		return ent->IsEnemyOf( ImportExport::User ) && ent->Health() > 0 && ent->Weapon().Id() > 0;
	}
	return false;
}
开发者ID:blaquee,项目名称:QLBot,代码行数:9,代码来源:Aimbot.cpp

示例8: android_media_omxmediaplayer_start

JNIEXPORT void android_media_omxmediaplayer_start(JNIEnv *env, jobject thiz)
{
	PPLOGI("android_media_omxmediaplayer_start()");
	IPlayer* mp = getOMXMediaPlayer(env, thiz);
	if (mp == NULL ) {
		jniThrowException(env, "java/lang/IllegalStateException", NULL);
		return;
	}

	mp->start();
}
开发者ID:caomw,项目名称:MeetSDK,代码行数:11,代码来源:OMXMediaPlayer.cpp

示例9: android_media_omxmediaplayer_isLooping

JNIEXPORT jboolean android_media_omxmediaplayer_isLooping(JNIEnv *env, jobject thiz)
{
	PPLOGD("isLooping");
	IPlayer* mp = getOMXMediaPlayer(env, thiz);
	if (mp == NULL ) {
		jniThrowException(env, "java/lang/IllegalStateException", NULL);
		return false;
	}

	return mp->isLooping();
}
开发者ID:caomw,项目名称:MeetSDK,代码行数:11,代码来源:OMXMediaPlayer.cpp

示例10: strdup

bool CVisualisation::Create(int x, int y, int w, int h)
{
  m_pInfo = new VIS_PROPS;
  #ifdef HAS_DX
  m_pInfo->device     = g_Windowing.Get3DDevice();
#else
  m_pInfo->device     = NULL;
#endif
  m_pInfo->x = x;
  m_pInfo->y = y;
  m_pInfo->width = w;
  m_pInfo->height = h;
  m_pInfo->pixelRatio = g_settings.m_ResInfo[g_graphicsContext.GetVideoResolution()].fPixelRatio;

  m_pInfo->name = strdup(Name().c_str());
  m_pInfo->presets = strdup(CSpecialProtocol::TranslatePath(Path()).c_str());
  m_pInfo->profile = strdup(CSpecialProtocol::TranslatePath(Profile()).c_str());
  m_pInfo->submodule = NULL;

  if (CAddonDll<DllVisualisation, Visualisation, VIS_PROPS>::Create() == ADDON_STATUS_OK)
  {
    // Start the visualisation
    CStdString strFile = URIUtils::GetFileName(g_application.CurrentFile());
    CLog::Log(LOGDEBUG, "Visualisation::Start()\n");
    try
    {
      m_pStruct->Start(m_iChannels, m_iSamplesPerSec, m_iBitsPerSample, strFile);
    }
    catch (std::exception e)
    {
      HandleException(e, "m_pStruct->Start() (CVisualisation::Create)");
      return false;
    }

    GetPresets();

    if (GetSubModules())
      m_pInfo->submodule = strdup(CSpecialProtocol::TranslatePath(m_submodules.front()).c_str());
    else
      m_pInfo->submodule = NULL;

    CreateBuffers();

    {
      CSingleLock lock(*g_application.getPlayerLock());
      IPlayer *player = g_application.getPlayer();
      if (player)
        player->RegisterAudioCallback(this);
    }

    return true;
  }
  return false;
}
开发者ID:koying,项目名称:xbmc-pivos,代码行数:54,代码来源:Visualisation.cpp

示例11: PPLOGI

JNIEXPORT void JNICALL android_media_omxmediaplayer_prepareAsync
  (JNIEnv *env, jobject thiz)
{
	PPLOGI("OMXPlayer_prepareAsync");
	IPlayer* mp = getOMXMediaPlayer(env, thiz);
	if (mp == NULL ) {
		jniThrowException(env, "java/lang/IllegalStateException", NULL);
		return;
	}

	mp->prepareAsync();
}
开发者ID:caomw,项目名称:MeetSDK,代码行数:12,代码来源:OMXMediaPlayer.cpp

示例12: android_media_omxmediaplayer_isPlaying

JNIEXPORT jboolean android_media_omxmediaplayer_isPlaying(JNIEnv *env, jobject thiz)
{
	IPlayer* mp = getOMXMediaPlayer(env, thiz);
	if (mp == NULL ) {
		jniThrowException(env, "java/lang/IllegalStateException", NULL);
		return false;
	}

	const jboolean is_playing = mp->isPlaying();

	PPLOGD("isPlaying: %d", is_playing);
	return is_playing;
}
开发者ID:caomw,项目名称:MeetSDK,代码行数:13,代码来源:OMXMediaPlayer.cpp

示例13: lock

void CVisualisation::Stop()
{
  {
    CSingleLock lock(*g_application.getPlayerLock());
    IPlayer *player = g_application.getPlayer();
    if (player)
      player->UnRegisterAudioCallback();
  }

  if (Initialized())
  {
    CAddonDll<DllVisualisation, Visualisation, VIS_PROPS>::Stop();
  }
}
开发者ID:koying,项目名称:xbmc-pivos,代码行数:14,代码来源:Visualisation.cpp

示例14:

/* Returns the IPlayer that matches the IService [s]; overwize returns 0 */
IPlayer *		RoomManager::operator()(IService * s) const
{

	std::deque<IPlayer *> players = this->hall_->getAllPlayers();

	for (std::deque<IPlayer *>::const_iterator it = players.begin() ;
		it != players.end() ; ++it)
	{
		IPlayer *tmp = *it;

		if (tmp && tmp->getService() == s)
			return tmp;
	}
	return 0;
}
开发者ID:fiahil,项目名称:R-Type,代码行数:16,代码来源:RoomManager.cpp

示例15: getOMXMediaPlayer

/*
 * Class:     com_gotye_meetsdk_player_OMXPlayer
 * Method:    getVideoHeight
 * Signature: ()I
 */
JNIEXPORT jint JNICALL android_media_omxmediaplayer_getVideoHeight
  (JNIEnv *env, jobject thiz)
{
	IPlayer* mp = getOMXMediaPlayer(env, thiz);
	if (mp == NULL ) {
		PPLOGE("player is null, getVideoHeight failed");
		return 0;
	}
	int h;
	if (0 != mp->getVideoHeight(&h)) {
		PPLOGE("getVideoHeight failed");
		h = 0;
	}
	PPLOGI("getVideoHeight: %d", h);
	return h;
}
开发者ID:caomw,项目名称:MeetSDK,代码行数:21,代码来源:OMXMediaPlayer.cpp


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