svs.perf_acc_realtime += deltacleantime;
// Look for clients who have spawned
+ playing = false;
for (i = 0, host_client = svs.clients;i < svs.maxclients;i++, host_client++)
if(host_client->spawned)
if(host_client->netconnection)
- break;
- if(i == svs.maxclients)
- {
- // Nobody is looking? Then we won't do timing...
- // Instead, reset it to zero
- 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 = 0;
- }
- else if(svs.perf_acc_realtime > 5)
+ playing = true;
+ if(svs.perf_acc_realtime > 5)
{
svs.perf_cpuload = 1 - svs.perf_acc_sleeptime / svs.perf_acc_realtime;
svs.perf_lost = svs.perf_acc_lost / svs.perf_acc_realtime;
svs.perf_offset_sdev = sqrt(svs.perf_acc_offset_squared / svs.perf_acc_offset_samples - svs.perf_offset_avg * svs.perf_offset_avg);
}
if(svs.perf_lost > 0 && developer_extra.integer)
- Con_DPrintf("Server can't keep up: %s\n", Host_TimingReport(vabuf, sizeof(vabuf)));
+ if(playing) // only complain if anyone is looking
+ 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 = 0;
}
}
if(host_client->spawned)
if(host_client->netconnection)
playing = true;
- if(!playing)
- {
- // Nobody is looking? Then we won't do timing...
- // Instead, reset it to zero
- 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 = 0;
- }
- else if(svs.perf_acc_realtime > 5)
+ if(svs.perf_acc_realtime > 5)
{
svs.perf_cpuload = 1 - svs.perf_acc_sleeptime / svs.perf_acc_realtime;
svs.perf_lost = svs.perf_acc_lost / svs.perf_acc_realtime;
svs.perf_offset_sdev = sqrt(svs.perf_acc_offset_squared / svs.perf_acc_offset_samples - svs.perf_offset_avg * svs.perf_offset_avg);
}
if(svs.perf_lost > 0 && developer_extra.integer)
- Con_DPrintf("Server can't keep up: %s\n", Host_TimingReport(vabuf, sizeof(vabuf)));
+ if(playing)
+ 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 = 0;
}