ArgumentException when using ES3.CacheFile

Discussion and help for Easy Save 3
Post Reply
doodlinbee
Posts: 23
Joined: Sat Sep 05, 2020 12:53 pm

ArgumentException when using ES3.CacheFile

Post by doodlinbee »

When I do "ES3.CacheFile("saveName") I get this exception:

Code: Select all

ArgumentException: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
ES3Internal.ES3Stream.CreateStream (System.IO.Stream stream, ES3Settings settings, ES3Internal.ES3FileMode fileMode) (at Assets/Plugins/Easy Save 3/Scripts/Streams/ES3Stream.cs:102)
ES3Reader.Create (System.Byte[] bytes, ES3Settings settings) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:348)
ES3File.SaveRaw (System.Byte[] bytes, ES3Settings settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3File.cs:167)
ES3File..ctor (System.Byte[] bytes, ES3Settings settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3File.cs:83)
ES3File.CacheFile (ES3Settings settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3File.cs:355)
ES3.CacheFile (ES3Settings settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:1049)
ES3.CacheFile (System.String filePath, ES3Settings settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:1039)
Note that this exception only occurs when the "Encryption" setting in 'AES'. I don't get the problem when I don't use encryption
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: ArgumentException when using ES3.CacheFile

Post by Joel »

Hi there,

The issue is likely because you save file contains data which isn’t encrypted, in which case deleting your save data will resolve the issue (Tools > Easy Save 3 > Clear PersistentDataPath).

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
doodlinbee
Posts: 23
Joined: Sat Sep 05, 2020 12:53 pm

Re: ArgumentException when using ES3.CacheFile

Post by doodlinbee »

That unfortunately didn't solve the problem.
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: ArgumentException when using ES3.CacheFile

Post by Joel »

Hi there,

Please could you replicate this in a new project with a simple scene and private message it to me so I can see what is happening?

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply