public void addServerStatsToSnooper(PlayerUsageSnooper par1PlayerUsageSnooper) { par1PlayerUsageSnooper.addData("whitelist_enabled", Boolean.valueOf(false)); par1PlayerUsageSnooper.addData("whitelist_count", Integer.valueOf(0)); par1PlayerUsageSnooper.addData( "players_current", Integer.valueOf(this.getCurrentPlayerCount())); par1PlayerUsageSnooper.addData("players_max", Integer.valueOf(this.getMaxPlayers())); par1PlayerUsageSnooper.addData( "players_seen", Integer.valueOf(this.serverConfigManager.getAvailablePlayerDat().length)); par1PlayerUsageSnooper.addData("uses_auth", Boolean.valueOf(this.onlineMode)); par1PlayerUsageSnooper.addData("gui_state", this.getGuiEnabled() ? "enabled" : "disabled"); par1PlayerUsageSnooper.addData( "avg_tick_ms", Integer.valueOf((int) (MathHelper.average(this.tickTimeArray) * 1.0E-6D))); par1PlayerUsageSnooper.addData( "avg_sent_packet_count", Integer.valueOf((int) MathHelper.average(this.sentPacketCountArray))); par1PlayerUsageSnooper.addData( "avg_sent_packet_size", Integer.valueOf((int) MathHelper.average(this.sentPacketSizeArray))); par1PlayerUsageSnooper.addData( "avg_rec_packet_count", Integer.valueOf((int) MathHelper.average(this.receivedPacketCountArray))); par1PlayerUsageSnooper.addData( "avg_rec_packet_size", Integer.valueOf((int) MathHelper.average(this.receivedPacketSizeArray))); int i = 0; for (int j = 0; j < this.worldServers.length; ++j) { if (this.worldServers[j] != null) { WorldServer worldserver = this.worldServers[j]; WorldInfo worldinfo = worldserver.getWorldInfo(); par1PlayerUsageSnooper.addData( "world[" + i + "][dimension]", Integer.valueOf(worldserver.provider.dimensionId)); par1PlayerUsageSnooper.addData("world[" + i + "][mode]", worldinfo.getGameType()); par1PlayerUsageSnooper.addData( "world[" + i + "][difficulty]", Integer.valueOf(worldserver.difficultySetting)); par1PlayerUsageSnooper.addData( "world[" + i + "][hardcore]", Boolean.valueOf(worldinfo.isHardcoreModeEnabled())); par1PlayerUsageSnooper.addData( "world[" + i + "][generator_name]", worldinfo.getTerrainType().getWorldTypeName()); par1PlayerUsageSnooper.addData( "world[" + i + "][generator_version]", Integer.valueOf(worldinfo.getTerrainType().getGeneratorVersion())); par1PlayerUsageSnooper.addData( "world[" + i + "][height]", Integer.valueOf(this.buildLimit)); par1PlayerUsageSnooper.addData( "world[" + i + "][chunks_loaded]", Integer.valueOf(worldserver.getChunkProvider().getLoadedChunkCount())); ++i; } } par1PlayerUsageSnooper.addData("worlds", Integer.valueOf(i)); }
public void addServerStatsToSnooper(PlayerUsageSnooper playerSnooper) { playerSnooper.addClientStat("whitelist_enabled", Boolean.valueOf(false)); playerSnooper.addClientStat("whitelist_count", Integer.valueOf(0)); if (this.serverConfigManager != null) { playerSnooper.addClientStat("players_current", Integer.valueOf(this.getCurrentPlayerCount())); playerSnooper.addClientStat("players_max", Integer.valueOf(this.getMaxPlayers())); playerSnooper.addClientStat( "players_seen", Integer.valueOf(this.serverConfigManager.getAvailablePlayerDat().length)); } playerSnooper.addClientStat("uses_auth", Boolean.valueOf(this.onlineMode)); playerSnooper.addClientStat("gui_state", this.getGuiEnabled() ? "enabled" : "disabled"); playerSnooper.addClientStat( "run_time", Long.valueOf( (getCurrentTimeMillis() - playerSnooper.getMinecraftStartTimeMillis()) / 60L * 1000L)); playerSnooper.addClientStat( "avg_tick_ms", Integer.valueOf((int) (MathHelper.average(this.tickTimeArray) * 1.0E-6D))); int var2 = 0; if (this.worldServers != null) { for (int var3 = 0; var3 < this.worldServers.length; ++var3) { if (this.worldServers[var3] != null) { WorldServer var4 = this.worldServers[var3]; WorldInfo var5 = var4.getWorldInfo(); playerSnooper.addClientStat( "world[" + var2 + "][dimension]", Integer.valueOf(var4.provider.getDimensionId())); playerSnooper.addClientStat("world[" + var2 + "][mode]", var5.getGameType()); playerSnooper.addClientStat("world[" + var2 + "][difficulty]", var4.getDifficulty()); playerSnooper.addClientStat( "world[" + var2 + "][hardcore]", Boolean.valueOf(var5.isHardcoreModeEnabled())); playerSnooper.addClientStat( "world[" + var2 + "][generator_name]", var5.getTerrainType().getWorldTypeName()); playerSnooper.addClientStat( "world[" + var2 + "][generator_version]", Integer.valueOf(var5.getTerrainType().getGeneratorVersion())); playerSnooper.addClientStat( "world[" + var2 + "][height]", Integer.valueOf(this.buildLimit)); playerSnooper.addClientStat( "world[" + var2 + "][chunks_loaded]", Integer.valueOf(var4.getChunkProvider().getLoadedChunkCount())); ++var2; } } } playerSnooper.addClientStat("worlds", Integer.valueOf(var2)); }