Example #1
0
void CHLTVDirector::FrameUpdatePostEntityThink( void )
{
	if ( !m_pHLTVServer )
		return;	// don't do anything

	// This function is called each tick
	UpdateSettings();	// update settings from cvars

	if ( m_nNextAnalyzeTick < gpGlobals->tickcount )
	{
		m_nNextAnalyzeTick = gpGlobals->tickcount + TIME_TO_TICKS( 0.5f );

		AnalyzePlayers();

		AnalyzeCameras();
	}

	if ( m_nBroadcastTick <= 0 )
	{
		// game start is still in delay loop
		StartDelayMessage();
	}
	else if ( m_nNextShotTick <= m_nBroadcastTick )
	{
		// game is being broadcasted, generate camera shots
		StartNewShot();		
	}
}
Example #2
0
void CHLTVDirector::StartInstantBroadcastShot()
{
	m_nNextShotTick = m_nBroadcastTick + TIME_TO_TICKS( MAX_SHOT_LENGTH );

	if ( m_iCameraManIndex > 0 )
	{
		// camera man is still recording and live, resend camera man message
		IGameEvent *msg = gameeventmanager->CreateEvent( "hltv_cameraman", true );
		if ( msg )
		{
			msg->SetInt("index", m_iCameraManIndex );
			m_pHLTVServer->BroadcastEvent( msg );
			gameeventmanager->FreeEvent( msg );

			m_iPVSEntity = m_iCameraManIndex;
			m_nNextShotTick = m_nBroadcastTick+TIME_TO_TICKS( MIN_SHOT_LENGTH ); 
		}
	}
	else
	{
		RemoveEventsFromHistory(-1); // all

		AnalyzePlayers();

		AnalyzeCameras();

		StartRandomShot();
	}
}