diff --git a/util/master/README.md b/util/master/README.md new file mode 100644 index 000000000..4730dc269 --- /dev/null +++ b/util/master/README.md @@ -0,0 +1,24 @@ +Minetest server list +==================== + +Setting up the webpage +---------------------- +You will have to install node.js, doT.js and their dependencies to compile +the serverlist webpage template. + +First install node.js, eg: + # apt-get install nodejs + # pacman -S nodejs + # emerge nodejs + +Then install doT.js and it's dependencies: + $ cd ~/code + $ git clone https://github.com/olado/doT.git + $ cd doT + $ npm install + +And finally compile the template: + $ cd ~/minetest/util/master + $ ~/code/doT/bin/dot-packer -s . -d . + + diff --git a/util/master/index.html b/util/master/index.html index ad908fca8..339ebe565 100644 --- a/util/master/index.html +++ b/util/master/index.html @@ -1,12 +1,15 @@ -
- -ip[:port] | '; - if (!master.no_clients) h += 'players/max | '; - if (!master.no_version) h += 'version gameid mapgen | '; - if (!master.no_name) h += 'name | '; - if (!master.no_description) h += 'description | '; - if (!master.no_flags) h += 'flags | '; - if (!master.no_uptime) h += 'uptime age | '; - if (!master.no_ping) h += 'ping | '; - h += '
---|---|---|---|---|---|---|---|
' + e(s.address) + (s.port != 30000 ? (':' + e(s.port)) : '') + ' | '; - if (!master.no_clients) { - h += '';
- if (!master.no_clients_list && s.clients && s.clients_list) {
- h += ' Players (' + e(s.clients) + '): ';
- }
- h += e(s.clients) + (s.clients_max ? '/' + e(s.clients_max) : '') + (s.clients_top ? ', ' + e(s.clients_top) : '') + ''; - for (var ii in s.clients_list) - h += e(s.clients_list[ii]) + ' '; - h += ' | ';
- }
- var mods = 0;
- if (s.mods && jQuery.isArray(s.mods))
- mods = s.mods.length;
- if (!master.no_version) {
- h += '' + e(s.version) + ' ' + e(s.gameid) + ' ' + e(s.mapgen);
- if (!master.no_mods && mods) {
- h += ' Mods (' + mods + '): ';
- }
- h += ''; - for (var ii in s.mods) - h += e(s.mods[ii]) + ' '; - h += ' | ';
- }
- if (!master.no_name) {
- h += ''; - if (s.url) h += ''; - h += e(s.name || s.url); - if (s.url) h += ''; - h += ' | '; - } - if (!master.no_description) h += '' + e(s.description) + ' | '; - if (!master.no_flags) { - h += '' + - (s.password ? 'Pwd ' : '') + - (s.creative ? 'Cre ' : '') + - (s.damage ? 'Dmg ' : '') + - (s.pvp ? 'Pvp ' : '') + - (s.dedicated ? 'Ded ' : '') + - (s.rollback ? 'Rol ' : '') + - (s.liquid_finite ? 'Liq ' : '') + - ' | '; - } - if (!s.start || s.start < 0) s.start = 0; - if (!master.no_uptime) h += '' + (s.uptime ? human_time(s.uptime, 1) : s.start ? human_time(s.start) : '') + (s.game_time ? ' ' + human_time(s.game_time, 1) : '') + ' | '; - if (!master.no_ping) h += '' + (s.ping ? parseFloat(s.ping).toFixed(3) * 1000 : '') + ' | '; - h += '
IP[:Port] | {{?}} + {{? !master.no_clients}}Players/Max | {{?}} + {{? !master.no_version}}Version, Gameid, MapGen | {{?}} + {{? !master.no_name}}Name | {{?}} + {{? !master.no_description}}Description | {{?}} + {{? !master.no_flags}}Flags | {{?}} + {{? !master.no_uptime}}Uptime, Age | {{?}} + {{? !master.no_ping}}Ping | {{?}} +
---|---|---|---|---|---|---|---|
+ {{=addressString(server)}} + | {{?}} + {{? !master.no_clients}} ++ {{=server.clients}}/{{=server.clients_max}} {{=server.clients_top}} + {{=hoverList("Clients", server.clients_list)}} + | {{?}} + {{? !master.no_version}} ++ {{=escapeHTML(server.version)}}, {{=escapeHTML(server.gameid)}}, + {{=escapeHTML(server.mapgen || '?')}} + {{=hoverList("Mods", server.mods)}} + | {{?}} + {{? !master.no_name}} ++ {{? server.url}} + {{=tooltipString(server.name, 25)}} + {{??}} + {{=tooltipString(server.name, 25)}} + {{?}} + | {{?}} + {{? !master.no_description}} ++ {{=tooltipString(server.description, 50)}} + | {{?}} + {{? !master.no_flags}} ++ {{=server.creative ? 'Cre ' : ''}} + {{=server.dedicated ? 'Ded ' : ''}} + {{=server.damage ? 'Dmg ' : ''}} + {{=server.liquid_finite ? 'Liq ' : ''}} + {{=server.pvp ? 'PvP ' : ''}} + {{=server.password ? 'Pwd ' : ''}} + {{=server.rollback ? 'Rol ' : ''}} + | {{?}} + {{? !master.no_uptime}} ++ {{=humanTime(server.uptime)}}, {{=humanTime(server.game_time)}} + | {{?}} + {{? !master.no_ping}} ++ {{=Math.floor(server.ping * 1000)}} + | {{?}} +