From 45de6be4c233891eb70e5592f3287a4af39d6002 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Fri, 15 Sep 2017 19:14:03 -0500 Subject: [PATCH] Fix listen server sending snapshots each client frame Running a server using the client engine would send server snapshots to loopback and LAN clients each client frame (com_maxfps). This causes excessive network traffic and likely does not provide new information to the clients because SV_Frame() won't have run between the extra snapshots. This commit restores the original behavior of respecting local/LAN client's snaps userinfo and sv_fps. The issue was introduced by the following commit: Commit ac30d86db01a43130d2c9ff6fe31d6135d8e2592 From: Thilo Schulz Date: Wed, 13 Jul 2011 17:11:30 +0000 Subject: - Improve snapshot rate and data rate control Reported by Eugene C. --- code/server/sv_snapshot.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/code/server/sv_snapshot.c b/code/server/sv_snapshot.c index 2237abd3..7c04afdf 100644 --- a/code/server/sv_snapshot.c +++ b/code/server/sv_snapshot.c @@ -653,6 +653,9 @@ void SV_SendClientMessages(void) if(!c->state) continue; // not connected + if(svs.time - c->lastSnapshotTime < c->snapshotMsec * com_timescale->value) + continue; // It's not time yet + if(*c->downloadName) continue; // Client is downloading, don't send snapshots @@ -666,10 +669,6 @@ void SV_SendClientMessages(void) (sv_lanForceRate->integer && Sys_IsLANAddress(c->netchan.remoteAddress)))) { // rate control for clients not on LAN - - if(svs.time - c->lastSnapshotTime < c->snapshotMsec * com_timescale->value) - continue; // It's not time yet - if(SV_RateMsec(c) > 0) { // Not enough time since last packet passed through the line