Zandronum Chat on our Discord Server Get the latest version: 3.1
Source Code

View Revisions: Issue #3314 Back to Issue ]
Summary 0003314: The ticbuffer isn't completely processed in some cases
Revision 2017-10-28 01:06 by Leonard
Description The loop that is supposed to process it is wrong:
for ( unsigned int i = 0; i < g_aClients[ulIdx].MoveCMDs.Size(); ++i )
             {
                 g_aClients[ulIdx].MoveCMDs[0]->process ( ulIdx );
 
                 // [BB] Only limit the amount of movement commands.
                 if ( g_aClients[ulIdx].MoveCMDs[0]->isMoveCmd() )
                     ++numMoveCMDs;
 
                 delete g_aClients[ulIdx].MoveCMDs[0];
                 g_aClients[ulIdx].MoveCMDs.Delete(0);
 
                 if ( numMoveCMDs == 2 )
                     break;
             }

As you can see, i increases each step however Size() decreases since we deleted one entry from the TArray.
This becomes problematic if for example there are 2 movement commands left in the buffer, only one will be processed and then the condition (i < Size()) will no longer be true.
Revision 2017-10-28 01:09 by Leonard
Description The loop that is supposed to process it is wrong:
for ( unsigned int i = 0; i < g_aClients[ulIdx].MoveCMDs.Size(); ++i )
             {
                 g_aClients[ulIdx].MoveCMDs[0]->process ( ulIdx );
 
                 // [BB] Only limit the amount of movement commands.
                 if ( g_aClients[ulIdx].MoveCMDs[0]->isMoveCmd() )
                     ++numMoveCMDs;
 
                 delete g_aClients[ulIdx].MoveCMDs[0];
                 g_aClients[ulIdx].MoveCMDs.Delete(0);
 
                 if ( numMoveCMDs == 2 )
                     break;
             }

As you can see, i increases each step however Size() decreases since we deleted one entry from the TArray.
This becomes problematic if for example there are 2 movement commands left in the buffer, only one will be processed and then the condition (i < Size()) will no longer be true.
Revision 2017-10-28 01:06 by Leonard
Steps To Reproduce An easy way to directly notice this is to use sv_unlagged_debugactors:
Using the commit and testing wad referenced in 0002859:0018627:
-host a server on MAP01 with sv_unlagged_debugactors true
-connect and join 2 clients (locally)
-additionally you can enable the debug output (cl_debug_clientupdates)
-simply hold the window for a second or so, this will freeze zandronum and will make it fill your ticbuffer when it recovers
-notice that the ticbuffer struggles to catch up for a moment at the very last tic (this is indicated both by the debug output and the unlagged debug actors being one tic behind for a moment)
Revision 2017-10-28 01:54 by Leonard
Steps To Reproduce An easy way to directly notice this is to use sv_unlagged_debugactors:
Using the commit and testing wad referenced in 0002859:0018627:
-host a server on MAP01 with sv_unlagged_debugactors true
-connect and join 2 clients (locally)
-additionally you can enable the debug output (cl_debug_clientupdates)
-make sure to have cl_ticsperupdate on 1 so as to not run into 0003317
-simply hold the window for a second or so, this will freeze zandronum and will make it fill your ticbuffer when it recovers
-notice that the ticbuffer struggles to catch up for a moment at the very last tic (this is indicated both by the debug output and the unlagged debug actors being one tic behind for a moment)






Questions or other issues? Contact Us.

Links


Copyright © 2000 - 2024 MantisBT Team
Powered by Mantis Bugtracker