luauptime shows boxed and active players online

This commit is contained in:
2024-04-18 13:32:47 -05:00
parent f8a584d000
commit 5247bf77fe
+10 -1
View File
@@ -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");
}