From: proller Date: Fri, 2 Aug 2013 23:02:59 +0000 (+0400) Subject: More info in serverlist X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=5e433fa913cc21d4d3c9ba1ef341c3c7aedc128c;p=zefram%2Fminetest%2Fminetest_engine.git More info in serverlist --- diff --git a/src/serverlist.cpp b/src/serverlist.cpp index 7a374eb4..bc09f6c0 100644 --- a/src/serverlist.cpp +++ b/src/serverlist.cpp @@ -210,8 +210,6 @@ void sendAnnounce(std::string action, u16 clients, double uptime, std::string ga server["url"] = g_settings->get("server_url"); server["creative"] = g_settings->get("creative_mode"); server["damage"] = g_settings->get("enable_damage"); - server["dedicated"] = g_settings->get("server_dedicated"); - server["rollback"] = g_settings->getBool("enable_rollback_recording"); server["password"] = g_settings->getBool("disallow_empty_password"); server["pvp"] = g_settings->getBool("enable_pvp"); server["clients"] = clients; @@ -221,6 +219,10 @@ void sendAnnounce(std::string action, u16 clients, double uptime, std::string ga } if(server["action"] == "start") { + server["dedicated"] = g_settings->get("server_dedicated"); + server["rollback"] = g_settings->getBool("enable_rollback_recording"); + server["liquid_finite"] = g_settings->getBool("liquid_finite"); + server["mapgen"] = g_settings->get("mg_name"); server["mods"] = Json::Value(Json::arrayValue); for(std::vector::iterator m = m_mods.begin(); m != m_mods.end(); m++) { server["mods"].append(m->name); diff --git a/util/master/list.js b/util/master/list.js index 15319e1c..f428a1cd 100644 --- a/util/master/list.js +++ b/util/master/list.js @@ -41,7 +41,7 @@ function human_time(t, abs) { function success(r) { if (!r || !r.list) return; - var h = ''; + var h = '
ip[:port]clients/maxversion gameidnamedescriptionflagsuptimeping
'; for (var i = 0; i < r.list.length; ++i) { var s = r.list[i]; if (!s) continue; @@ -49,13 +49,13 @@ function success(r) { h += ''; h += ''; h += ''; - var mods; + var mods = 0; if (s.mods && jQuery.isArray(s.mods)) { mods = s.mods.length; } - h += ''; h += ''; - h += ''; + h += ''; if (!s.start || s.start < 0) s.start = 0; h += ''; h += '';
ip[:port]clients/maxversion gameid mapgennamedescriptionflagsuptimeping
' + e(s.address) + (s.port != 30000 ? (':' + e(s.port)) : '') + '' + e(s.clients) + (s.clients_max ? '/' + e(s.clients_max) : '') + (s.clients_top ? ', ' + s.clients_top : '') + '' + e(s.version) + ' ' + e(s.gameid); + h += '' + e(s.version) + ' ' + e(s.gameid) ' ' + e(s.mapgen); if (mods) { - h += '
Mods:
'; + h += '
Mods ('+mods+'):
'; for (m in s.mods) { h += s.mods[m] + '
'; } @@ -70,7 +70,15 @@ function success(r) { if (s.url) h += ''; h += '
' + e(s.description) + '' + e(s.password ? 'Pwd ' : '') + (s.creative ? 'Cre ' : '') + (s.damage ? 'Dmg ' : '') + (s.pvp ? 'Pvp ' : '') + (s.dedicated ? 'Ded ' : '') + (s.rollback ? 'Rol ' : '') + '' + + (s.password ? 'Pwd ' : '') + + (s.creative ? 'Cre ' : '') + + (s.damage ? 'Dmg ' : '') + + (s.pvp ? 'Pvp ' : '') + + (s.dedicated ? 'Ded ' : '') + + (s.rollback ? 'Rol ' : '') + + (s.liquid_finite ? 'Liq ' : '') + + '' + (s.uptime ? human_time(s.uptime, 1) : s.start ? human_time(s.start) : '') + '' + (s.ping ? parseFloat(s.ping).toFixed(3) * 1000 : '') + '