source: binary-improvements/MapRendering/Web/API/GetWebUIUpdates.cs@ 265

Last change on this file since 265 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.3 KB
Line 
1using AllocsFixes.JSON;
2using AllocsFixes.LiveData;
3using AllocsFixes.PersistentData;
4using System;
5using System.Collections.Generic;
6using System.Net;
7
8namespace AllocsFixes.NetConnections.Servers.Web.API
9{
10 public class GetWebUIUpdates : WebAPI {
11 public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel) {
12 int latestLine;
13 if (req.QueryString ["latestLine"] == null || !int.TryParse (req.QueryString ["latestLine"], out latestLine)) {
14 latestLine = 0;
15 }
16
17 JSONObject result = new JSONObject ();
18
19 JSONObject time = new JSONObject ();
20 time.Add ("days", new JSONNumber (GameUtils.WorldTimeToDays (GameManager.Instance.World.worldTime)));
21 time.Add ("hours", new JSONNumber (GameUtils.WorldTimeToHours (GameManager.Instance.World.worldTime)));
22 time.Add ("minutes", new JSONNumber (GameUtils.WorldTimeToMinutes (GameManager.Instance.World.worldTime)));
23 result.Add ("gametime", time);
24
25 result.Add ("players", new JSONNumber (GameManager.Instance.World.Players.Count));
26 result.Add ("hostiles", new JSONNumber (Hostiles.Count));
27 result.Add ("animals", new JSONNumber (Animals.Count));
28
29 result.Add ("newlogs", new JSONNumber (LogBuffer.Instance.LatestLine - latestLine));
30
31 WriteJSON (resp, result);
32 }
33 }
34}
35
Note: See TracBrowser for help on using the repository browser.