Basically, your two options for link-checking are:
- External API (get values from Javascript or run Javascript function(s)) - this is unfortunately easy to circumvent by providing dummy javascript functions that just return the expected values rather than performing the checks. The checks inside the .swf itself are also fairly easy to find and remove, removing the need to "hack" the javascript parts at all.
- Internal checking of the .swf's host location - this is a bit more secure, but is also fairly easy to remove from the .swf's code.
The root problems here are that ActionScript in a .swf, and Javascript in a web-page are both stored as source-code, so anything you put into them, a malicious user can simply find and remove.
BlueLight Wrote:you could also have it where letters in the URL string and are also in chat text will be drawn from the string and placed in the story. I'm guess there is something in the API where you can pick 1 character in a string and where it is.
Anyways if it's not correct then it mess up the text annoying the players.
You mean, for example, that if dialogue in the game reads "Good
Luck", and the L in luck is retrieved as the first character of the URL (l in legendofkrystal.com in this case), then when hosted on Funny Games it'd end up reading "Good
Fuck"?
A novel idea, however, tying it to a URL in this way would penalise users who downloaded the game to play offline; so if you want people to be able to download the game, you wouldn't be able to use that method as they'd be running it from a different (local) URL. Also, it shares the same issue as URL checking; a malicious user can simply find where you're getting the URL (very easy to search source for), and just manually enter the correct URL such that the text would appear normally.
As I say, the best strategy is really just to accept that the file may end up on one of these sites, but ensure you have a prominent logo that users can use to find the real source of the game, at this point all you have to do is protect the logo. Obfuscation is fine for the extra layer of difficult in order to try and make things more difficult for malicious content thieves, but all of the methods of protecting your game will either make things awkward for your users, or rely on one of only a handful of actual methods, which are easily enough "hacked" by anyone with a Flash decompiler.