From 5e433fa913cc21d4d3c9ba1ef341c3c7aedc128c Mon Sep 17 00:00:00 2001 From: proller Date: Sat, 3 Aug 2013 03:02:59 +0400 Subject: [PATCH] More info in serverlist --- src/serverlist.cpp | 6 ++++-- util/master/list.js | 18 +++++++++++++----- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/serverlist.cpp b/src/serverlist.cpp index 7a374eb47..bc09f6c0a 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 15319e1c9..f428a1cd1 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 : '') + '