From 5247bf77fea3cc38ce7a1fcf510f8eab4dd3171d Mon Sep 17 00:00:00 2001 From: fatboy Date: Thu, 18 Apr 2024 13:32:47 -0500 Subject: [PATCH] luauptime shows boxed and active players online --- src/engine/server/world/WorldServer.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/engine/server/world/WorldServer.java b/src/engine/server/world/WorldServer.java index 65b6b8c6..b5772abf 100644 --- a/src/engine/server/world/WorldServer.java +++ b/src/engine/server/world/WorldServer.java @@ -167,7 +167,16 @@ public class WorldServer { long uptimeSeconds = Math.abs(uptimeDuration.getSeconds()); String uptime = String.format("%d hours %02d minutes %02d seconds", uptimeSeconds / 3600, (uptimeSeconds % 3600) / 60, (uptimeSeconds % 60)); outString += "uptime: " + uptime; - outString += " pop: " + SessionManager.getActivePlayerCharacterCount() + " max pop: " + SessionManager._maxPopulation; + //outString += " pop: " + SessionManager.getActivePlayerCharacterCount() + " max pop: " + SessionManager._maxPopulation; + int activePlayers = 0; + int boxedPlayers = 0; + for(PlayerCharacter pc : SessionManager.getAllActivePlayerCharacters()) { + if (pc.isBoxed) + boxedPlayers ++; + else + activePlayers ++; + } + outString += " active pop: " + activePlayers + " boxed pop: " + boxedPlayers; } catch (Exception e) { Logger.error("Failed to build string"); }