var master_root, output_to; function e(s) { if (typeof s === "undefined") s = ''; return s.replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"'); //mc" } function human_time(t, abs) { var n = 's'; if (!t || t < 0) t = 0; var f = 0; var s = parseInt(abs ? (t || 0) : (new Date().getTime() / 1000 - (t || 0))); if (!s || s <= 0) s = 0; if (s == 0) return 'now'; if (s >= 60) { s /= 60; n = 'm'; if (s >= 60) { s /= 60; n = 'h'; f = 1; if (s >= 24) { s /= 24; n = 'd'; f = 1; if (s >= 30) { s /= 30; n = 'M'; f = 1; if (s >= 12) { s /= 12; n = 'y'; f = 1; } } } } } return ((f ? parseFloat(s).toFixed(1) : parseInt(s)) + n); } function success(r) { if (!r || !r.list) return; var h = '
ip[:port] | clients/max | version gameid | name | description | flags | uptime | ping |
---|---|---|---|---|---|---|---|
' + e(s.address) + (s.port != 30000 ? (':' + e(s.port)) : '') + ' | '; h += '' + e(s.clients) + (s.clients_max ? '/' + e(s.clients_max) : '') + (s.clients_top ? ', ' + s.clients_top : '') + ' | '; h += '' + e(s.version) + ' ' + e(s.gameid) + ' | '; h += ''; if (s.url) h += ''; h += e(s.name || s.url); if (s.url) h += ''; h += ' | '; h += '' + e(s.description) + ' | '; h += '' + e(s.password ? 'Pwd ' : '') + (s.creative ? 'Cre ' : '') + (s.damage ? 'Dmg ' : '') + (s.pvp ? 'Pvp ' : '') + (s.dedicated ? 'Ded ' : '') + ' | '; if (!s.start || s.start < 0) s.start = 0; h += '' + (s.uptime ? human_time(s.uptime, 1) : s.start ? human_time(s.start) : '') + ' | '; h += '' + (s.ping ? parseFloat(s.ping).toFixed(3) * 1000 : '') + ' | '; h += '