summaryrefslogtreecommitdiff
path: root/src/server/sv_snapshot.c
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2006-11-28 23:46:04 +0000
committerTim Angus <tim@ngus.net>2006-11-28 23:46:04 +0000
commit92905745a71578eed267f25311d7a18d49976f6d (patch)
tree5836f0a4424b938c6782190ec9c28c6be808f389 /src/server/sv_snapshot.c
parent6af24abf02f1d0dedc5dbe655a37d5afc9f0646a (diff)
* Merge ioq3-989
Diffstat (limited to 'src/server/sv_snapshot.c')
-rw-r--r--src/server/sv_snapshot.c17
1 files changed, 8 insertions, 9 deletions
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;
}
}