This is a fork of Zandronum used on servers hosted by The Sentinels Playground (TSPG).
修訂 | 272303b859971bbb4890f973d490f60752a0db8a (tree) |
---|---|
時間 | 2021-11-19 23:23:35 |
作者 | Adam Kaminski <kaminskiadam9@gmai...> |
Commiter | Adam Kaminski |
Moved some code from P_Ticker over to SERVER_HandleSkipCorrection.
@@ -324,17 +324,9 @@ | ||
324 | 324 | continue; |
325 | 325 | |
326 | 326 | CLIENT_s *client = SERVER_GetClient( ulIdx ); |
327 | - ULONG ulNumMoveCMDs = 0; | |
328 | - | |
329 | - // [AK] Count how many movement commands are inside the client's tic buffer. | |
330 | - for ( unsigned int i = 0; i < client->MoveCMDs.Size( ); i++ ) | |
331 | - { | |
332 | - if ( client->MoveCMDs[i]->isMoveCmd( )) | |
333 | - ulNumMoveCMDs++; | |
334 | - } | |
335 | 327 | |
336 | 328 | // [AK] Handle the skip correction. |
337 | - SERVER_HandleSkipCorrection( ulIdx, ulNumMoveCMDs ); | |
329 | + SERVER_HandleSkipCorrection( ulIdx ); | |
338 | 330 | |
339 | 331 | while ( client->MoveCMDs.Size( ) != 0 ) |
340 | 332 | { |
@@ -5407,9 +5407,10 @@ | ||
5407 | 5407 | |
5408 | 5408 | //***************************************************************************** |
5409 | 5409 | // |
5410 | -void SERVER_HandleSkipCorrection( ULONG ulClient, ULONG ulNumMoveCMDs ) | |
5410 | +void SERVER_HandleSkipCorrection( ULONG ulClient ) | |
5411 | 5411 | { |
5412 | 5412 | CLIENT_s *pClient = &g_aClients[ulClient]; |
5413 | + ULONG ulNumMoveCMDs = 0; | |
5413 | 5414 | FString debugMessage; |
5414 | 5415 | |
5415 | 5416 | // [AK] Don't handle the skip correction if it's supposed to be disabled. |
@@ -5421,6 +5422,13 @@ | ||
5421 | 5422 | if (( players[ulClient].mo == NULL ) || ( pClient->lLastMoveTickProcess == gametic )) |
5422 | 5423 | return; |
5423 | 5424 | |
5425 | + // [AK] Count how many movement commands are inside the client's tic buffer. | |
5426 | + for ( unsigned int i = 0; i < pClient->MoveCMDs.Size( ); i++ ) | |
5427 | + { | |
5428 | + if ( pClient->MoveCMDs[i]->isMoveCmd( )) | |
5429 | + ulNumMoveCMDs++; | |
5430 | + } | |
5431 | + | |
5424 | 5432 | // When a player is experiencing ping spikes or packet loss and we don't have any commands |
5425 | 5433 | // left in their buffer, we will try to predict where they will be for at least the next few tics |
5426 | 5434 | // until we start receiveing commands from them again. In case the player suffers from a ping spike, we |
@@ -639,7 +639,7 @@ | ||
639 | 639 | void SERVER_KillCheat( const char* what ); |
640 | 640 | void STACK_ARGS SERVER_PrintWarning( const char* format, ... ) GCCPRINTF( 1, 2 ); |
641 | 641 | void SERVER_FlagsetChanged( FIntCVar& flagset, int maxflags = 2 ); |
642 | -void SERVER_HandleSkipCorrection( ULONG ulClient, ULONG ulNumMoveCMDs ); | |
642 | +void SERVER_HandleSkipCorrection( ULONG ulClient ); | |
643 | 643 | bool SERVER_IsExtrapolatingPlayer( ULONG ulClient ); |
644 | 644 | bool SERVER_IsBacktracingPlayer( ULONG ulClient ); |
645 | 645 | void SERVER_ResetClientTicBuffer( ULONG ulClient ); |