mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-21 18:01:15 +00:00
Reworked logging and heartbeats so they use realtime again, instead of
directly calling sys_doubletime () - managed to remove six calls. Proboably I should look through the code some more and find more ways to remove more calls ... The server works fine with them on my system as is, but I've gotten the impression from people in the know that spamming the clock this often is bound to cause non x86 arches to have problems. Tim McGrath (Misty)
This commit is contained in:
parent
1747c07da6
commit
814b1b5f2b
1 changed files with 6 additions and 8 deletions
|
@ -568,17 +568,16 @@ SV_CheckLog (void)
|
|||
// bump sequence if almost full, or ten minutes have passed and
|
||||
// there is something still sitting there
|
||||
if (sz->cursize > LOG_HIGHWATER
|
||||
|| (Sys_DoubleTime () - svs.logtime > LOG_FLUSH && sz->cursize)) {
|
||||
|| ((realtime - svs.logtime) > (LOG_FLUSH && sz->cursize))
|
||||
|| (realtime - svs.logtime) < 0) {
|
||||
// swap buffers and bump sequence
|
||||
svs.logtime = Sys_DoubleTime ();
|
||||
svs.logtime = realtime;
|
||||
svs.logsequence++;
|
||||
sz = &svs.log[svs.logsequence & 1];
|
||||
sz->cursize = 0;
|
||||
SV_Printf ("beginning fraglog sequence %i\n", svs.logsequence);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
SVC_Log
|
||||
|
||||
|
@ -2142,7 +2141,7 @@ SV_InitLocal (void)
|
|||
|
||||
// init fraglog stuff
|
||||
svs.logsequence = 1;
|
||||
svs.logtime = Sys_DoubleTime ();
|
||||
svs.logtime = realtime;
|
||||
svs.log[0].data = svs.log_buf[0];
|
||||
svs.log[0].maxsize = sizeof (svs.log_buf[0]);
|
||||
svs.log[0].cursize = 0;
|
||||
|
@ -2166,10 +2165,9 @@ Master_Heartbeat (void)
|
|||
char string[2048];
|
||||
int active, i;
|
||||
|
||||
if (Sys_DoubleTime () - svs.last_heartbeat < HEARTBEAT_SECONDS)
|
||||
if ((realtime - svs.last_heartbeat) < HEARTBEAT_SECONDS)
|
||||
return; // not time to send yet
|
||||
|
||||
svs.last_heartbeat = Sys_DoubleTime ();
|
||||
svs.last_heartbeat = realtime;
|
||||
|
||||
// count active users
|
||||
active = 0;
|
||||
|
|
Loading…
Reference in a new issue