Replace spaces with tabs for Lua, and more (#399)

Convert code indents to tabs to be consistent with the rest of the
JavaScript code.  This commits covers all of the lua code, some of the
hand written JSON code and the lone HTML and CSS files that were not
using tabs.
This commit is contained in:
Hornwitser authored and GitHub committed 2021-07-13 17:18:44 +02:00
1 parent dbe01c6c23
commit dbe623c9a7
18 files changed
+673 -673

No files matched your search

+26 -26
View File
@@ -1,34 +1,34 @@
local statistics = {
"item_production_statistics",
"fluid_production_statistics",
"kill_count_statistics",
"entity_build_count_statistics",
"item_production_statistics",
"fluid_production_statistics",
"kill_count_statistics",
"entity_build_count_statistics",
}
statistics_exporter = {}
function statistics_exporter.export()
local stats = {
game_tick = game.tick,
player_count = #game.connected_players,
game_flow_statistics = {
pollution_statistics = {
input = game.pollution_statistics.input_counts,
output = game.pollution_statistics.output_counts,
},
},
force_flow_statistics = {}
}
for _, force in pairs(game.forces) do
local flow_statistics = {}
for _, statName in pairs(statistics) do
flow_statistics[statName] = {
input = force[statName].input_counts,
output = force[statName].output_counts,
}
end
stats.force_flow_statistics[force.name] = flow_statistics
end
local stats = {
game_tick = game.tick,
player_count = #game.connected_players,
game_flow_statistics = {
pollution_statistics = {
input = game.pollution_statistics.input_counts,
output = game.pollution_statistics.output_counts,
},
},
force_flow_statistics = {}
}
for _, force in pairs(game.forces) do
local flow_statistics = {}
for _, statName in pairs(statistics) do
flow_statistics[statName] = {
input = force[statName].input_counts,
output = force[statName].output_counts,
}
end
stats.force_flow_statistics[force.name] = flow_statistics
end
rcon.print(game.table_to_json(stats))
rcon.print(game.table_to_json(stats))
end