mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Improve ping on empty server (serverbrowser)
This commit is contained in:
parent
8fb0358452
commit
18315e8c79
|
@ -1600,8 +1600,8 @@ int CServer::Run()
|
|||
|
||||
// start game
|
||||
{
|
||||
int64 ReportTime = time_get();
|
||||
int ReportInterval = 3;
|
||||
bool NonActive = false;
|
||||
|
||||
m_Lastheartbeat = 0;
|
||||
m_GameStartTime = time_get();
|
||||
|
@ -1614,7 +1614,11 @@ int CServer::Run()
|
|||
|
||||
while(m_RunServer)
|
||||
{
|
||||
if(NonActive)
|
||||
PumpNetwork();
|
||||
|
||||
set_new_tick();
|
||||
|
||||
int64 t = time_get();
|
||||
int NewTicks = 0;
|
||||
|
||||
|
@ -1688,34 +1692,10 @@ int CServer::Run()
|
|||
// master server stuff
|
||||
m_Register.RegisterUpdate(m_NetServer.NetType());
|
||||
|
||||
PumpNetwork();
|
||||
if(!NonActive)
|
||||
PumpNetwork();
|
||||
|
||||
if(ReportTime < time_get())
|
||||
{
|
||||
if(g_Config.m_Debug)
|
||||
{
|
||||
/*
|
||||
static NETSTATS prev_stats;
|
||||
NETSTATS stats;
|
||||
netserver_stats(net, &stats);
|
||||
|
||||
perf_next();
|
||||
|
||||
if(config.dbg_pref)
|
||||
perf_dump(&rootscope);
|
||||
|
||||
dbg_msg("server", "send=%8d recv=%8d",
|
||||
(stats.send_bytes - prev_stats.send_bytes)/reportinterval,
|
||||
(stats.recv_bytes - prev_stats.recv_bytes)/reportinterval);
|
||||
|
||||
prev_stats = stats;
|
||||
*/
|
||||
}
|
||||
|
||||
ReportTime += time_freq()*ReportInterval;
|
||||
}
|
||||
|
||||
bool NonActive = true;
|
||||
NonActive = true;
|
||||
|
||||
for(int c = 0; c < MAX_CLIENTS; c++)
|
||||
if(m_aClients[c].m_State != CClient::STATE_EMPTY)
|
||||
|
|
Loading…
Reference in a new issue