Basically I'm trying to figure out the best way to do a save file given the following situation:
I want savefiles to be saved to the person's key, so they can always load a few variables no matter where they play from, or who is hosting the game.
Also another big thing is I don't want these files to be tampered with. How might I go about this?
Also not to mention savefiles are another weakpoint of mine, and I don't even really know how to work with even the most basic of this.
ID:154969
![]() Oct 22 2011, 7:09 pm
|
|
This is my attempt, which doesn't work
mob |
Speedro wrote:
This is my attempt, which doesn't work Well, your saving is about right, except for that random argument in new(). For the loading, you need to create a /savefile object from the return value of Import(). The reference has a great example on this. As for making it safer from tampering, the typical method is to store a hash along with the data, which is a unique string generated based on the data and a "salt". The salt is some constant random data that you use to obfuscate your hash, so someone else can't guess how to create their own to match the data they want to insert. mob For example, if you remember my old game Cosmic Peril, it used four hashes based on a random number: (well, #2 was fake, I went a bit overboard) var/Check5 = rand(10,99) Of course, while being hard to guess, this was a rather poor method, because it didn't protect a wide-enough range of the stats (ie the stats of their equipment/ships). I would probably automate the hashing if I had to do it all over again. Ironically, after all of that, someone (looking at you AD) just used a memory editor and completely side-stepped my protection :P |
Import() and Export().
A Hash system using md5() proc.