Skip to content

Hosting

Emanuele Manzione edited this page May 18, 2023 · 24 revisions

You can host PATCH artifacts (builds and patches) on your favorite hosting service. It works with every service that can serve files over HTTP or HTTPS and that can expose a direct URL to the file. This because PATCH dynamically builds URLs based on your builds/patches metadata.

Some samples:

  • http://myCoolHostingService.com/patch/myfile.txt => valid ✅
  • https://myCoolHostingService.com/folder/myfile.txt => valid ✅
  • http://myCoolHostingService.com/?file=jR2xl1D => NOT valid ❌

Additional info:

  • directory listing is not required
  • the downloaders can follow redirects

Hosting with the main cloud vendors

For your convenience, here is a list of the major vendors (some of them are marked with referral, this means that by using that host you will support PATCH indirectly):

Hosting on AWS S3

If you are hosting your files on AWS S3, remember to check the bucket's Amazon S3 Block Public Access settings and to grant Public Read Access to your files. Otherwise, your Launcher couldn't access your files.

Hosting on Azure Blob Storage

If you are hosting your files on Azure Blob Storage and you are using the ChunkedDownloader contained in the Plus version, you may experience some difficulties in downloading files. If that's the case, make sure to use the latest API schema (by default, it doesn't use the latest). To do that, in https://portal.azure.com/ click on Cloud Shell and run this script (first change the account-name and the key to match your own credentials):

$ctx = New-AzureStorageContext -StorageAccountName <account-name> -StorageAccountKey <key>

Update-AzureStorageServiceProperty -ServiceType Blob -DefaultServiceVersion 2021-04-10 -Context $ctx

This enables ranged and partial downloads, required for ChunkedDownloader.

Using Cloudflare

If you are using Cloudflare, you need to apply cache-control: no-transform for you files (take a look here) to avoid compression.

If you are using Caching, you need to apply Cache Everything and for every file bigger than the maximum allowed size for your plan, you need to apply cache-control: no-store.

Hosting on Cloudflare R2

If you are hosting on Cloudflare R2, your Cloudflare Worker will need to support ranged download if you plan to use ChunkedDownloader. You can use AWS CLI for uploading your files (it uses an S3-compatible API). You can't upload files bigger than 5GB, so keep that in mind when you build your game.

⚠️ Hosting on GitHub ⚠️

WARNING ⚠️: this method has been reported as not working in the majority of cases. Use it at your own risk. The reported set of problems includes: corrupted files, wrong-sized files, the Launcher and the PreGame just keep on restarting themselves in a loop, etc. This happens when your repository contains files bigger than a certain threshold (so we assume that they are handled differently by the GitHub servers) and/or when Git LFS is involved. If that's your case, please consider choosing a different host.

If you think the previous warning does not affect your specific case, you can use a repository on GitHub to host builds and patches for free. However, before you can start using it, we need to make some clarifications.

Let's assume that my files are hosted at https://github.com/emanzione/PATCH, on main branch. In this repository I have the classic PATCH folder structure, as explained previously in this doc:

https://github.com/emanzione/PATCH/Builds/ https://github.com/emanzione/PATCH/Patches/ https://github.com/emanzione/PATCH/Updater/

In the Launcher's settings you CANNOT simply set as Remote URL this address! Instead, you will need to set it as the raw GitHub address: https://raw.githubusercontent.com/emanzione/PATCH/main/. Normally you can obtain your URL by following this schema: https://raw.githubusercontent.com/Username/RepositoryName/BranchName/.

And here we go: you've set your Launcher for downloading from your GitHub repositories.

Clone this wiki locally