diff --git a/src/main/java/org/asf/centuria/networking/http/api/custom/ListPlayersHandler.java b/src/main/java/org/asf/centuria/networking/http/api/custom/ListPlayersHandler.java index d10fab87..6bd0bf42 100644 --- a/src/main/java/org/asf/centuria/networking/http/api/custom/ListPlayersHandler.java +++ b/src/main/java/org/asf/centuria/networking/http/api/custom/ListPlayersHandler.java @@ -28,13 +28,15 @@ public void process(String path, String method, RemoteClient client, String cont strm.close(); } catch (Exception e) { } - + // Send response + int counter = 0; JsonObject response = new JsonObject(); HashMap maps = new HashMap(); for (Player plr : Centuria.gameServer.getPlayers()) { if (!plr.roomReady) continue; + counter++; String map = Integer.toString(plr.levelID); if (plr.levelID == 25280) map = "Tutorial"; @@ -42,7 +44,8 @@ else if (helper.has(Integer.toString(plr.levelID))) map = helper.get(Integer.toString(plr.levelID)).getAsString(); maps.put(map, maps.getOrDefault(map, 0) + 1); } - response.addProperty("online", Centuria.gameServer.getPlayers().length); + response.addProperty("active", counter); + response.addProperty("connected", Centuria.gameServer.getPlayers().length); JsonObject mapData = new JsonObject(); maps.forEach((k, v) -> mapData.addProperty(k, v)); response.add("maps", mapData);