mirror of
https://git.muiegratis.online/suikoakari/Campofinale
synced 2025-12-16 11:34:39 +01:00
server status api
This commit is contained in:
@@ -65,7 +65,17 @@ namespace Campofinale.Http
|
||||
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")]
|
||||
public static async Task getAllProductList(HttpContext ctx)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user