Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Encrypting and INI file?


Recommended Posts

He said he checked them/it.

Well, arrays are somehow like buildings, in which each floor stores a value. So, for example, if you have an array of 20 positions, you can store 20 values, one on each position. Be setting a standard of what position means in your array, you can store a save file.

For example:

Position 0 stores the number of lives,

Position 1 stores the last level unlocked,

Position 2 stores the player score.

You set this values, then save your array file. When you load your array file again, you just have to look up for them, to see how was the game before saving.

CNC Array files are safer than inis, because their content is in binary data, so people would need an Hex editor (and would have to reverse engineer the file format, to find what each byte does.)

-----

But it's also possible to add a checking system to your INI files, so them cannot be edited (well, actually, they can still be edited, but editing them will render them invalid). It works like this:

If your save game INI is like, this:

[Saved_Game]
Score=3272313
Lives=6
Level=2

You can make a calculation with this values, and create a checking value. So for example, you decide your checking formula is, for example:

Score * Lives / Level

so you get 3272313 * 6 / 2 = 9816939. That's your checking value

[Saved_Game]
Score=3272313
Lives=6
Level=2
Checking=9816939

When you load the values of the ini file, see if the checking value is equal to the calculated value (restoring first the other properties and applying the formula to them). If it its, you get the user to play, normally. If it's not, you close the game. Of course, you can make a harder to guess formula, for example involving powers, or trigonometric functions.

Link to comment
Share on other sites

Mark has the simplest and smartest method.

Just make a really, really, really, really, really, really, reallyreallyreally long Mathmatical equation that adds all the values together and puts together a specfic value with like 21 digits, so that solving the equation is next to impossible = not worth the time.

Then if they change anything, they get a file Corruption message and it deletes their saved game. (p2nt, stupid INI editing cheaters!)

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...