[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Business models



Henningsen wrote:
> 
> >When they download the game from the website, you could have the server
> >embed the date it was downloaded on into the executable...then *bang*
> >three days later the game demands money.
> 
> The server would have to write to the source files and recompile and send a
> different exceutable to every user, right? Or is there a simpler way of
> doing this?

The simplest way to do this is to declare a static character string
somewhere in your code with a distinctive initial value:

  static char download_date [] = "Steve Rules!" ;

...then when you compile the code, that sequence of characters will appear
somewhere in the binary.  You can then write a little PERL script to run
on your server and deliver the executable when someone downloads it. All
you have to do is to search for the sequence of bytes "Steve Rules!" and
replace those bytes with the current date.  Being **VERY** careful to
replace them with the exact same number of bytes!!

Then, when your game runs, it'll always find the date it was downloaded
stored in "download_date" - just as if you'd compiled it that way.

This works - I've done it lots of times.

You can even compile your executable and edit the static strings using
'vi' if you are *very* careful!

-- 
Steve Baker   HomeEmail: <sjbaker1@airmail.net>
              WorkEmail: <sjbaker@link.com>
              HomePage : http://web2.airmail.net/sjbaker1
              Projects : http://plib.sourceforge.net
                         http://tuxaqfh.sourceforge.net
                         http://tuxkart.sourceforge.net
                         http://prettypoly.sourceforge.net
                         http://freeglut.sourceforge.net



---------------------------------------------------------------------
To unsubscribe, e-mail: linuxgames-unsubscribe@sunsite.dk
For additional commands, e-mail: linuxgames-help@sunsite.dk