Esempio n. 1
0
//==============================
// OvrDebugLinesLocal::BeginFrame
void OvrDebugLinesLocal::BeginFrame( const long long frameNum )
{
	// LOG( "OvrDebugLinesLocal::RemoveExpired: frame %lli, removing %i lines", frameNum, DepthTestedLines.GetSizeI() + NonDepthTestedLines.GetSizeI() );
	DepthGeo.indexCount = 0;
	NonDepthGeo.indexCount = 0;
	RemoveExpired( frameNum, DepthTestedLines );
	RemoveExpired( frameNum, NonDepthTestedLines );
}
Esempio n. 2
0
// Check if IP is currently flooding
bool CConnectHistory::IsFlooding ( const string& strIP )
{
    // Delete the expired entries
    RemoveExpired ();

    // Get history for this IP
    CConnectHistoryItem& historyItem = GetHistoryItem ( strIP );

    // Check if inside ban time
    if ( GetTickCount64_ () < historyItem.llBanEndTime )
        return true;

    // Check if too many connections
    if ( historyItem.joinTimes.size () > m_ulMaxConnections )
    {
        // Begin timed ban
        historyItem.llBanEndTime = GetTickCount64_ () + m_ulBanLength;
        return true;
    }

    return false;
}