I invite everyone to try the following:
Code: Select all
public void TrivialTest()
{
ES3File myFile = new ES3File("Filename.es3",false);
myFile.Save<int>("myKey", 0);
myFile.Sync();
}
(typically something like users/yourname/AppData/LocalLow/somecompany/someapp/ )
Find the file, and open it in notepad or similar. Content of the file should now be:
{"myKey":{"__type":"System.Int32","value":0}}
Stop execution. Change line 3 above to:
myFile.Save<int>("myKey", 1);
run again, and reopen the file from before. Content is now:
{"myKey":{"__type":"System.Int32","value":1},"myKey":{"__type":"System.Int32","value":0}}
So. instead of overwriting the value of myKey (as stated in the documentation), a new key-pair value has been added to the file. Presumably, if you read the value back from the file, you're fine, you get the latest value because it's the value you find first, but each time. EACH TIME, you try to overwrite a value, you will instead APPEND the value to the file.
I wouldn't be so pissed off, if this was an obscure usecase, but this is CORE functionality. it is literally the MOST central functionality easysave provides, and the implementation is insane. That makes me loose ALL trust that the remainder of easy save is safe to use.
Combined with the issues I've been having with cloudsave, I unfortunately must conclude that I am out of here, and I recommend anyone using easysave for anything non-trivial to check ALL your assumptions about what Easy save is doing for you.