Changeset 309 for binary-improvements/MapRendering
- Timestamp:
- Aug 9, 2017, 7:43:07 PM (7 years ago)
- Location:
- binary-improvements/MapRendering
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/MapRendering/ModInfo.xml
r306 r309 5 5 <Description value="Render the game map to image map tiles as it is uncovered" /> 6 6 <Author value="Christian 'Alloc' Illy" /> 7 <Version value="2 0" />7 <Version value="21" /> 8 8 <Website value="http://7dtd.illy.bz" /> 9 9 </ModInfo> -
binary-improvements/MapRendering/Web/API/GetPlayerList.cs
r279 r309 67 67 68 68 pJson.Add ("totalplaytime", new JSONNumber (p.TotalPlayTime)); 69 pJson.Add ("lastonline", new JSONString (p.LastOnline.ToUniversalTime ().ToString (" s")));69 pJson.Add ("lastonline", new JSONString (p.LastOnline.ToUniversalTime ().ToString ("yyyy-MM-ddTHH:mm:ssZ"))); 70 70 pJson.Add ("ping", new JSONNumber (p.IsOnline ? p.ClientInfo.ping : -1)); 71 71 -
binary-improvements/MapRendering/Web/API/GetPlayersOnline.cs
r277 r309 26 26 p.Add ("steamid", new JSONString (ci.playerId)); 27 27 p.Add ("entityid", new JSONNumber (ci.entityId)); 28 p.Add ("ip", new JSONString (ci != null ? ci.ip : string.Empty));28 p.Add ("ip", new JSONString (ci.ip)); 29 29 p.Add ("name", new JSONString (current.Value.EntityName)); 30 30 p.Add ("online", new JSONBoolean (true)); -
binary-improvements/MapRendering/Web/API/WebAPI.cs
r306 r309 9 9 public static void WriteJSON (HttpListenerResponse resp, JSON.JSONNode root) 10 10 { 11 byte[] buf = Encoding.UTF8.GetBytes (root.ToString()); 11 StringBuilder sb = new StringBuilder (); 12 root.ToString (sb); 13 byte[] buf = Encoding.UTF8.GetBytes (sb.ToString ()); 12 14 resp.ContentLength64 = buf.Length; 13 15 resp.ContentType = "application/json"; -
binary-improvements/MapRendering/Web/Handlers/UserStatusHandler.cs
r244 r309 28 28 result.Add ("permissions", perms); 29 29 30 WriteJSON (resp, result); 31 } 32 33 public void WriteJSON (HttpListenerResponse resp, JSONNode root) { 34 byte[] buf = Encoding.UTF8.GetBytes (root.ToString ()); 35 resp.ContentLength64 = buf.Length; 36 resp.ContentType = "application/json"; 37 resp.ContentEncoding = Encoding.UTF8; 38 resp.OutputStream.Write (buf, 0, buf.Length); 30 AllocsFixes.NetConnections.Servers.Web.API.WebAPI.WriteJSON (resp, result); 39 31 } 40 32 -
binary-improvements/MapRendering/Web/Web.cs
r286 r309 78 78 dataFolder, 79 79 new AllocsFixes.FileCache.SimpleCache (), 80 true)80 false) 81 81 ); 82 82 } else { … … 87 87 dataFolder, 88 88 new AllocsFixes.FileCache.DirectAccess (), 89 true)89 false) 90 90 ); 91 91 } … … 185 185 } 186 186 187 Log.Out ("Error in Web.HandleRequest(): No handler found for path \"" + request.Url.AbsolutePath + "\""); 187 // Not really relevant for non-debugging purposes: 188 //Log.Out ("Error in Web.HandleRequest(): No handler found for path \"" + request.Url.AbsolutePath + "\""); 188 189 response.StatusCode = (int)HttpStatusCode.NotFound; 189 190 } catch (IOException e) { -
binary-improvements/MapRendering/Web/WebCommandResult.cs
r306 r309 47 47 } 48 48 49 response.SendChunked = false; 49 try { 50 response.SendChunked = false; 50 51 51 try {52 52 if (responseType == ResultType.Raw) { 53 53 WebAPI.WriteText (response, sb.ToString ());
Note:
See TracChangeset
for help on using the changeset viewer.