Page 1 of 1

IOException Error

Posted: Sun Dec 10, 2017 8:20 am
by Calandryll
Hi! I've been using Easysave for my game and it's been awesome! My game saves a lot of data, so saving often takes about 2-3 seconds to finish. Which is fine for when the player saves and leaves the game.

However, in working on using it as an auto-save and moving it to a separate thread so that the delay doesn't impact gameplay, I get this error:

IOException: Sharing violation on path... and then it lists the path and the safe file.

The save DOES seem to work, however I'm reluctant to push this change live with an error like that. Is there anyway to facilitate a save on a separate thread without getting this error?

Thanks!

Edit: forgot to add that I am using version 2.8.3

Re: IOException Error

Posted: Mon Dec 11, 2017 9:27 am
by Joel
Hi there,

Easy Save isn't officially supported in a separate thread because much of Unity's API isn't thread safe.

However, if you do decide to use it outside the main thread (many people do with no issues), you will need to make sure that Easy Save is only used in one thread at a time. You should not save to/load from multiple files at the same time.

If you're not already doing so, you might find that using an ES2Writer/ES2Reader will improve performance significantly, rather than using a separate thread: http://docs.moodkie.com/easy-save-2/gui ... es2reader/

All the best,
Joel

Re: IOException Error

Posted: Tue Dec 12, 2017 3:22 am
by Calandryll
Thank you, I will check that out!