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


C++ CNetworkVehicle::MarkAsActorVehicle方法代码示例

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


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

示例1: InternalResetGame

// (John) TODO: Only SAFE_DELETE and re-instantiate things that really need it, otherwise give them a Reset() method.
void CClient::InternalResetGame(bool bAutoConnect)
{
	CLogFile::Printf("Initializing game for multiplayer activities");

	// Remove local player from vehicle
	if(m_pLocalPlayer)
		m_pLocalPlayer->RemoveFromVehicle();

	// Remove all current GUIs
	// CClientScriptManager destructor will take care of this
	//m_pClientScriptManager->RemoveAll();
	//m_pClientScriptManager->GetGUIManager()->DeleteAll();

	SAFE_DELETE(m_pClientScriptManager);
	m_pClientScriptManager = new CClientScriptManager();
	m_pEvents->clear();
	m_pGUI->SetScriptedCursorVisible(false);
	CLogFile::Printf("Reset clientside scripting stuff");

	SAFE_DELETE(m_pModelManager);
	m_pModelManager = new CModelManager();
	CLogFile::Printf("Created model manager instance");

	SAFE_DELETE(m_pPickupManager);
	m_pPickupManager = new CPickupManager();
	CLogFile::Printf("Created pickup manager instance");

	SAFE_DELETE(m_pCheckpointManager);
	m_pCheckpointManager = new CCheckpointManager();
	CLogFile::Printf("Created checkpoint manager instance");

	SAFE_DELETE(m_pBlipManager);
	m_pBlipManager = new CBlipManager();
	CLogFile::Printf("Created blip manager instance");

	SAFE_DELETE(m_pObjectManager);
	m_pObjectManager = new CObjectManager();
	CLogFile::Printf("Created object manager instance");

	SAFE_DELETE(m_pFireManager);
	m_pFireManager = new CFireManager();
	CLogFile::Printf("Created fire manager instance");

	SAFE_DELETE(m_p3DLabelManager);
	m_p3DLabelManager = new C3DLabelManager();
	CLogFile::Printf("Created 3d label manager instance");

	// Set all vehicles to destroyable
	if(m_pVehicleManager)
	{
		for(EntityId i = 0; i < MAX_PLAYERS; i++)
		{
			CNetworkVehicle * pVehicle = m_pVehicleManager->Get(i);

			if(pVehicle)
				pVehicle->MarkAsActorVehicle(false);
		}
	}

	SAFE_DELETE(m_pVehicleManager);
	m_pVehicleManager = new CVehicleManager();
	CLogFile::Printf("Created vehicle manager instance");

	SAFE_DELETE(m_pActorManager);
	m_pActorManager = new CActorManager();
	CLogFile::Printf("Created actor manager instance");

	// Reset the streamer
	m_pStreamer->Reset();
	CLogFile::Printf("Reset streamer instance");

	if(!m_pLocalPlayer)
	{
		m_pLocalPlayer = new CLocalPlayer();
		CLogFile::Printf("Created local player instance");
	}

	m_pLocalPlayer->Reset();
	m_pLocalPlayer->SetPlayerId(INVALID_ENTITY_ID);
	m_pLocalPlayer->SetModel(Scripting::MODEL_PLAYER);
	m_pLocalPlayer->Teleport(CVector3());
	m_pLocalPlayer->SetPlayerControlAdvanced(false, false);
	m_pLocalPlayer->RemoveAllWeapons();
	m_pLocalPlayer->ResetMoney();
	m_pLocalPlayer->SetHealth(200);
	m_pLocalPlayer->SetControl(true);
	CLogFile::Printf("Reset local player instance");

	SAFE_DELETE(m_pPlayerManager);
	m_pPlayerManager = new CPlayerManager();
	CLogFile::Printf("Created player manager instance");


	// Create network manager if it doesn't exist
	if(!m_pNetworkManager)
	{
		m_pNetworkManager = new CNetworkManager();
		m_pNetworkManager->Startup(GetHost(), GetPort(), GetPassword());
		CLogFile::Printf("Created network manager instance");
//.........这里部分代码省略.........
开发者ID:JamesConway69,项目名称:ivmultiplayer,代码行数:101,代码来源:CClient.cpp


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