that can explain disconnect in MP? 9ms only for requests if we add UI and another runtime >16ms
log:
Code: Select all
751.568 Script @__test__/control.lua:7: ------------------------
751.568 Script @__test__/control.lua:8: Test translation request
751.568 Script @__test__/control.lua:9: Elapsed: 0.043500ms
751.568 Script @__test__/control.lua:12: Count items: 1514
751.577 Script @__test__/control.lua:17: Count fluids: 171
751.578 Script @__test__/control.lua:21: Elapsed: 9.998000ms
Code: Select all
local test = {}
function test.run(event)
local profiler = game.create_profiler()
profiler.reset()
log("------------------------")
log("Test translation request")
log(profiler)
local player = game.players[event.player_index]
local items = game.item_prototypes
log("Count items: "..#items)
for _,item in pairs(items) do
player.request_translation(item.localised_name)
end
local fluids = game.fluid_prototypes
log("Count fluids: "..#fluids)
for _,fluid in pairs(fluids) do
player.request_translation(fluid.localised_name)
end
log(profiler)
end
commands.add_command("test","request", test.run)