Title Pack Auto-update

From Mania Tech Wiki
Jump to navigation Jump to search

Since Maniaplanet 3, it is possible to have custom title packs updated automatically. To save bandwidth, the title pack can also be uploaded to the Nadeo cloud. This article describes how the auto-update of title packs works.

Maniaplanet 3

When entering a title, Maniaplanet 3 proceeds as follows:

The game checks whether a download URL has been provided in the local title pack file.

If there is no download URL, the title is loaded without notice (even if the title has already been uploaded to the Nadeo cloud).

If a download URL exists, the client issues a HEAD request of the referenced file. The returned "Last-Modified" entity date is then compared to the "Modified" file date of the local Title.Pack.Gbx. If the local copy is current, nothing happens and the title is loaded.

If the local copy of the Title.Pack.Gbx is older than the remote version then Maniaplanet informs the user accordingly and asks if the title should be updated.

If the user clicks "Update now", the download starts from the download URL. In this case, only a few bytes of the pack header are loaded and the "Checksum" and "CreationDate" are read from the header. To make sure, the read date is also compared with the "CreationDate" of the local version. If both dates are equal, the download aborts and the title is loaded.

If the local version is actually outdated, it is checked next, from where the download should be continued. Using the checksum, the client tests whether the new version is already stored in the Nadeo cloud.

Now the complete file header is downloaded (16 KB, 1 MB or 16 MB). The game compares the contents of the two files and downloads only changed or new parts using HTTP range requests.

Delta updates work only with compatible files (there was once a change of the compression). In the case of incompatible files, the package is fully downloaded. The regular download is also used in the case of a timeout while reading the header.

Maniaplanet 4

With Maniaplanet 4, the names of the title packs have been changed from Name.Title.Pack.Gbx into Name@login.Title.Pack.Gbx. This invalidated all download URLs. As a result, the game now completely ignores the download URL of the package. For auto-update, the title pack must now be stored in the Nadeo cloud.

The checksum determines if a package is outdated. Whether the date of the last change is also taken into account depends on the cloud server on which the copy is located. The date is not checked if the file URL points to an Amazon Web Services server (uploaded within the game), while it is being checked when the download URL is part of a Nadeo domain (approved upload from the player page).