Example #1
0
void CNetGame::Process()
{
	float fElapsedTime = GetElapsedTime();

	UpdateNetwork();

	if(this->gameState == 1) 
	{	
		if(this->playerPool) this->playerPool->Process(fElapsedTime);
		if(this->vehiclePool) this->vehiclePool->Process(fElapsedTime);
		if(this->objectPool) this->objectPool->Process(fElapsedTime);
		if(this->gamemodeManager) this->gamemodeManager->Frame(fElapsedTime);
		if(this->scriptTimerManager) this->scriptTimerManager->Process((uint32_t)(fElapsedTime * 1000.0f));
		if(this->scriptHttpManager) this->scriptHttpManager->Process();

		if ( __ElementFactory ) __ElementFactory->Process ( fElapsedTime );
	} 
	else if(this->gameState == 2) 
	{
		fRestartWaitTime += fElapsedTime;
		if(fRestartWaitTime > 12.0f)
		{
			ReInitWhenRestarting();
		}
	}

	if (__Console->GetBoolVar("announce"))
		MasterServerAnnounce(fElapsedTime);

	__Plugins->DoProcessTick();

	#ifndef WIN32
		this->elapsedTime += (double)fElapsedTime;
	#endif
}
Example #2
0
void CNetGame::Process()
{
	float fElapsedTime = GetElapsedTime();

	UpdateNetwork();

	//if (IsACEnabled())
		//CAntiCheat::Process();

	if(m_iGameState == GAMESTATE_RUNNING) 
	{
		if(m_pPlayerPool) m_pPlayerPool->Process(fElapsedTime);
		if(m_pVehiclePool) m_pVehiclePool->Process(fElapsedTime);
		if(m_pObjectPool) m_pObjectPool->Process(fElapsedTime);
		if(m_pGameMode) m_pGameMode->Frame(fElapsedTime);
		if(m_pScriptTimers) m_pScriptTimers->Process((DWORD)(fElapsedTime * 1000.0f));
	
	} 
	else if(m_iGameState == GAMESTATE_RESTARTING) 
	{
		fRestartWaitTime += fElapsedTime;
		if(fRestartWaitTime > 12.0f) // wait 12 seconds, then restart
		{
			ReInitWhenRestarting();
		}
	}

	if (pConsole->GetBoolVariable("announce")) {
		// Announce the server to the master
		MasterServerAnnounce(fElapsedTime);
	}

	// Execute the tick event for loaded plugins
	pPlugins->DoProcessTick();
	
	#ifndef WIN32
		m_dElapsedTime += (double)fElapsedTime;
	#endif
}