Changeset 309 for binary-improvements/MapRendering/Web/API
- Timestamp:
- Aug 9, 2017, 7:43:07 PM (7 years ago)
- Location:
- binary-improvements/MapRendering/Web/API
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
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";
Note:
See TracChangeset
for help on using the changeset viewer.