source: binary-improvements/MapRendering/Web/API/GetStats.cs@ 244

Last change on this file since 244 was 244, checked in by alloc, 10 years ago

Fixes intermediate state

File size: 830 bytes
Line 
1using AllocsFixes.JSON;
2using AllocsFixes.PersistentData;
3using System;
4using System.Collections.Generic;
5using System.Net;
6
7namespace AllocsFixes.NetConnections.Servers.Web.API
8{
9 public class GetStats : WebAPI
10 {
11 public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel)
12 {
13 JSONObject result = new JSONObject ();
14
15 JSONObject time = new JSONObject ();
16 time.Add ("days", new JSONNumber (GameUtils.WorldTimeToDays (GameManager.Instance.World.worldTime)));
17 time.Add ("hours", new JSONNumber (GameUtils.WorldTimeToHours (GameManager.Instance.World.worldTime)));
18 time.Add ("minutes", new JSONNumber (GameUtils.WorldTimeToMinutes (GameManager.Instance.World.worldTime)));
19 result.Add ("gametime", time);
20
21 WriteJSON (resp, result);
22 }
23 }
24}
25
Note: See TracBrowser for help on using the repository browser.