Wow. That was a lot harder than it should have been. Urban Legend's developer has their own unlock system. They sent us a little script to generate unlock codes for their game, and said "use this!".
Sounds simple. How hard can that be? Three days hard, apparently.
Normally what we do is generate a bunch of codes ahead of time, upload them to our server, and dole them out to purchasers one at a time. (If you're logged on, click "my codes" at the top of the page--that'll give you a list of all the unlock codes you've received for games you've purchased). In some cases, developers have their own code generation system which requires a second piece of data, like a user's name. No problem there; we generate a few hundred codes using names like "manifesto1," "manifesto2" and so on, and upload them. But Urban Legend wants a "system id" that's pulled off the user's machine--meaning we can't generate arbitrary codes ahead of time. The user has to supply the system ID, with the code generated afterward.
And we can't just put the generator script online, because then anyone could generate unlock codes without purchase, with makes the whole thing pretty pointless.
So instead we need to have a system whereby users can buy the game, then input their system ID, we check to make sure they've bought it and haven't activated too many times, and then serve their code. And of course, the right thing to do is also ensure that this code shows up under "my codes."
All feasible, of course; that's the beauty of software. If you can spec it, you can build it. It doesn't mean building it is easy, though--not if doing so involves learning the ins and outs of the Drupal forms API (which is quite non-intuitive, and not very well documented), figuring out how long-departed developers decided where to store which bits of vital information in the mySQL database, teach yourself enough SQL to get by, and figure out why it works on the mySQL 5 set-up on your test machine but doesn't under mySQL 4 on the live site.
Probably not worth the time, really, but I like the game, so what the hell. And in any event, the result is sufficiently generalized that if we need to do something similar with other games in future, integration should be a whole lot quicker.
Ah, well, that's what you get with a start-up--functioning as sysadmin, code monkey, customer service manager, -and- CEO. Not to mention accountant, which reminds me... time to write some checks to developers.
Yeah I confess we probably
Yeah I confess we probably are over-paranoid.
There is an old joke: "All Russian software is a piracy-protection system with some features attached".
ShereIt has an option called "Key generator via a URL". It allows you to specify a secret URL to your online serial key generator to generate serials on demand. It uses HTTP POST requests and some easy API.
I thought you have something similar.