Unofficial CardLife revival project, pronounced like "celery"
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
709B

  1. using System.Net;
  2. using System.Text;
  3. namespace CLre_server.WebStatus
  4. {
  5. public class ConfigurationEndpoints
  6. {
  7. [WebEndpoint("/c/game.json")]
  8. public static void GameServerSettings (HttpListenerContext ctx)
  9. {
  10. ctx.Response.Headers.Add("Content-Type", "application/json");
  11. GameServer.GameServerSettings gss = API.MainServer.Server.Instance.GameServerSettings;
  12. string json = UnityEngine.JsonUtility.ToJson(gss);
  13. #if DEBUG
  14. API.Utility.Logging.MetaLog("JSONified settings: " + json);
  15. #endif
  16. byte[] output = Encoding.UTF8.GetBytes(json);
  17. ctx.Response.OutputStream.Write(output, 0, output.Length);
  18. }
  19. }
  20. }