One other thing you might think of doing… Use a .php page to serve your .unity3d file and secure access to it. This is something I do when I sell my asset through FastSpring. The users can log into my site to download updates but they are secured. I basically have this (not exact, it’s just an example):
Database:
FileId (int), VersionId (uniqueidentifier), OriginalFileName (nvarchar)
So the record might look like this:
27 | e880caa4-bdaa-4248-ad9d-80e903d6aeb2 | jsondotnetunity_version.unitypackage
In this case I also have a Product table with base info about the product and a ProductVersions table which manages the major, minor and build revisions for the product. VersionId points to the version. You won’t need anything quite that complicated as you’re just linking to a single file.
Now people log in and they hit download which hits a secured controller action on my site (I’m using MVC):
http://www.parentelement.com/private/downloadfile/e880caa4-bdaa-4248-ad9d-80e903d6aeb2
And on my system I have something like:
WebRoot
|
|___ App_Data
|
|___ Downloads
And in Downloads I have a file something like: e880caa4-bdaa-4248-ad9d-80e903d6aeb2.pedownload
Now in my controller action I get the GUID as a URL parameter. App_Data is not accessible via the web, only via code so it creates a filestream to e880caa4-bdaa-4248-ad9d-80e903d6aeb2.pedownload and writes it to the response stream with a content type of application/octet-stream and an attachment type of file with the filename being jsondotnetunity_version.unitypackage. So when the user downloads the file, they get the original file name and download it, but on the system it’s secured and unless you’re logged in you cannot directly access the file.
You could do the same thing with your .unity3d file. Just created a PHP page that will read in the hidden / secured file from disk, stream it back to the browser as originalFileName.unity3d and make sure you set the appropriate MIME Type when returning it. This will prevent non-logged in users from ever being able to directly download the file. It will also prevent other sites from hotlinking your unity3d file. You should still be checking that absolute URL as well though as that will be important.
One more thing you can do… when the game starts, have it just make a web request to your site. Just have a blank page that it can hit and make sure you don’t have a crossdomain.xml file that allows access from everywhere. As long as your game is hosted from your site the request will succeed. If someone hosts it elsewhere, it will puke when trying to make that request because it will be a disallowed cross domain request.