|
123456789101112131415161718192021 |
- using System.Net;
- using System.Text;
-
- namespace CLre_server.WebStatus
- {
- public class ConfigurationEndpoints
- {
- [WebEndpoint("/c/game.json")]
- public static void GameServerSettings (HttpListenerContext ctx)
- {
- ctx.Response.Headers.Add("Content-Type", "application/json");
- GameServer.GameServerSettings gss = API.MainServer.Server.Instance.GameServerSettings;
- string json = UnityEngine.JsonUtility.ToJson(gss);
- #if DEBUG
- API.Utility.Logging.MetaLog("JSONified settings: " + json);
- #endif
- byte[] output = Encoding.UTF8.GetBytes(json);
- ctx.Response.OutputStream.Write(output, 0, output.Length);
- }
- }
- }
|