25 lines
849 B
Lua
25 lines
849 B
Lua
function GetAllLogisticGrids()
|
|
local resultParts = {}
|
|
resultParts[#resultParts+1] = "---logistic-grids---\n"
|
|
for _,surface in pairs(game.surfaces) do
|
|
local grids = game.forces["player"].logistic_networks[surface.name]
|
|
for _,grid in pairs(grids) do
|
|
resultParts[#resultParts+1] = ("%s:%d:%d:%d:%d:%d:%d"):format(
|
|
surface.name,
|
|
grid.network_id,
|
|
grid.all_construction_robots,
|
|
grid.all_logistic_robots,
|
|
grid.available_construction_robots,
|
|
grid.available_logistic_robots,
|
|
grid.robot_limit)
|
|
end
|
|
end
|
|
return table.concat(resultParts, "\n")
|
|
end
|
|
|
|
function SendLogisticStats()
|
|
if options.enableRobots then
|
|
helpers.send_udp(udpAddress,GetAllLogisticGrids(),serverIndex)
|
|
end
|
|
end
|