# HG changeset patch # User Adam Kaminski # Date 1635614189 14400 # Sat Oct 30 13:16:29 2021 -0400 # Node ID 293c24c96647381b7ac0bdb9dcd3bdcbb5138540 # Parent 12915d1075530c3c1ef8c8224c793613ab2b6a44 Added more debug information to sv_smoothplayers_debuginfo. diff -r 12915d107553 -r 293c24c96647 src/sv_main.cpp --- a/src/sv_main.cpp Sat Oct 30 12:56:03 2021 -0400 +++ b/src/sv_main.cpp Sat Oct 30 13:16:29 2021 -0400 @@ -281,7 +281,7 @@ CVAR( Bool, sv_forcelogintojoin, false, CVAR_ARCHIVE|CVAR_NOSETBYACS ) CVAR( Bool, sv_useticbuffer, true, CVAR_ARCHIVE|CVAR_NOSETBYACS|CVAR_DEBUGONLY ) CVAR( Int, sv_showcommands, 0, CVAR_ARCHIVE|CVAR_DEBUGONLY ) -CVAR( Bool, sv_smoothplayers_debuginfo, false, CVAR_ARCHIVE|CVAR_DEBUGONLY ) // [AK] +CVAR( Int, sv_smoothplayers_debuginfo, 0, CVAR_ARCHIVE|CVAR_DEBUGONLY ) // [AK] //***************************************************************************** // [AK] Smooths the movement of lagging players using extrapolation and correction. @@ -5357,6 +5357,23 @@ { Printf( "%d: %s (%d tics extrapolated, %d move commands, %d late commands.\n", gametic, players[ulClient].userinfo.GetName( ), static_cast( pClient->ulExtrapolatedTics ), pClient->MoveCMDs.Size( ), pClient->LateMoveCMDs.Size( )); + + if ( sv_smoothplayers_debuginfo >= 2 ) + { + if ( pClient->MoveCMDs.Size( ) > 0 ) + { + Printf( "-> Move gametics: " ); + for ( unsigned int i = 0; i < pClient->MoveCMDs.Size( ); i++ ) + Printf( "%d%s", pClient->MoveCMDs[i]->getClientTic( ), i < pClient->MoveCMDs.Size( ) - 1 ? ", " : "\n" ); + } + + if ( pClient->LateMoveCMDs.Size( ) > 0 ) + { + Printf( "-> Late gametics: " ); + for ( unsigned int i = 0; i < pClient->LateMoveCMDs.Size( ); i++ ) + Printf( "%d%s", pClient->LateMoveCMDs[i]->getClientTic( ), i < pClient->LateMoveCMDs.Size( ) - 1 ? ", " : "\n" ); + } + } } } @@ -5373,7 +5390,10 @@ if ( pClient->ulExtrapolatedTics++ == 0 ) { if ( sv_smoothplayers_debuginfo ) - Printf( "%d: starting extrapolation for %s.\n", gametic, players[ulClient].userinfo.GetName( )); + { + Printf( "%d: starting extrapolation for %s (last gametic = %d).\n", gametic, players[ulClient].userinfo.GetName( ), + pClient->LastMoveCMD->getClientTic( )); + } pClient->OldData = new CLIENT_PLAYER_DATA_s( &players[ulClient] ); } @@ -7451,7 +7471,15 @@ pClient->LastMoveCMD = new ClientMoveCommand( *static_cast( pClient->LateMoveCMDs[ulLastIdx] )); if ( sv_smoothplayers_debuginfo ) - Printf( "%d: no need to backtrace %s.\n", gametic, players[ulClient].userinfo.GetName( )); + { + Printf( "%d: no need to backtrace %s ", gametic, players[ulClient].userinfo.GetName( )); + + // [AK] Explain why we didn't backtrace their movement. + if ( bPressedAnything == false ) + Printf( "(didn't press anything).\n" ); + else + Printf( "(morphed during extrapolation).\n" ); + } } SERVER_ResetClientExtrapolation( ulClient );