Info
- Addressables content the app downloads from ServiceHub Releases, by collection, channel and platform. A release updates the app's own Addressables catalog
- Code in
ServiceHub/Releases (API client) and ServiceHub/ReleaseContent (loading, cache, UI in UI/, build tools in Editor/)
- Backend: Releases API, collections, channels, upload keys and publishing in the console: Releases
- Needs the Releases service turned on for the app
- Builds and content updates: Build Tool, CI: JetBrains TeamCity
Setup
ServiceHubManager needs its optional Releases module (the kit prefab has it)
- Prefab
Multiplayer/ServiceHub/ReleaseContentManager.prefab in the XR content kit, load item ReleaseContentManagerLoader with the category ReleaseContentLoadCategory. The kit's definitions and localization preloaders depend on that category
- Settings SO
ReleaseContentSettings in the project (Create > Polis/ServiceHub/ReleaseContentSettings, also under ServiceHub/Release Content in App Management), addressable with the Settings label. Each collection has:
Key - the collection key in ServiceHub, main by default
Name - shown in the app, the key when empty
Kind - Required (all of it downloads while loading, the app waits when online), Optional (parts the user downloads), System (another system downloads the parts, e.g. languages)
Parts - Addressables labels that download on their own, with a display name. No parts: the whole collection is one part
- Platform key and Download All come from the Release Content module of the platform config (e.g.
android-vr, Download All on dedicated servers). The build writes the key into AppBuildInfo and Download All into the settings, the editor uses the Platform Key of the project's AppBuildInfo. With ReleaseContentSettings in the project, a platform config without a key fails the build
- Collections are the app's own remote groups: each release carries an app catalog with its hash file, parts are labels in it. The
pso and build-data collections have their own code and aren't listed here
- Without settings, a platform key or the Releases module the manager only warns and registers nothing
Usage
ReleasesService (ServiceHubManager.Releases) - the API
SelectedChannel - picked on this device, empty uses the app's default channel
GetChannelsAsync - channels this user may load (Name, IsDefault)
ResolveAsync(collection, platform, appVersion, version, appBuild, pick) - the newest finished build on the selected channel that fits the app version, or the given version (fresh links for a loaded one). appBuild is the hash of the built-in catalog, it matches app content to this build. ReleasePick.Shipped answers with the content the app build shipped with, whatever the channel serves
ResolvedRelease - Collection, Channel, Platform, Version, Notes, Kind (shipped, update, release), ExpiresAt, Files (Path, Size, Hash, signed Url), LinksExpired(margin)
FindUploadedAsync - the newest fitting release, published or not
UploadAsync(ReleaseUpload) - uploads an unpublished release with the signed-in account, only the files the hub doesn't have, one request per file (fine for a few MB)
- Upload and find need a signed-in Release Uploader or Manager, 403 otherwise
ReleaseContentManager (service) - loads the collections and downloads their parts
Collections (ReleaseCollectionState: Release, IsLoaded, IsOffline, Update, HasUpdate, IsUpdatingContent), TryGetCollection, CollectionChanged
GetPart(collection, part) - a ReleasePartState kept up to date: IsKnown (the loaded release has the part), DownloadSize, TotalSize, IsDownloaded, IsDownloading, Progress, IsFailed (until the next try), Job. No part is the whole collection. PartChanged
DownloadAsync(collection, part) - through the download queue. A running download of the same part is shared and goes on when the caller is gone
Clear(collection, part) - removes the part from the device, false when its collection isn't loaded
GetDownloadSize(collection, part) - bytes of its bundles that aren't on the device
CheckForUpdatesAsync() - a newer release on the channel becomes the collection's Update, it loads at the next start. Collections that didn't load try again
ContentUpdating - parts downloaded before start downloading again, e.g. after an update
- Services it registers
DownloadQueue - one download at a time. The boot screen shows the running one with bytes, speed and time left (DownloadQueueLoaderPanel)
IDownloadedContent - ContentChanged after downloads, removals and catalog changes. The definition registry and addressable prefab lists pick up new content from it
ILocaleContent - parts labelled Locale- plus the locale code (e.g. Locale-de) with downloadable content are language downloads, shown by LocaleDownloadsDropdown. The current language can't be removed. A language that isn't on the device with nothing to download it from shows as unavailable and can't be picked, a failed download as failed. A saved language that isn't on the device starts in its fallback
IGraphicsStateContent - registered by its own kit load item (GraphicsStateContentLoader, ReleaseGraphicsStateContentLoader), so the warmup doesn't wait for the release content. PSO recordings in the pso collection: GraphicsWarmupLoader uses a downloaded set newer than the build's own, the newest published set's file for this device and quality level downloads in the background for the next start. The debug menu sends a recording as a new unpublished release (signed-in Release Uploader), a Release Manager publishes it
- UI
ReleaseContentPage - Settings › Downloads: the loaded version (the required collection, else the first) with the waiting update, Unavailable when the release didn't load, Check for updates, Restart while an update waits, a row per part of each optional collection. Shown only when the app loads release content (ReleaseContentAvailableCondition)
ReleaseChannelDropdown - channels this user may load, a change asks and restarts the app. Offline only the loaded channel is listed. Picking the default stores an empty channel, so a new default on the hub applies
ReleasePartRow - name, size or bytes and time left, progress, download and remove (confirm dialog with name and size). Download is off while the hub is unreachable. A part the hub doesn't have shows as unavailable, a failed download shows Download failed and a retry button until the next try
ReleaseContentUpdatingNotifier - toast notifier: content downloaded before an update downloads again, the Downloads page shows its progress
ContentRequirement - for the RequirementOverlay (locked overlay): met when the part, or the whole collection, is on the device. Its download shows as the overlay's progress bar
How it loads
- At start each collection resolves its newest release for this app build. With a cached release the boot waits at most 3 s for the hub, unless a newer release found after the last start waits for this one