From ed6ac1253ba5f7055d9d0b55c5108f1955285db3 Mon Sep 17 00:00:00 2001 From: cloudwalk Date: Thu, 23 Jul 2020 03:20:15 +0000 Subject: [PATCH] sv_main: Receive packets even if we're gonna sleep, matching old behavior git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12868 d7cf8633-e32d-0410-b094-e92efae38249 --- sv_main.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sv_main.c b/sv_main.c index 05028bd2..e34e7438 100644 --- a/sv_main.c +++ b/sv_main.c @@ -4143,6 +4143,11 @@ double SV_Frame(double time) Con_DPrintf("Server can't keep up: %s\n", Host_TimingReport(vabuf, sizeof(vabuf))); svs.perf_acc_realtime = svs.perf_acc_sleeptime = svs.perf_acc_lost = svs.perf_acc_offset = svs.perf_acc_offset_squared = svs.perf_acc_offset_max = svs.perf_acc_offset_samples = host.sleeptime = 0; } + + // receive packets on each main loop iteration, as the main loop may + // be undersleeping due to select() detecting a new packet + if (sv.active) + NetConn_ServerFrame(); } if((sv_timer += time) < 0) @@ -4166,10 +4171,7 @@ double SV_Frame(double time) double advancetime, aborttime = 0; float offset; prvm_prog_t *prog = SVVM_prog; - // receive packets on each main loop iteration, as the main loop may - // be undersleeping due to select() detecting a new packet - if (sv.active && !svs.threaded) - NetConn_ServerFrame(); + // run the world state // don't allow simulation to run too fast or too slow or logic glitches can occur -- 2.39.2