Page 1 of 1

Sharing Violation, ES2 2.6.7

Posted: Wed Apr 27, 2016 2:00 am
by vanishing_realms
One of my users (many users actually) are unable to save games. This user is seeing a Sharing Violation from within ES2. I'm running ES2 version 2.6.7 on unity 5.2.3f1. Any ideas what this is caused by? Seems to be prevalent on windows 10, but that may not be relevant. The file gamedata.bin uses encryption, and this error is occurring during application shutdown while I attempt to save the game. I've re-written the system to use writers/readers and I now save the game before exit, but I'd still like to understand what the cause of this error is.

_____
Saving to location: C:/Users/Declan/AppData/LocalLow/IndimoLabs/Vanishing Realms

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 64)

IOException: Sharing violation on path C:\Users\Declan\AppData\LocalLow\IndimoLabs\Vanishing Realms\gamedata.bin
at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in <filename unknown>:0

at System.IO.FileStream..ctor (System.String path, FileMode mode) [0x00000] in <filename unknown>:0

at ES2FileUtility.CreateFileStream (System.String path, ES2FileMode filemode) [0x00000] in <filename unknown>:0

at ES2FileStream.CreateStorageStream () [0x00000] in <filename unknown>:0

at ES2FileStream.Store () [0x00000] in <filename unknown>:0

at ES2Writer.Save (Boolean checkForOverwrite) [0x00000] in <filename unknown>:0

at ES2Writer.Save () [0x00000] in <filename unknown>:0

at ES2.Save[String] (System.String param, System.String identifier, .ES2Settings settings) [0x00000] in <filename unknown>:0

at TheInventory.SaveGeneralInventoryItems () [0x00000] in <filename unknown>:0

at TheInventory.Save (System.String playerName) [0x00000] in <filename unknown>:0

at TheApplication.OnApplicationQuit () [0x00000] in <filename unknown>:0

Re: Sharing Violation, ES2 2.6.7

Posted: Wed Apr 27, 2016 7:24 am
by Joel
Hi there,

Easy Save itself isn't capable of causing sharing violations unless you're attempting to use it in a separate thread, so something must be trying to access the file externally.

This sometimes happens with cloud syncing software (such as Steam Cloud). In this case, it is usually best to save prior to quitting the application as it's usually quitting the application which causes the syncing to happen.

Its also worth updating to 2.7 (as always, it's worth backing up before you do this) incase Unity have made any changes at their end which conflicts with the earlier version.

All the best,
Joel

Re: Sharing Violation, ES2 2.6.7

Posted: Thu Apr 28, 2016 9:30 pm
by vanishing_realms
Thanks for the quick reply, this helps! I no longer save during quit, and I'm also using a different DRM solution.

Re: Sharing Violation, ES2 2.6.7

Posted: Mon Jun 13, 2016 11:46 pm
by trendtimer
Hi, just wanted to say that it looks like I'm in good company here. Vanishing Realms is a great game! I've just started using ES2 for a VR game I'm working. I was inspired to create a game after seeing great games like yours. thanks!