source: binary-improvements/webserver/js/stats.js@ 271

Last change on this file since 271 was 251, checked in by peter.souza, 9 years ago

Enemies (zombies and hostile animal entities) are now shown on the map as Hostiles and require permission level 'webapi.gethostilelocation' for web viewers to see.

Animals (non-hostile entities) are now shown on the map as Animals and require permission level 'webapi.getanimalslocation' for web viewers to see.

Permission level for 'webapi.viewallclaims' is now required for a viewer to see all claims, otherwise the permission level for 'webapi.getlandclaims' will only show viewer-owned claims. A viewer requires both 'webapi.getlandclaims' and 'webapi.viewallclaims' to be set for all claims to show (you can't just set 'webapi.viewallclaims').
https://7daystodie.com/forums/showthread.php?12837-Improvements-for-the-dedicated-server&p=317405&viewfull=1#post317405

Permission level for 'webapi.viewallplayers' is now required for a viewer to see all players, otherwise the permission level for 'webapi.getplayerslocation' will only show the player for the currently-authenticated viewer. A viewer requires both 'webapi.getplayerslocation' and 'webapi.viewallplayers' to be set for all players to show (you can't just set 'webapi.viewallplayers').
https://7daystodie.com/forums/showthread.php?12837-Improvements-for-the-dedicated-server&p=317405&viewfull=1#post317405

Banned players are now hidden from the web map.
https://7daystodie.com/forums/showthread.php?12837-Improvements-for-the-dedicated-server&p=320702&viewfull=1#post320702

Items using 'CustomIcon' and 'CustomIconTint' are now supported (although the exact tinting may not be perfectly the same as the game).
https://7daystodie.com/forums/showthread.php?12837-Improvements-for-the-dedicated-server&p=317117&viewfull=1#post317117
https://7daystodie.com/forums/showthread.php?12837-Improvements-for-the-dedicated-server&p=317679&viewfull=1#post317679

Map marker icons for players, hostiles, and animals have been updated.

File size: 1.7 KB
RevLine 
[245]1function StartStatsModule () {
2 var updateGameTimeEvent = function() {
3 $.getJSON( "../api/getstats")
4 .done(function(data) {
5 var time = "Day " + data.gametime.days + ", ";
6 if (data.gametime.hours < 10)
7 time += "0";
8 time += data.gametime.hours;
9 time += ":";
10 if (data.gametime.minutes < 10)
11 time += "0";
12 time += data.gametime.minutes;
13
14 $("#stats_time").html (time);
15 $("#stats_players").html (data.players);
[251]16 $("#stats_hostiles").html (data.hostiles);
17 $("#stats_animals").html (data.animals);
[245]18 })
19 .fail(function(jqxhr, textStatus, error) {
20 console.log("Error fetching game stats");
21 })
22 .always(function() {
23 });
24 window.setTimeout(updateGameTimeEvent, 2000);
25 };
26 updateGameTimeEvent();
27}
28
[250]29function StartUIUpdatesModule () {
30 var updateGameTimeEvent = function() {
31 $.getJSON( "../api/getwebuiupdates?latestLine=" + lastLogLine)
32 .done(function(data) {
33 var time = "Day " + data.gametime.days + ", ";
34 if (data.gametime.hours < 10)
35 time += "0";
36 time += data.gametime.hours;
37 time += ":";
38 if (data.gametime.minutes < 10)
39 time += "0";
40 time += data.gametime.minutes;
41
42 $("#stats_time").html (time);
43 $("#stats_players").html (data.players);
[251]44 $("#stats_hostiles").html (data.hostiles);
45 $("#stats_animals").html (data.animals);
[250]46 $("#newlogcount").html (data.newlogs);
47 if (data.newlogs > 0) {
48 $("#newlogcount").addClass ("visible");
49 } else {
50 $("#newlogcount").removeClass ("visible");
51 }
52 })
53 .fail(function(jqxhr, textStatus, error) {
54 console.log("Error fetching ui updates");
55 })
56 .always(function() {
57 });
58 window.setTimeout(updateGameTimeEvent, 2000);
59 };
60 updateGameTimeEvent();
61}
62
Note: See TracBrowser for help on using the repository browser.