|
-
383,890,620 polygons
[TIP] ASP.NET hotlink buster
Hi folks,
All of us game devs have this from time to time and not all of us think about it as "free" promotion: hotlinking to your games. One problem with this kind of "free" promotion is when a beta or test version is hotlinked, as this may result in a wrong perception of your work (I had that recently).
So I wrote myself a little hotlink buster in asp.net (sorry, not sure if this will work in php, but I don't care that much, to be true).
The only drawback I found so far is that your visitors are requiered to do one click before they can play.
There's no public code atm, but those who know asp.net will surely get along with it ...
Here we go:
- create a webform
- add 2 panels to it (I'll name them "Start_Panel" and "Game_Panel" for now)
- add a Button to "Start_Panel" (a LinkButton will do, too, and of course some descriptive html
) - in the onLoad event of the page add code that:
- - hides the "Game_Panel" and shows the "Start_Panel"
- - add the current time and maybe the IP of the user to the command argument of the button
- in the onClick event of the button:
- check for the time (I check for 10 minutes)
- check the IP
- if both are correct ... hide the "Start_Panel" and show the "Game_Panel"
- if something is wrong ... redirect to a prepared error page
- add the html for the swf to the "Game_Panel"
- to make it "save" I don't access the swf directly, instead I stream it, using aspx page that streams the swf giving a crumbled ID, the time and the IP as parameter, yet again, if anything is wrong an "error" swf is streamed back instead of the actual game.
This is not the wizard's last try but at least it's working in most of the cases:
- you cannot link to the swf directly (as it won't be streamed with the wrong/no credentials provided)
- you cannot copy and paste the html because it's hidden by default and only is visible after a click on the button, even if you do, it will stop working after 10 minutes
- so everyone will have to link to the page with the button, which should contain your author info - and NOW it is usefull to get hotlinked
 - as all links have to go to the .aspx page, you can even add a framebuster script ...
Though, this doesn't prevent the enemies to get the game from the cache, but yet again, you can do nasty tricks with streaming SWFs through a aspx page (like loading a set of functions that are needed from an external "streamed" swf)
nGFX
ps: just wrote this on the go, so if I forgot something, tell me and I'll add it.
Last edited by nGFX; 11-07-2006 at 08:15 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|