Scripting an expiration code

Started by jamesreg, Tue 16/02/2010 20:02:01

Previous topic - Next topic

jamesreg

Is it possible to script a code for a beta game in ags where it looks at the system date or information and does not allow game to run if its past this date and gives them a message that the beta test is over download the full version?

Charity

#1
Look up DateTime functions and properties in the manuel.

Then put something like (pseudocode)
Code: ags

if (year > last year of beta) AbortGame("beta time is up");
if (year = last year of beta) {
  if (month > last month of beta) AbortGame("beta time is up");
  if (month = last month of beta) {
    if (day of month > last day of beta) AbortGame("beta time is up");
  }
}

in on_game_start.

But I'm pretty sure this won't stop people from changing their system time to bypass the block.  Correct me if I'm wrong.

Akatosh

QuoteBut I'm pretty sure this won't stop people from changing their system time to bypass the block.  Correct me if I'm wrong.

It indeed won't. You can always resort to trickery - such as creating a small file once the time has been registered as "expired" once and having the game refuse to run if said file exists, that kind of thing - but it's quite possible to bypass that.

Calin Leafshade

You could make it more difficult to bypass that by having some kind of hashing algorithm.

You make a file with a  hash in it then after the time expires you mess up the hash so that it wont work anymore. Ofcourse this can still be bypassed but you'd need the original hashfile.. it wouldnt be as simple as just deleting the new file you created after the time expired.

but yeah, without an external, independent clock it's not possible.

You could do it relatively easily with a wrapper though. Just make a small program which checks an external, online time and if it passes run the game.

Khris

#4
Or, much more preferable, take the beta off the net as soon as the final version is released, notify third parties hosting the download, and show a simple message to the player while allowing him to still run the game.

Most if not all people know how to change their PC's date, so it's pretty pointless if the game's actually gonna exit.

Edit: I just thought of a way, though IMO it's not worth the trouble:

When the game is loaded, show a code to the player. They then have to enter it on a website, an algorithm turns it into a different code and the player puts that into a textfield. AGS uses the same algorithm and will quit if the two don't match.

That way you can have the wep app check the date. Should be pretty secure.

Calin Leafshade

Agreed, Its not really worth the hassle... but ya know.. I was just thinking aloud

SMF spam blocked by CleanTalk