ServerAutoUpdates - festivaldev/Paradise GitHub Wiki

Automatic Client Updates

Paradise is constantly receiving updates, including bug fixes and security improvements. To make it easier for players to always run the latest release of Paradise, we have added an automatic update system to UberStrike that checks for updates each time the game is started, as well as once every hour when the player get back to the main menu.

To check for updates, the client downloads the update catalog for the channel set in Paradise.Settings.Client.xml (either Stable or Beta). This catalog contains the version and build information, as well as file sizes and hashes for each supported platform (win, darwin or universal for platform independent files). The game then proceeds to calculate each hash of the files specified in the catalog. If one of the hashes does not match, the file will be downloaded from the server to replace the local copy the next time the game is started. Once an update is applied, the game will force a relaunch. If the game finds any file listed in removedFiles, they will be deleted the next time the game is started. In this case, a relaunch will not be forced, but is recommended instead.

Currently, only stable and beta update channels are supported by the client.

ℹ️ In previous versions of Paradise, each channel's update catalog had its own version for each platform. Starting with Paradise 2.1, each channel has only one version, with each platform being listed for that specific version. A script to generate fallback update catalogs which supports older versions has been included with HashFiles_Fallback.py.

Structure

Below you can see an example update catalog:

version: '2.1'
build: 4.7.1.230426-1522
channel: Beta
platforms:
  win:
    files:
    - filename: uberdaemon.exe
      description: ''
      localPath: .
      remotePath: beta/win
      filesize: 2314240
      md5sum: b8bc613f0c401eb7aada0df0e3ffd2bf
      sha256: 9b85be6720a365b45d250aeda9ebded98fff65f50680299e4850972c7cb048b9
      sha512: 4fdc1ee2d6834ddfb5f6fb773b954276d269020ab0fb8625a8bc3cdc05b7dd9560a2bcc3cc5835b74a4b5ffcb844c04dfeb4f2fdae5a12dfdc11d2b46d867e9c
    removedFiles: []

Root Structure

Key Type Description
version string The version to display on the update prompt.
build string The build information to display on the update prompt.
channel string The human-readable name of this catalog, displayed on the update prompt.
platforms Dictionary<string, UpdatePlatformDefinition> A dictionary containing the files and removed files for each platform.

Platform Structure

Key Type Description
files Array<UpdateFile> The list of current files to be checked locally and downloaded if needed.
removedFiles Array<UpdateFile> The list of files to be removed from a local installation.

File Structure

Key Type Description
filename string The name of the file to be updated or removed.
description string An optional description to provide information about a file's purpose. Unused by Paradise.
localPath string The target location of a file, relative to <path to UberStrike>\UberStrike.exe.
remotePath string The location of the source file, relative to Paradise.WebServices\wwwroot\updates\v2\<channel name>.
filesize ulong The size of a file in bytes.
md5sum string The MD5 checksum of a file
sha256 string The SHA256 hash of a file
SHA512 string The SHA512 hash of a file

Generating Update Catalogs

Server owners do not need to create update catalog by hand. Instead, the Paradise.WebServices directory includes a Python script that does this work for them. Simply put each file that should be downloaded by the client into the desired directories for each update channel and platform (eg. beta\win). Create the directory structure you'd like the game to mirror, and run HashFiles.py inside a Command Prompt.

It is recommended not to copy the script to the update directory, as everything inside <path to Paradise.WebServices>\wwwroot will be downloadable. Instead, change the directory in the Command Prompt to <path to Paradise.WebServices>\wwwroot\updates\v2 and execute the script using its full path.

⚠️ **GitHub.com Fallback** ⚠️