mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Send long announce as POST, show OS in useragent
Add lag reporting to masterserver (average dtime) StyledWriter -> FastWriter in masterserver announce
This commit is contained in:
parent
3e728e722a
commit
c62bab010f
9 changed files with 45 additions and 24 deletions
|
@ -675,6 +675,7 @@ Server::Server(
|
|||
m_savemap_timer = 0.0;
|
||||
|
||||
m_step_dtime = 0.0;
|
||||
m_lag = g_settings->getFloat("dedicated_server_step");
|
||||
|
||||
if(path_world == "")
|
||||
throw ServerError("Supplied empty world path");
|
||||
|
@ -1260,13 +1261,14 @@ void Server::AsyncRunStep()
|
|||
}
|
||||
|
||||
|
||||
m_lag += (m_lag > dtime ? -1 : 1) * dtime/100;
|
||||
#if USE_CURL
|
||||
// send masterserver announce
|
||||
{
|
||||
float &counter = m_masterserver_timer;
|
||||
if(!isSingleplayer() && (!counter || counter >= 300.0) && g_settings->getBool("server_announce") == true)
|
||||
{
|
||||
ServerList::sendAnnounce(!counter ? "start" : "update", m_clients_names, m_uptime.get(), m_env->getGameTime(), m_gamespec.id, m_mods);
|
||||
ServerList::sendAnnounce(!counter ? "start" : "update", m_clients_names, m_uptime.get(), m_env->getGameTime(), m_lag, m_gamespec.id, m_mods);
|
||||
counter = 0.01;
|
||||
}
|
||||
counter += dtime;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue