server status api
This commit is contained in:
parent
6a39a2960e
commit
cf91c97812
@ -65,7 +65,17 @@ namespace Campofinale.Http
|
|||||||
await data(ctx);
|
await data(ctx);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
[StaticRoute(HttpServerLite.HttpMethod.GET, "/serverStatus")]
|
||||||
|
public static async Task serverStatus(HttpContext ctx)
|
||||||
|
{
|
||||||
|
string resp = "{\"maxPlayers\":" + Server.config.serverOptions.maxPlayers + ", \"players\":" + Server.clients.Count + ", \"status\":\"Online\"}";
|
||||||
|
|
||||||
|
ctx.Response.StatusCode = 200;
|
||||||
|
ctx.Response.ContentLength = resp.Length;
|
||||||
|
ctx.Response.ContentType = "application/json";
|
||||||
|
|
||||||
|
await ctx.Response.SendAsync(resp);
|
||||||
|
}
|
||||||
[StaticRoute(HttpServerLite.HttpMethod.POST, "/u8/pay/getAllProductList")]
|
[StaticRoute(HttpServerLite.HttpMethod.POST, "/u8/pay/getAllProductList")]
|
||||||
public static async Task getAllProductList(HttpContext ctx)
|
public static async Task getAllProductList(HttpContext ctx)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user