Page 1 of 1

[0.15.19] Desync using game.write_file as an admin client

Posted: Sun Jun 11, 2017 11:36 am
by Chanz
What did you do?
I used the following code on my factorio client while I was connected to my factorio server. My client has admin permissions.
The client and server has no mods installed.

Code: Select all

/c count = 0  for k,v in pairs(game.players) do   if (v.connected) then       count = count + 1      end  end  game.write_file("./", "", false, count)
Formatted:

Code: Select all

/c 
count = 0
for k,v in pairs(game.players) do
	if (v.connected) then
	   count = count + 1
	end
end
game.write_file("./", "", false, count)
What happened?
Desync after pressing enter.

What did you expect to happen instead?
The game creates a file on the client/server or throws a error that files can't be written to client/server.

Write down the steps to reproduce the bug if you know them.
Execute the above code and the desync happens.

Does it happen always, once, or sometimes?
Happens always.

Download desync report
http://bcserv.eu/downloads/desync-report.zip

Re: [0.15.19] Desync using game.write_file as an admin client

Posted: Sun Jun 11, 2017 5:14 pm
by Rseding91
Please upload the desync report.

Re: [0.15.19] Desync using game.write_file as an admin client

Posted: Sun Jun 11, 2017 10:39 pm
by Chanz
Rseding91 wrote:Please upload the desync report.
Sorry, I added the report now. Thanks for your work! :-)

Re: [0.15.19] Desync using game.write_file as an admin client

Posted: Mon Jun 12, 2017 12:09 am
by Rseding91
The game creates a file on the client/server or throws a error that files can't be written to client/server.
This is exactly what's happening :) The file can't be written on the client because access is denied to the script-output directory on the client.

I'll change it for the next version of 0.15 so it silently records the error in the log file instead producing a game error so it won't cause desyncs if it fails on someones computer.

Re: [0.15.19] Desync using game.write_file as an admin client

Posted: Mon Jun 12, 2017 7:58 pm
by Chanz
Thanks that sounds great.