Autoupdate

From VDrift
Revision as of 08:33, 27 July 2011 by Venzon (talk | contribs) (New page: This page describes, at a high level, how the auto-update function works. ==Introduction== One major barrier to releasing more often is the huge size of the VDrift releases. These large s...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page describes, at a high level, how the auto-update function works.

Introduction

One major barrier to releasing more often is the huge size of the VDrift releases. These large sizes are due to the large number of cars and tracks that are typically included in a release. If VDrift has auto-update functionality, then releases can be very minimal (one track and one car, for example) and people can download new cars and tracks (and keep their existing ones up to date) through an in-game interface.

The rest of this document talks exclusively about updating cars, but tracks should work similarly.

The auto-update functionality was first proposed in this forum post: http://vdrift.net/Forum/viewtopic.php?p=12999

User Interface

Several GUI pages have been added. From the main menu, the "Cars and Tracks" button takes the user to a page with options to check for updates and manage cars. When the user clicks "check for updates", the sourceforge svn browser html is scraped to get the latest revision numbers for the car folders. The car manager UI is populated from code and allows the user to see what updates are available and provides an "apply update" button.

Versioning

There are two types of versioning: the versioning for each car folder, and the versioning for the car format.

First, car folder versioning. The data/settings/updates.config file is distributed with each release, and contains the cars that have been included in that release along with their SVN revision numbers. When the game checks for updates, the sourceforge svn browser html is scraped to get the latest revision numbers, and that information ([available_cars] section) along with the current on-disk versions ([cars] section) are stored in an updates.config in the user's folder (~/.vdrift on linux). The game offers to apply updates when the on-disk versions are less than the available versions.

Next, car format versioning. Sometimes, the format of car files changes in a way that breaks compatibility with old data files. To protect against updating cars to a format that the user's executables won't understand, format versions are stored in the updates.config file in the [formats] section. The version of the car format that the executable release understands is set in the data/settings/updates.config file included in the release (and copied to the user's folder). The game retrieves the latest data/settings/update.config via the sourceforge svn website and checks the format version there to make sure it matches the version number in the local update.config. If the format versions are not equal, updates will refuse to apply.