Use encode_string and support multiple instances

This commit is contained in:
Danielv123 committed 2025-08-10 00:28:48 +02:00
1 parent c62eae0009
commit 5b9f650946
3 files changed
+93 -60

No files matched your search

+3 -1
View File
@@ -34,7 +34,9 @@ local function dump_chunk_chart(chunk_position)
for _, surface in pairs(surfaces) do
local chart_data = force.get_chunk_chart(surface, chunk_position)
if chart_data then
table.insert(data, {surface = surface.name, force = force.name, chart_data = chart_data})
-- Use Factorio's built-in deflate compression and base64 encoding
local encoded_data = helpers.encode_string(chart_data)
table.insert(data, {surface = surface.name, force = force.name, chart_data = encoded_data})
end
end
end