CBrushConvexInfo()
	{
		m_pBSPData = GetCollisionBSPData();
	}
Esempio n. 2
0
void CGameClient::SetupPackInfo( CFrameSnapshot *pSnapshot )
{
	// Compute Vis for each client
	m_PackInfo.m_nPVSSize = (GetCollisionBSPData()->numclusters + 7) / 8;
	serverGameClients->ClientSetupVisibility( (edict_t *)m_pViewEntity,
		m_PackInfo.m_pClientEnt, m_PackInfo.m_PVS, m_PackInfo.m_nPVSSize );

	// This is the frame we are creating, i.e., the next
	// frame after the last one that the client acknowledged

	m_pCurrentFrame = AllocateFrame();
	m_pCurrentFrame->Init( pSnapshot );

	m_PackInfo.m_pTransmitEdict = &m_pCurrentFrame->transmit_entity;

	// if this client is the HLTV client, add the nocheck PVS bit array
	// normal clients don't need that extra array
#ifndef _XBOX
	if ( IsHLTV() )
	{
		// the hltv client doesn't has a ClientFrame list
		m_pCurrentFrame->transmit_always = new CBitVec<MAX_EDICTS>;
		m_PackInfo.m_pTransmitAlways = m_pCurrentFrame->transmit_always;
	}
	else
#endif
	{
		m_PackInfo.m_pTransmitAlways = NULL;
	}

	// Add frame to ClientFrame list 

	int nMaxFrames = MAX_CLIENT_FRAMES;

	if ( sv_maxreplay.GetFloat() > 0 )
	{
		// if the server has replay features enabled, allow a way bigger frame buffer
		nMaxFrames = max ( nMaxFrames, sv_maxreplay.GetFloat() / m_Server->GetTickInterval() );
	}
		
	if ( nMaxFrames < AddClientFrame( m_pCurrentFrame ) )
	{
		// If the client has more than 64 frames, the server will start to eat too much memory.
		RemoveOldestFrame(); 
	}
		
	// Since area to area visibility is determined by each player's PVS, copy
	//  the area network lookups into the ClientPackInfo_t
	m_PackInfo.m_AreasNetworked = 0;
	int areaCount = g_AreasNetworked.Count();
	for ( int j = 0; j < areaCount; j++ )
	{
		m_PackInfo.m_Areas[m_PackInfo.m_AreasNetworked] = g_AreasNetworked[ j ];
		m_PackInfo.m_AreasNetworked++;

		// Msg("CGameClient::SetupPackInfo: too much areas (%i)", areaCount );
		Assert( m_PackInfo.m_AreasNetworked < MAX_WORLD_AREAS );
	}
	
	CM_SetupAreaFloodNums( m_PackInfo.m_AreaFloodNums, &m_PackInfo.m_nMapAreas );
}