From 92905745a71578eed267f25311d7a18d49976f6d Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Tue, 28 Nov 2006 23:46:04 +0000 Subject: * Merge ioq3-989 --- src/server/sv_snapshot.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/server/sv_snapshot.c') diff --git a/src/server/sv_snapshot.c b/src/server/sv_snapshot.c index 75da32b0..47471ba5 100644 --- a/src/server/sv_snapshot.c +++ b/src/server/sv_snapshot.c @@ -559,7 +559,7 @@ static int SV_RateMsec( client_t *client, int messageSize ) { rate = sv_minRate->integer; } - rateMsec = ( messageSize + HEADER_RATE_BYTES ) * 1000 / rate; + rateMsec = ( messageSize + HEADER_RATE_BYTES ) * 1000 / rate * com_timescale->value; return rateMsec; } @@ -588,31 +588,30 @@ void SV_SendMessageToClient( msg_t *msg, client_t *client ) { // TTimo - https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=491 // added sv_lanForceRate check if ( client->netchan.remoteAddress.type == NA_LOOPBACK || (sv_lanForceRate->integer && Sys_IsLANAddress (client->netchan.remoteAddress)) ) { - client->nextSnapshotTime = svs.time + (1000/sv_fps->integer); + client->nextSnapshotTime = svs.time + (1000.0 / sv_fps->integer * com_timescale->value); return; } // normal rate / snapshotMsec calculation - rateMsec = SV_RateMsec( client, msg->cursize ); + rateMsec = SV_RateMsec(client, msg->cursize); - if ( rateMsec < client->snapshotMsec ) { + if ( rateMsec < client->snapshotMsec * com_timescale->value) { // never send more packets than this, no matter what the rate is at - rateMsec = client->snapshotMsec; + rateMsec = client->snapshotMsec * com_timescale->value; client->rateDelayed = qfalse; } else { client->rateDelayed = qtrue; } - client->nextSnapshotTime = svs.time + rateMsec; + client->nextSnapshotTime = svs.time + rateMsec * com_timescale->value; // don't pile up empty snapshots while connecting if ( client->state != CS_ACTIVE ) { // a gigantic connection message may have already put the nextSnapshotTime // more than a second away, so don't shorten it // do shorten if client is downloading - if ( !*client->downloadName && client->nextSnapshotTime < svs.time + 1000 ) { - client->nextSnapshotTime = svs.time + 1000; - } + if (!*client->downloadName && client->nextSnapshotTime < svs.time + 1000 * com_timescale->value) + client->nextSnapshotTime = svs.time + 1000 * com_timescale->value; } } -- cgit