OpenFactorioServerManager / factorio-server-manager

A tool to help manage Factorio multiplayer servers including mods and save games.
MIT License
541 stars 130 forks source link

Truncate config files when resaving. #295

Closed sean-callahan closed 2 years ago

sean-callahan commented 2 years ago

Before this change config files would have remnants of the previous file's data. Now when saving, truncate the file before rewriting the JSON data. This may possibly fix #294 as well.

knoxfighter commented 2 years ago

Does this also fix the \ problem? https://github.com/OpenFactorioServerManager/factorio-server-manager/issues/294

sean-callahan commented 2 years ago

Does this also fix the \ problem? #294

No, I incorrectly thought this would fix the issue. Looks like all backslashes (\) will need to be escaped (\\) as per the JSON spec, or unless we write our own decoder.

knoxfighter commented 2 years ago

oh, i thought json does allow single \. It doesn't :( That is not a problem of this program but how people use json.