Browse Source

luauptime shows boxed and active players online

lakebane-master
fatboy 7 months ago
parent
commit
5247bf77fe
  1. 11
      src/engine/server/world/WorldServer.java

11
src/engine/server/world/WorldServer.java

@ -167,7 +167,16 @@ public class WorldServer {
long uptimeSeconds = Math.abs(uptimeDuration.getSeconds()); long uptimeSeconds = Math.abs(uptimeDuration.getSeconds());
String uptime = String.format("%d hours %02d minutes %02d seconds", uptimeSeconds / 3600, (uptimeSeconds % 3600) / 60, (uptimeSeconds % 60)); String uptime = String.format("%d hours %02d minutes %02d seconds", uptimeSeconds / 3600, (uptimeSeconds % 3600) / 60, (uptimeSeconds % 60));
outString += "uptime: " + uptime; 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) { } catch (Exception e) {
Logger.error("Failed to build string"); Logger.error("Failed to build string");
} }

Loading…
Cancel
Save