コード例 #1
0
ファイル: d_net.c プロジェクト: HipsterLion/SRB2
void Command_Ping_f(void)
{
#ifndef NEWPING
	if(server)
	{
#endif
		INT32 i;
		for (i = 0; i < MAXPLAYERS;i++)
		{
#ifndef NEWPING
			const INT32 node = playernode[i];
			if (playeringame[i] && node != 0)
				CONS_Printf(M_GetText("%.2d : %s\n %d tics, %d ms.\n"), i, player_names[i],
				GetLag(node), G_TicsToMilliseconds(GetLag(node)));
#else
			if (playeringame[i] && i != 0)
				CONS_Printf(M_GetText("%.2d : %s\n %d ms\n"), i, player_names[i], playerpingtable[i]);
#endif
		}
#ifndef NEWPING
	}
	else
		CONS_Printf(M_GetText("Only the server can use this.\n"));
#endif
}
コード例 #2
0
ファイル: d_net.c プロジェクト: Pupswoof117/SRB2-Public
void Command_Ping_f(void)
{
#ifndef NEWPING
	if(server)
	{
#endif
		INT32 i;
		for (i = 0; i < MAXPLAYERS;i++)
		{
#ifndef NEWPING
			const INT32 node = playernode[i];
			if (playeringame[i] && node != 0)
				CONS_Printf(text[CMD_PING], i, player_names[i],
				GetLag(node), G_TicsToMilliseconds(GetLag(node)));
#else
			if (playeringame[i] && i != 0)
				CONS_Printf(text[CMD_PING], i, player_names[i], playerpingtable[i]);
#endif
		}
#ifndef NEWPING
	}
	else CONS_Printf("%s", text[YOUARENOTTHESERVER]);
#endif
}
コード例 #3
0
void CBKInfEngine::BackwardFixLag()
{
    //////////////////////////////////////////////////////////////////////////
    // Backward step for fixed-lag smoothing procedure
    //////////////////////////////////////////////////////////////////////////
    PNL_CHECK_LEFT_BORDER(m_CurrentTime, m_Lag);
    
    if( m_Lag )
    {
	int currentTimeTmp = GetTime();
	CRing<CJtreeInfEngine *>::iterator tmpInfIter = m_JTreeInfIter;
	CRing< distrPVector >::iterator tmpDistrIter =  m_CDistrOnSepIter;
	
	CRing<CJtreeInfEngine*> ringEng;
	ringEng.assign( 2 , NULL ); 
	CRing<CJtreeInfEngine *>::iterator ringEngIter = ringEng.begin();
	
	*ringEngIter = CJtreeInfEngine::Copy(*m_JTreeInfIter);
	ringEngIter++;
	
	BackwardT();
	
	distrPVector tmpDistr(GetNumOfClusters(), (CDistribFun* const)NULL);
	int i;
	for( i = 0; i < GetLag(); i++ )
	{
	    if( i < GetLag() - 1 )
	    {
		*ringEngIter = CJtreeInfEngine::Copy(*(m_JTreeInfIter-1));
		int j;
		for( j = 0; j < GetNumOfClusters(); j++ )
		{
		    tmpDistr[j] = (*m_CDistrOnSepIter)[j]->Clone();
		}
	    }
	    Backward();
	    
	    //CJtreeInfEngine::Release(&(*(m_JTreeInfIter + 1)));
            delete (*(m_JTreeInfIter + 1));
	    
	    ringEngIter++;
	    
	    *(m_JTreeInfIter + 1) = *ringEngIter;
	    
	    if( i < GetLag() - 1 )
	    { 
		int j;
		for( j = 0; j < GetNumOfClusters(); j++ )
		{
		    delete (*(m_CDistrOnSepIter+1))[j];
		    (*(m_CDistrOnSepIter+1))[j]=tmpDistr[j];
		}
	    }
	} 
	
	
	m_CDistrOnSepIter = tmpDistrIter;
	m_JTreeInfIter = tmpInfIter;
	m_CurrentTime = currentTimeTmp;
	
    }
    else
    {
	BackwardT();
    }
    
}