Saving with encryption including tags?

Easy Save 2 has been replaced by Easy Save 3, so is no longer supported.
Locked
revolter
Posts: 3
Joined: Wed Jan 21, 2015 2:47 pm

Saving with encryption including tags?

Post by revolter »

My code:

using (ES2Writer writer = ES2Writer.Create("Data.dat"))
{

// Missions
writer.Write(MissionManager.instance.mission1.ID, "mission1ID");
writer.Write(MissionManager.instance.mission1.done, "mission1Done");
writer.Write(MissionManager.instance.mission1.target, "mission1Target");
writer.Write(MissionManager.instance.mission1.progress, "mission1Progress");

// Remember to save when we're done.
writer.Save();
}

1) File contains unencrypted tags, is it possible to encrypt tags as well?

2) If I add ES2GlobalSettings and enable Encryption by Default, does it mean I don't have to mention encryption everytime I save?
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Saving with encryption including tags?

Post by Joel »

Hi there,

It's not possible to encrypt the tags because otherwise we'd have to decrypt every tag before being able to traverse the file, which would be extremely slow.

And that's correct, if you enable Encryption by default it will automatically encrypt everything that you save. We're actually adding a way to set the default settings from a Settings window in the Editor for v2.48, but ES2GlobalSettings will still work too.

All the best,
Joel
revolter
Posts: 3
Joined: Wed Jan 21, 2015 2:47 pm

Re: Saving with encryption including tags?

Post by revolter »

Thanx a lot, just bought your asset, which was a gift on my birthday!

Just saw that you can add your own types, so I think I found a way to hide some tags by creating my custom types like Mission.
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Saving with encryption including tags?

Post by Joel »

Ah, well Happy Birthday from everyone here at Moodkie, and thank-you very much for the purchase!

If you need any help adding support for your own types then let me know and I'll see what I can do.

- Joel
revolter
Posts: 3
Joined: Wed Jan 21, 2015 2:47 pm

Re: Saving with encryption including tags?

Post by revolter »

By the way, if I later update my own datatype, is there a way to check if it is consistent so I wouldn't load it (to avoid any errors)? Same question if encryption changes.
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Saving with encryption including tags?

Post by Joel »

If you plan on changing encryption or Types in future updates, the way we advise doing this is using version numbers.

So for example, you would keep a version number variable somewhere in your app, and also store this version number in your save file. When you come to load/save data, check that the version number in the file matches that in the app ... if it doesn't, the save file is incompatible with the current version. When you make a change to your encryption or types which will make the previous files incompatible, increase the version number in your app.

Hope this helps!
Locked