Search Unity

Easy Save - The Complete Save Data & Serialization Asset

Discussion in 'Assets and Asset Store' started by JoelAtMoodkie, May 28, 2011.

  1. yomanx

    yomanx

    Joined:
    Dec 5, 2016
    Posts:
    38

    Hey friend,

    We got logs
    Code (CSharp):
    1. Debug.Log(Application.persistentDataPath);
    and see that there no differences between XCODE and TestFlight path.


    We found that TestFlight build always generate new SystemInfo.deviceUniqueIdentifier, what do you think, where is problem?
     
  2. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    914
    Hi there,

    Looking into this deeper it looks like it's intended behaviour for app data to be deleted between updates on TestFlight. For a way around this you would need to contact TestFlight.

    All the best,
    Joel
     
    yomanx likes this.
  3. yomanx

    yomanx

    Joined:
    Dec 5, 2016
    Posts:
    38
    Thanks!

    Can you explore one more issue. ES updated latest version, download from the AssetStore.

    Our tester got bug, he can't load the game (reinstalled a lot of times, nothing helped) and we attached console logs to the build anf got this error:
    ps: Maybe the problem, that first his build was WITHOUT encryption, and then we turned it ON and now server give him old save without encryption and cant read it?

    upload_2020-10-8_23-6-33.png
     
    Last edited: Oct 8, 2020
  4. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    914
    Hi there,

    Judging by the error message it looks like the other way around: encryption isn't enabled in the app, but the data he's trying to download is encrypted.

    All the best,
    Joel
     
  5. yomanx

    yomanx

    Joined:
    Dec 5, 2016
    Posts:
    38
    Ok thanks again.

    One more moment.

    our game have 2 login systems.

    1) guest login
    2) Game Center login

    - so when the player login by guest and then attach GameCenter login he will merge guest login save on GameCenter.

    - BUT when the player install the game on new device, and then he firstly LOGIN by guest and then connect GameCenter - HE will loose his save, because new device guest save will replace save with cleared.

    Any ways to win this issue by standard ES api?
     
  6. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    914
    Hi there,

    Unfortunately this would be a question regarding syncing with GameCenter rather than Easy Save. The only thing you could potentially do from Easy Save's end is to use a different save file name for guest logins than from GameCenter, though I'm unsure if GameCenter will overwrite this.

    All the best,
    Joel
     
  7. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,941
    Hi @JoelAtMoodkie

    We have Save ES3.LoadRawString and SaveRawString
    But what about Delete Raw String?

    Thanks
     
  8. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    914
    Hi @jGate99,

    We have ES3.DeleteFile, which essentially does the same thing as Delete Raw String would.

    All the best,
    Joel
     
    jGate99 likes this.
  9. luizventura

    luizventura

    Joined:
    May 3, 2019
    Posts:
    4
    Hi,

    I'm trying to save an array of ScriptableObjects, this ScriptableObject has some fields and an array with a simple Struct:

    upload_2020-10-14_22-57-13.png

    I've debugged the code and when I call the ES3.Save all values are there. But when I check the save file, almost everything is saved, the only thing that's not there is the array of Structs, it saves like this:

    upload_2020-10-14_23-2-15.png
    Please, can you help me to see what I'm doing wrong?
    Thank you.
     
  10. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    914
    Hi Luiz,

    Properties are not automatically serialised, only fields. Marking them with the [System.Serializable] attribute will ensure that they are serialized.

    All the best,
    Joel
     
    luizventura likes this.
  11. KrejwenBAN

    KrejwenBAN

    Joined:
    Jun 8, 2020
    Posts:
    8
    Hi @JoelAtMoodkie

    I have an exception when I load data from file to ES3 by byte array. In below there is an example of code which make the problem.

    Code (CSharp):
    1. FormatException: Cannot load from file because the data in it is not JSON data, or the data is encrypted.
    2. If the save data is encrypted, please ensure that encryption is enabled when you load, and that you are using the same password used to encrypt the data.
    3. ES3Internal.ES3JSONReader..ctor (System.IO.Stream stream, ES3Settings settings, System.Boolean readHeaderAndFooter) (at Assets/Third-Package/Easy Save 3/Scripts/Readers/ES3JSONReader.cs:39)
    4. ES3Reader.Create (System.Byte[] bytes, ES3Settings settings) (at Assets/Third-Package/Easy Save 3/Scripts/Readers/ES3Reader.cs:370)
    5. ES3File.SaveRaw (System.Byte[] bytes, ES3Settings settings) (at Assets/Third-Package/Easy Save 3/Scripts/ES3File.cs:170)
    6. ES3.SaveRaw (System.Byte[] bytes, ES3Settings settings) (at Assets/Third-Package/Easy Save 3/Scripts/ES3.cs:142)
    7. TestSave.LoadFile (System.Int32 day) (at Assets/Scripts/TestSave.cs:57)
    8. TestSave.OnEnable () (at Assets/Scripts/TestSave.cs:26)
    Problem dissapear when I enter to ES3 file and change line 142 (in method SaveRaw) from
    ES3File.GetOrCreateCachedFile(settings).SaveRaw(bytes);

    to:
    ES3File.GetOrCreateCachedFile(settings).SaveRaw(bytes, settings);


    Is this fix correct? If no, what should be madeto fix this?

    Code (CSharp):
    1. using System;
    2. using System.IO;
    3. using UnityEngine;
    4.  
    5. public class TestSave : MonoBehaviour
    6. {
    7.  
    8.     private ES3Settings _settings;
    9.     private void OnEnable()
    10.     {
    11.         _settings = new ES3Settings
    12.         {
    13.             location = ES3.Location.Cache,
    14.             directory = ES3Settings.defaultSettings.directory,
    15.             format = ES3.Format.JSON,
    16.             path = String.Empty,
    17.             encryptionType = ES3.EncryptionType.AES,
    18.             compressionType = ES3.CompressionType.Gzip,
    19.             encryptionPassword = "password"
    20.         };
    21.        
    22.         SaveFile(0);
    23.         LoadFile(0);
    24.     }
    25.  
    26.     private void SaveFile(int day)
    27.     {
    28.         string path = Application.persistentDataPath + "/TestSave" + day + ".sav";
    29.         ES3File saveFile = new ES3File(path, _settings, false);
    30.        
    31.         saveFile.Save("Test", 1234567890);
    32.        
    33.         using (BinaryWriter writer = new BinaryWriter(File.Open(path, FileMode.OpenOrCreate)))
    34.         {
    35.             writer.Write(saveFile.LoadRawBytes());
    36.         }
    37.     }
    38.  
    39.     private void LoadFile(int day)
    40.     {
    41.         string path = Application.persistentDataPath + "/TestSave" + day + ".sav";
    42.         byte[] data;
    43.         using (FileStream stream = new FileStream(path, FileMode.Open))
    44.         {
    45.             using (var ms = new MemoryStream())
    46.             {
    47.                 stream.CopyTo(ms);
    48.                 data = ms.ToArray();
    49.             }
    50.         }
    51.        
    52.         ES3.SaveRaw(data, _settings);
    53.        
    54.         Debug.Log(ES3.Load("Test", _settings));
    55.     }
    56.    
    57. }
     
  12. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    914
    Hi there,

    Please could you create a new project with a basic scene which replicates this and private message it to me so I can see what is happening?

    All the best,
    Joel
     
  13. yomanx

    yomanx

    Joined:
    Dec 5, 2016
    Posts:
    38
    Yo friend, i found one more issue in the project.

    In the game our save is Encrypted well, but when i download saves in phpMyAdmin Datebase, i can open them by Textedit, they are without encryption. Why?

    Save in device:
    upload_2020-10-17_2-12-0.png

    in Datebase:
    upload_2020-10-17_2-14-35.png
     
  14. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    914
    Hi there,

    Please could you show me the code you're using to upload to the server?

    All the best,
    Joel
     
  15. yomanx

    yomanx

    Joined:
    Dec 5, 2016
    Posts:
    38
    https://www.dropbox.com/s/7k9pix3s8rk4vyu/SaveLoadManager.cs?dl=0

    Code (CSharp):
    1. IEnumerator SyncSaveOnStart(string userName, string file)
    2.     {
    3.         lastSaveFile = file;
    4.         path = Application.persistentDataPath + "/" + lastSaveFile;
    5.         print("SyncSaveOnStart");
    6.         // Create a new ES3Cloud object with the URL to our ES3.php file.
    7.         var cloud = new ES3Cloud(es3Cloud, apiKey);
    8.         // Synchronise a local file with the cloud for a particular user.    
    9.         yield return StartCoroutine(cloud.Sync(file, userName, "myUsersPassword"));      
    10.  
    11.         if (cloud.isError)
    12.         {
    13.             GameManager.Manager.DebugText("SyncSave Error: " + cloud.error);
    14.             print("SyncSave Error: " + cloud.error);
    15.         }
    16.         else
    17.         {
    18.             //GameManager.Manager.DebugText("ES3. OK. \n userName " + userName + ", \n file " + file);
    19.             print("ES3. OK. \n userName " + userName + ", \n file " + file);
    20.         }    
    21.  
    22.         TryLoadOrCreate();
    23.     }
     
  16. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    914
    Hi there,

    You don't appear to be enabling encryption when calling the ES3Cloud.Sync. I.e.

    Code (CSharp):
    1. var settings = new ES3Settings(ES3.EncryptionType.AES, ENSC_PASS);
    2. yield return StartCoroutine(cloud.Sync(file, userName, "myUsersPassword", settings));
    All the best,
    Joel
     
  17. KrejwenBAN

    KrejwenBAN

    Joined:
    Jun 8, 2020
    Posts:
    8
    Hi Joel,

    I sent you a project by contact form on your website.

    Best regards,
    Marcin
     
  18. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    914
    Hi Marcin,

    I replied to your email on Monday, but I'll paste the response here as it sounds like you didn't receive this:

    When calling ES3.SaveRaw you need to ensure that encryption isn’t enabled. Your data is already encrypted, which means it’s trying to encrypt it again, causing it to become corrupt.

    Just a note, what you’re trying to achieve is the exact same as doing this, but with less redundancy:

    Code (CSharp):
    1. using UnityEngine;
    2.  
    3. public class TestScript : MonoBehaviour
    4. {
    5.     private ES3Settings _settings;
    6.  
    7.     private void OnEnable()
    8.     {
    9.         _settings = new ES3Settings
    10.         {
    11.             location = ES3.Location.Cache,
    12.             encryptionType = ES3.EncryptionType.AES,
    13.             compressionType = ES3.CompressionType.Gzip,
    14.             encryptionPassword = "password"
    15.         };
    16.         SaveFile(0);
    17.         LoadFile(0);
    18.     }
    19.  
    20.     private void SaveFile(int day)
    21.     {
    22.         ES3.Save("Test", 1234567890, "TestSave"+day+".sav", _settings);
    23.         ES3.StoreCachedFile("TestSave"+day+".sav");
    24.     }
    25.  
    26.     private void LoadFile(int day)
    27.     {
    28.         ES3.CacheFile("TestSave"+day+".sav");
    29.         Debug.Log(ES3.Load("Test", "TestSave"+day+".sav", _settings));
    30.     }
    31. }
    All the best,
    Joel
     
  19. yomanx

    yomanx

    Joined:
    Dec 5, 2016
    Posts:
    38

    Hey friend, nothing work.

    can you check pls sample project with this issue:
    See SaveLoadManager
     
    Last edited: Oct 21, 2020
  20. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    914
    Hi there,

    I've downloaded the project and will let you know when I've had a chance to debug it.

    Please could you delete the link as this would allow anyone to download the packages within your project, which is against the Asset Store's EULA.

    All the best,
    Joel
     
    Last edited: Oct 21, 2020
  21. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    914
    Hi there,

    I've tried your project and it appears to be working fine for me. Just to check, have you tried deleting your save data? You can do this by going to Window > Easy Save 3 > Tools > Clear Persistent Data Path.

    All the best,
    Joel
     
  22. yomanx

    yomanx

    Joined:
    Dec 5, 2016
    Posts:
    38
    We did it every time. Is your file encrypted on the server? Can you open it with text edit et c?

    Maybe we speak about different issues?

    Save file not encrypted on php datebase (just name encrypted) but encrypted in devices, is it normal?


    I did video from the beginning to the end
     
    Last edited: Oct 22, 2020
  23. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    914
    Hi there,

    Apologies, by 'nothing working' I thought you meant that it was failing to upload.

    It is normal that it is unencrypted when it reaches the server, and this is considered to be secure as it's not directly accessible by the user at this point. However, if you would rather it be encrypted on the server, if you private message me your invoice number I'll send over an update which sends the data encrypted.

    All the best,
    Joel
     
    yomanx likes this.
  24. yomanx

    yomanx

    Joined:
    Dec 5, 2016
    Posts:
    38
    ok thanks for info, i think we need update. Cheaters can easy catch via wifi sniffer uncreapted saves and then modify them and reupload...

    sent message with invoice number
     
    Last edited: Oct 23, 2020
  25. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,941
    Hi @JoelAtMoodkie
    ES2 had obfuscation (different that encryption)
    So how do i obfuscate in Es3.SaveRaw?
    Thanks
     
  26. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    914
    Hi there,

    As long as you're sending the data through HTTPS it is already encrypted during transmission and protected from sniffing attacks. However, I'll send you the update anyway.

    All the best,
    Joel
     
  27. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    914
    Hi there,

    We don't use obfuscation in Easy Save 3 as encryption serves the same purpose, but more securely.

    All the best,
    Joel
     
    jGate99 likes this.
  28. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,941
    Encryption causes more issues with app store submission, anyhow
    How can i save string as binary (so its sort of obfsucation for me) and when i load i still get it as string
     
  29. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    914
    XOR obfuscation is a form of encryption, so would still need to be declared when submitting on the App Store.

    The easiest way to obfuscate data without using encryption would be to compress the data:
    https://docs.moodkie.com/easy-save-3/es3-guides/es3-encryption-compression/

    All the best,
    Joel
     
  30. yomanx

    yomanx

    Joined:
    Dec 5, 2016
    Posts:
    38
    hi Joel

    How we can send to server DECODED save files names?
    We need it to catch players saves and debug bugs.
     

    Attached Files:

  31. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    914
    Hi @yomanx ,

    Your screenshot shows usernames rather than filenames. We send a hash of the username and password rather than the raw username and password for security reasons. There's more information on this in the Managing Users section of the ES3Cloud guide:

    All the best,
    Joel
     
  32. yomanx

    yomanx

    Joined:
    Dec 5, 2016
    Posts:
    38
    Hi Joel,

    In my server I want to see the ‘user’ field not as a hash but as a real name (so yes we need usernames)


    i tried like this:


    cloud.AddPOSTField("user", userName);

    yield return StartCoroutine(cloud.Sync(saveFile, userName, "myUsersPassword", settings));


    and like this:


    cloud.AddPOSTField("user", userName);

    yield return StartCoroutine(cloud.UploadFile(saveFile, userName, "myUsersPassword", settings));


    and like this:


    ES3Settings s = new ES3Settings(ES3.EncryptionType.None, ENSC_PASS);

    cloud.AddPOSTField("user", userName);

    yield return StartCoroutine(cloud.UploadFile(saveFile, userName, "myUsersPassword", s));


    but in the server the ‘user’ field always looks like a hash

    also I tried add different field names like "UserName" (not only "user")
     
    Last edited: Nov 4, 2020
  33. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    914
    Hi there,

    You would need to customise the ES3Cloud.php script to use this username rather than the hashed one.

    If you private message me your invoice number I can send over an ES3Cloud.php which does this.

    All the best,
    Joel
     
  34. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    193
    Hi JoelAtMoodkie
    simple issue with mesh saving
    im generating mesh at runtime, after saving via ES3 my mesh data not existing in my .es3 file.
    MeshFilter --- > all checked (sharedMesh, Mesh, name)
    Mesh --- > all checked (UV, normals, vertices...).


    example on how i generated my mesh :

    Code (CSharp):
    1.         Vector3[] vertices = new Vector3[4]
    2.         {
    3.             new Vector3(DownLeftPosition.x - this.transform.position.x,DownLeftPosition.z - this.transform.position.z,0),
    4.             new Vector3(DownRightPosition.x- this.transform.position.x,DownRightPosition.z - this.transform.position.z,0),
    5.             new Vector3(LG.x- this.transform.position.x,LG.z- this.transform.position.z,0),
    6.             new Vector3(LD.x- this.transform.position.x,LD.z- this.transform.position.z,0),
    7.         };
    8.  
    9.         Mesh mesh = new Mesh();
    10.         mesh.vertices = vertices;
    11.         int[] tris = new int[6]
    12.         {
    13.             0, 2, 1,
    14.             2, 3, 1
    15.         };
    16.  
    17.         mesh.triangles = tris;
    18.  
    19.         Vector3[] normals = new Vector3[4]
    20.         {
    21.             -Vector3.forward,
    22.             -Vector3.forward,
    23.             -Vector3.forward,
    24.             -Vector3.forward
    25.         };
    26.  
    27.         mesh.normals = normals;
    28.  
    29.       Vector2[] uv = new Vector2[4]
    30.         {
    31.             new Vector2(0, 0),
    32.             new Vector2(1, 0),
    33.             new Vector2(0, 1),
    34.             new Vector2(1, 1)
    35.         };
    36.         mesh.uv = uv;
    37.  
    38. MyGameObject.GetComponent<MeshFilter>().mesh = mesh;

    Result from saved File :

    Code (CSharp):
    1. {
    2.                                 "__type" : "UnityEngine.MeshFilter,UnityEngine.CoreModule",
    3.                                 "_ES3Ref" : "3627427578131737060",
    4.                                 "goID" : "170460430243672580",
    5.                                 "sharedMesh" : {
    6.                                     "_ES3Ref" : "1053398133584516481"
    7.                                 },
    8.                                 "mesh" : {
    9.                                     "_ES3Ref" : "1053398133584516481"
    10.                                 }
    11.                             },{
    12.                                 "__type" : "UnityEngine.MeshRenderer,UnityEngine.CoreModule",
    13.                                 "_ES3Ref" : "2867674314534977476",
    14.                                 "goID" : "170460430243672580",
    15.                                 "additionalVertexStreams" : null,
    16.                                 "enabled" : true,
    17.                                 "shadowCastingMode" : 1,
    18.                                 "receiveShadows" : true,
    19.                                 "sharedMaterials" : [
    20.                                     {
    21.                                         "_ES3Ref" : "1237895929010107239"
    22.                                     }
    23.                                 ],
    24.                                 "lightmapIndex" : -1,
    25.                                 "realtimeLightmapIndex" : -1,
    26.                                 "lightmapScaleOffset" : {
    27.                                     "x" : 1,
    28.                                     "y" : 1,
    29.                                     "z" : 0,
    30.                                     "w" : 0
    31.                                 },

    Best Regards
     
  35. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    914
    Hi there,

    You're saving the MeshFilter rather than the Mesh itself. Fields are stored by reference, so you need to save the Mesh itself so that it is stored by value.

    All the best,
    Joel
     
  36. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    193
    hi there,

    thanks for the quick answer, actually i do not have any idea on how to do that, i just have gameobject generated at runtime attached with ES3Autosave.cs, my generated mesh is saved by reference.
    could you give me any solution to save/load my gameobject with the new generated mesh.

    best regards
     
  37. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    914
    Hi there,

    You would need to save and load the Mesh separately, not using Auto Save. You can do this using:

    ES3.Save("yourKey", yourMesh);

    And

    Mesh yourMesh = ES3.Load("yourKey");

    All the best,
    Joel
     
  38. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    193
    Hi there,
    thanks again for the answer, in my project i have one gameobject and a lot of sub-GameObjects so im using ES3.Save<GameObject>("project", Project_GameObject, SavingSettings);
    i have many components attached to each sub-gameobjects, ES3 save/load works well except one of the sub gameobject that need to change his mesh like it shown in the previous messages.
    So when i load my parent gameobject all sub objects are loaded correctly except the generated mesh (empty), if i use ES3.Save("yourKey", yourMesh); it will difficult for me to load it again to the owner gamebject i hope it's clear.

    all best.
     
  39. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    193
    Solved
    for any one encounter the same issue :
    1- change the 'Serialize unity object " to --> By Ref and Value
    2- In ES3Type_MeshFilter.cs change write line to :
    Code (CSharp):
    1. writer.WriteProperty("sharedMesh", instance.sharedMesh,ES3.ReferenceMode.ByValue);
    all generated mesh data will be saved automatically
     
    Bartolomeus755 likes this.
  40. jpjyl202

    jpjyl202

    Joined:
    Mar 15, 2019
    Posts:
    2
    It saves well on Android mobile, but if I update the app on my phone after modifying the game, the saved information is reset. What is the problem? :(
     
  41. jpjyl202

    jpjyl202

    Joined:
    Mar 15, 2019
    Posts:
    2
    I'm not sure, but it suddenly works. Thank you :)
     
    UnityGISTech likes this.
  42. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    914
    Glad you managed to resolve your issue :)
     
    UnityGISTech likes this.
  43. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    914
    Glad this resolved itself. This usually happens when the bundle identifier or package name changes, which changes the location of the persistent data path.

    All the best,
    Joel
     
    UnityGISTech likes this.
  44. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    193
    I had to read the whole code to understand how it works;););););):);)
     
  45. yomanx

    yomanx

    Joined:
    Dec 5, 2016
    Posts:
    38
    Hi Joel,
    Some weeks ago we got error
    "FormatException: Cannot load from file because the data in it is not JSON data, or the data is encrypted.
    If the save data is encrypted, please ensure that encryption is enabled when you load, and that you are using the same password used to encrypt the data."

    So we thought that problem in our configs between encrypted/decrypted. But now we have stable version with turned ON encryption, cleared all old saves et c


    And sometimes players get bug - SAVE is broken, when we try to load it - we get error (see log) also we found that broken SAVE not loaded to server at this time or was deleted, we can't find it on server, but we think sometimes broken save successfully loaded to server and some players get broken saves.

    Attached my: SaveLoadManager.cs
    Attached my: Broken save file, AES KEY: Pdnejoh1! - you can install it and see log. Also file size very small, our saves ~ 100-500kb each.

    So we must find - why save file sometime is broken, this is a very important bug.



    FormatException: Cannot load from file because the data in it is not JSON data, or the data is encrypted.
    If the save data is encrypted, please ensure that encryption is enabled when you load, and that you are using the same password used to encrypt the data.

    ES3Internal.ES3JSONReader..ctor (System.IO.Stream stream, ES3Settings settings, System.Boolean readHeaderAndFooter) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3JSONReader.cs:39)

    ES3Reader.Create (ES3Settings settings) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:348)

    ES3.KeyExists (System.String key, ES3Settings settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:1097)

    ES3.KeyExists (System.String key, System.String filePath, ES3Settings settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:1085)

    SaveLoadManager+<DownloadSaveOnStart>d__25.MoveNext () (at Assets/_Scripts/SaveLoadManager.cs:146)

    UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at /Users/builduser/buildslave/unity/build/Runtime/Export/Scripting/Coroutines.cs:17)
     

    Attached Files:

    Last edited: Nov 13, 2020
  46. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    914
    Hi there,

    When trying to decrypt the file as a string I'm getting a decryption error. This indicates that the data has changed since decryption.

    The most likely scenario is that an encoding has been applied to the save file, corrupting it. This can happen if the encrypted file is opened in a text editor and saved, or another piece of software accesses the file and applies an encoding to it (for example, cloud syncing software trying to upload it as text).

    All the best,
    Joel
     
  47. yomanx

    yomanx

    Joined:
    Dec 5, 2016
    Posts:
    38
    Last edited: Nov 13, 2020
  48. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    914
    Hi there,

    Could you private message me a project which creates one of these corrupt files?

    Then the data will have become corrupted elsewhere, but it's not possible to tell how it's become corrupt without seeing a project which replicates it. For example it could be that the server is handling the data incorrectly.

    Just to clarify, would you be able to explain how the likely example doesn't apply to you? Your code seems to be storing the data locally and then uploading it, and any data stored locally is susceptible to this.

    All the best,
    Joel
     
    UnityGISTech likes this.
  49. markashburner

    markashburner

    Joined:
    Aug 14, 2015
    Posts:
    212
    I honestly do not know how this asset has so many good reviews.

    It has completely crashed my game. And it is throwing me this error:

    FormatException: Expected ',' separating properties or '"' before property name, found 'n'.
    ES3Internal.ES3JSONReader.ReadPropertyName () (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3JSONReader.cs:63)
    ES3Internal.ES3JSONReader.Goto (System.String key) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3JSONReader.cs:198)
    ES3Reader.Read[T] (System.String key) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:157)
    ES3.Load[T] (System.String key, ES3Settings settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:269)
    ES3.Load[T] (System.String key) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:240)
    AvatarCreator.Start () (at Assets/_Scripts/AvatarCreator.cs:177)

    I am almost at the end of a job..almost finished this damn game for a client.
    And out of no where Easy Save 3 is throwing me these errors...completely out of no where...and since I coded Easy 3 in my project from the very beginning....it has completely stuffed my entire project.
     
    Last edited: Nov 23, 2020
  50. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    914
    Hi there,

    We've not had any reports of this issue, and I don't appear to be able to replicate it from your stack trace. Please could you private message me a basic project which replicates it along with your save file? Your save file can be found by going to Window > Easy Save 3 > Tools > Open Persistent Data Path.

    I also recommend deleting your save data by going to Window > Easy Save 3 > Tools > Clear Persistent Data Path.

    All the best,
    Joel