From 7b44e830f8605c874ed889ec91240b23b468c792 Mon Sep 17 00:00:00 2001 From: Thomas Deal Date: Wed, 19 Oct 2016 16:52:55 -0400 Subject: [PATCH] Write files only to the server by default, changeable via setFilePlayer() --- clusterio_0.0.2/control.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/clusterio_0.0.2/control.lua b/clusterio_0.0.2/control.lua index 4152db57..b72950db 100644 --- a/clusterio_0.0.2/control.lua +++ b/clusterio_0.0.2/control.lua @@ -283,7 +283,7 @@ function ExportInputList() --only write to file once as i/o is slow --it's much faster to concatenate all the lines with table.concat --instead of doing it with the .. operator - game.write_file(OUTPUT_FILE, table.concat(exportStrings), true) + game.write_file(OUTPUT_FILE, table.concat(exportStrings), true, global.write_file_player or 0) end end @@ -298,7 +298,7 @@ function ExportOutputList() --only write to file once as i/o is slow --it's much faster to concatenate all the lines with table.concat --instead of doing it with the .. operator - game.write_file(ORDER_FILE, table.concat(exportStrings), true) + game.write_file(ORDER_FILE, table.concat(exportStrings), true, global.write_file_player or 0) end end @@ -393,7 +393,7 @@ function HandleTXCombinators() if #frame > 0 then table.insert(frame,{count=game.tick,name="signal-srctick",type="virtual"}) - game.write_file(TX_BUFFER_FILE, json:encode(frame).."\n", true) + game.write_file(TX_BUFFER_FILE, json:encode(frame).."\n", true, global.write_file_player or 0) -- Loopback for testing --AddFrameToRXBuffer(frame) @@ -465,4 +465,7 @@ remote.add_interface("clusterio", end return buffer end, + setFilePlayer = function(i) + global.write_file_player = i + end })