Here is a revised getmod.php that supports Skydrive. You can suply my function with a short or long Skydrive share link and it will parse the HTML to find the raw download link. But I just realized I forgot to string replace the HTTPS with HTTP but it still worked. Hahaha.. Maybe rF2's client supports HTTPS after all. I am so lost now. The good news is this PHP file will work with Skydrive which isn't a bad way to host for now. Code: <?php if (isset($_GET['sig'])) { switch($_GET['sig']) { // Put the SubmitID for your rfcmp file here case "839bf08a397e2b96b928524c57829d2a221e21b68338b19b1c7c44ed682e7e44": // Put the short or long Skydrive URL here header('Location: '.skydrive_direct('http://sdrv.ms/10icgK3'),TRUE,302); break; default: echo "Unknown SIG"; } } else { echo "Missing SIG"; } function skydrive_direct($skydrivelink) { $file = file_get_contents($skydrivelink); $pos = strpos($file,'content="2;url='); $pos += strlen('content="2;url='); $buffer = ""; while(substr($file,$pos,1) != '"') { $buffer .= substr($file,$pos,1); $pos++; } $file = file_get_contents(html_entity_decode($buffer)); $pos = strpos($file,'{"download":"'); $pos += strlen('{"download":"'); $buffer = ""; while(substr($file,$pos,1) != '"') { $buffer .= substr($file,$pos,1); $pos++; } return str_replace('\\', '', html_entity_decode($buffer)); } ?> I just added some comments. The code is rather simple though. Just throw this PHP file on any server you have access to that supports PHP and then add the URL to your rfcmp file. For example, put this in your rfcmp http://www.testserver.com/getmod.php rF2 automatically adds the submit id to the URL.
HTTPS is currently unsupported for component downloads, but will be in the future. There is a maximum of one redirect per download request. For the sake of preventing infinite loops, there will always be a limit, but that limit will likely increase to something more flexible in later builds.
Well in my tests HTTPS is working. The URL in my rfcmp is HTTP but that URL redirects to a Skydrive URL which uses HTTPS. I made sure all the rfcmps were uninstalled and deleted from the Packages directory and did a fresh test. It grabbed the vmod, listed the missing stuff, it then downloaded the missing stuff and then joined. I think Dropbox fails because of the redirect limit that is set. It looks like Dropbox is redirecting twice plus the first redirect that I did with my getmod.php.
I just looked at Filedropper. It will not work because it requires users intervention. The link takes you to a page where you then have to click download, then you have to type in a captcha. rF2 needs raw download links.
Mega has an API that you can use to generate download links of public files (this could be integrated with getmod.php i'm sure), but they use HTTPS. There are very few free file hosts that require no interaction to download though, plus a lot will redirect users to a verification page (usually a CAPTCHA of some sort) if a file is being downloaded a lot, or being hotlinked.
Personally, I am kinda shocked HTTPS works at all. We are not going to support, in the near term, anything beyond standard HTTP/S. If a particular hosting sites is doing something funky well that is not really our fault. I personally would like to FTP but we do not really have to much demand for that right now.
Yeah, Skydrive may do this too if they get too many hits. So far in testing I have probably downloaded my 5MB skin rfcmp about 100 times and it hasn't stopped working. I have a simple proof of concept up and running now. The sigs and urls are stored in a database. If anyone wants to test with their own rfcmp, just add this URL when you package the rfcmp and then give me the submitid and the download URL for the rfcmp and I will add it to the database. Next up I will build a real simple front and so people can add their own redirects. Also need a way to password protect sigs so that only the author can come back later to make changes to that sig later on. http://rfcmpredir.site90.net/getmod.php
I agree, building work arounds for all the crazy junk people do with their hosting sites could be a full time job. What it built in right now works fine.... other than maybe allowing a few more redirects.
The "scheme name" part of the url (HTTP/HTTPS) is being ignored until SSL support is added. It's common for web servers that listen on port 443 (https) to also serve the same resources on port 80 (http). You can verify this by including the port number in the component URL. Using "https://SkyDrive.com:443/path-to-your/getmod.php" should fail with the current build.
Ah.. that explains it. Skydrive does listen to HTTP also which is why I picked it. Thanks for the explanation.
Awesome investigation, Noel!! You are really mastering rFactor2 Now if would be fine if creator's content would be packed as components, so admins could use this new feature byyyyyyyye
Very ugly but gets the job done. To add a mod use this link: http://rfcmpredir.site90.net/addmod.php The description isn't really used anywhere right now, so it really doesn't matter what you put there. I have been using the rfcmp name. Example Sebring_Virtua_LM v1.90. To lookup an existing mod to make changes to the description or URL, use this link: http://rfcmpredir.site90.net/lookupmod.php I am storing the passwords as MD5 hashes in the database so they should be secure, but if you don't trust it, don't use any password you would use for anything important. Also, don't forget the password or else you will not be able to change the URL later. And of course the URL you want to use in your rfcmp is: http://rfcmpredir.site90.net/getmod.php Have fun.
GJ Noel, now just gotta hope that modders start to use this feature, will help a ton with joining races etc.
A dropbox link is a login and forwarding link, I believe, not a direct download. That's how they can block you when they decide you've used too much bandwidth, but the link itself still works for the uploader when logged in.
You don't have to be logged into DB for the direct links to work or even have an account for that matter.