]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
test c bones_was_here/net_s8
authorbones_was_here <bones_was_here@xa.org.au>
Thu, 13 May 2021 20:12:59 +0000 (06:12 +1000)
committerbones_was_here <bones_was_here@xa.org.au>
Fri, 30 Jul 2021 13:28:04 +0000 (23:28 +1000)
sv_user.c

index 6af9d1a3a4ad0da5fa0c2a7bcc32c8be29f10cad..1dda20e175a1b01b8880e265277ceecf137028fa 100644 (file)
--- a/sv_user.c
+++ b/sv_user.c
@@ -829,11 +829,27 @@ static void SV_ExecuteClientMoves(void)
                                        // count the move as LOST if we don't
                                        // execute it but it has higher
                                        // sequence count
-                                       if(host_client->movesequence)
-                                               if(move->sequence > host_client->movesequence)
-                                                       host_client->movement_count[(move->sequence) % NETGRAPH_PACKETS] = -1;
-                                       continue;
+                                       if (host_client->movesequence && move->sequence > host_client->movesequence)
+                                       {
+                                               host_client->movement_count[(move->sequence) % NETGRAPH_PACKETS] = -1;
+
+                                               // bones_was_here: if we are discarding the move due to inputtimeout,
+                                               // and it's the last received and has the highest sequence count,
+                                               // set cmd.time to allow for persistent latency increases,
+                                               // and to calculate the moveframetime the client expects next frame
+                                               // NB: sv.frametime will be added in SV_Physics_ClientEntity_PostThink
+                                               if (host_client->clmovement_inputtimeout == -1337 && moveindex == sv_numreadmoves - 1)
+                                                       move->time -= sv.frametime;
+                                       }
+
+                                       // bones_was_here: previously just a continue; discarded everything, even impulses and buttons
+                                       // but it should be sufficient to just zero out player movement
+                                       move->forwardmove = 0.0;
+                                       move->sidemove = 0.0;
+                                       move->upmove = 0.0;
                                }
+                               else
+                                       host_client->clmovement_inputtimeout = min(0.1, sv_clmovement_inputtimeout.value);
 
                                //Con_Printf("movesequence = %i (%i lost), moveframetime = %f\n", move->sequence, move->sequence ? move->sequence - host_client->movesequence - 1 : 0, moveframetime);
                                host_client->cmd = *move;
@@ -860,7 +876,6 @@ static void SV_ExecuteClientMoves(void)
                                SV_Physics_ClientMove();
                                sv.frametime = oldframetime2;
                                PRVM_serverglobalfloat(frametime) = oldframetime;
-                               host_client->clmovement_inputtimeout = min(0.1, sv_clmovement_inputtimeout.value);
                        }
                }
        }