How do I encode JSON export file

Get help using Construct 2

Post » Mon Aug 03, 2015 9:47 am

Hi,

I want to allow the player to export & import his current savegame, but then the player can easily adjust the JSON file and change for instance the coins earned so far.
Is there a way to encode the exported JSON file?

Thanks!
Image Image iTunes: Match3 | Google Play: Match3
B
95
S
33
G
30
Posts: 1,101
Reputation: 27,674

Post » Mon Aug 03, 2015 9:49 am

What you could do is produce a hash of the values in the JSON file and when it reloads recalculate it and see if the hash still matches. If one of the values is changed without the hash being updated it then won't load.
My tutorial through development blog is at http://myconstruct2dev.blogspot.co.uk/
B
12
S
3
Posts: 221
Reputation: 1,328

Post » Mon Aug 03, 2015 9:54 am

paulscottrobson wrote:What you could do is produce a hash of the values in the JSON file and when it reloads recalculate it and see if the hash still matches. If one of the values is changed without the hash being updated it then won't load.


Hey,
thanks for that hint. That sound like a good idea to do that.
I will try to work something out ;)
Image Image iTunes: Match3 | Google Play: Match3
B
95
S
33
G
30
Posts: 1,101
Reputation: 27,674


Return to How do I....?

Who is online

Users browsing this forum: bluesun66, Malhog, plinkie, Syazanie Amirin and 1 guest