Table of Contents

Class DLC

Namespace
DLCToolkit
Assembly
DLCToolkit.dll

Main API for interacting with and loading DLC content from an external source. Also provides API's for retrieving DLC from various DRM (Digital Rights Management) services such as Steamworks, Google Play and more. DRM is used to ensure that the current user has access to or owns the requested DLC content if it is paid for or licensed in any way by the providing service.

public static class DLC
Inheritance
DLC

Fields

ToolkitVersion

Get the current version of DLC Toolkit.

public static readonly Version ToolkitVersion

Field Value

Version

Properties

AllDLCContents

Get all DLC contents that are currently available. This could include contents that are currently loading or loaded.

public static IEnumerable<DLCContent> AllDLCContents { get; }

Property Value

IEnumerable<DLCContent>

DRMServiceProvider

Get the service that can provide a DRM container for the current build configuration.

public static IDRMServiceProvider DRMServiceProvider { get; }

Property Value

IDRMServiceProvider

IsScriptingSupported

Check if scripting is supported on this platform. Scripting is supported only on desktop platforms using the Mono backend.

public static bool IsScriptingSupported { get; }

Property Value

bool

LoadedDLCContents

Get all DLC contents that are currently available with a loaded status. The DLC has been successfully loaded into memory.

public static IEnumerable<DLCContent> LoadedDLCContents { get; }

Property Value

IEnumerable<DLCContent>

LoadingDLCContents

Get all DLC contents that are currently available with a loading status. The DLC is currently in the process of being loaded into memory.

public static IEnumerable<DLCContent> LoadingDLCContents { get; }

Property Value

IEnumerable<DLCContent>

LocalDLCUniqueKeys

Try to get all DLC unique keys that are available locally. Local keys are simply DLC unique keys which were known about at the time of building the game (DLC profiles created before building the game). Note that only unique keys for enabled DLC profiles at the time of building the game will be available. For that reason the array will only list DLC contents that were created during development of the game, whether the DLC content was released or not. As a result it is highly recommended that you check with the current DRM provider for a true reflection of available DLC content using DLCUniqueKeysAsync (If the current platform has DRM support and the DRM provider can support listing unique contents). Alternatively you might use these local keys in combination with IsDLCAvailableAsync(IDLCAsyncProvider, string) to determine whether the DLC is usable (Exists via DRM) and is available (Installed locally).

public static string[] LocalDLCUniqueKeys { get; }

Property Value

string[]

RemoteDLCUniqueKeysAsync

Try to get all DLC unique keys that are available remotely. Remote keys are simply DLC unique keys which have been published to a DRM provider such as Steamworks. Some DRM providers may not support listing DLC contents that are published remotely. Note that only published unique keys will be returned here if the DRM provider supports listing available DLC contents. Note also that all DLC unique keys will be listed here even if the user does not own or subscribed to the downloadable content. For that reason you should use IsDLCAvailableAsync(IDLCAsyncProvider, string) to determine whether the DLC is usable (Exists via DRM) and is available (Installed locally).

public static DLCAsync<string[]> RemoteDLCUniqueKeysAsync { get; }

Property Value

DLCAsync<string[]>

Exceptions

NotSupportedException

DRM provider does not support listing published DLC unique keys

Methods

GetDLC(string)

Try to get the DLC with the specified key if it has already started loading or has been loaded.

public static DLCContent GetDLC(string uniqueKey)

Parameters

uniqueKey string

The unique key for the DLC

Returns

DLCContent

The DLC that is already loading or loaded with the provided unique key, or null if the DLC was not found

GetDLC(string, Version)

Try to get the DLC loaded with the specified name and optional version if it has already started loading or has been loaded.

public static DLCContent GetDLC(string name, Version version = null)

Parameters

name string

The name of the DLC

version Version

The optional version of the DLC if an explicit match is required

Returns

DLCContent

The DLC that is already loading or loaded from the provided path, or null if the DLC was not found

GetDLCFrom(string)

Try to get the DLC loaded from the specified path if it has already started loading or has been loaded.

public static DLCContent GetDLCFrom(string path)

Parameters

path string

The path of the DLC

Returns

DLCContent

The DLC that is already loading or loaded from the provided path, or null if the DLC was not found

GetLoadedDLC(string)

Try to get the DLC with the specified key if it has already been loaded. Note this will only detect successfully loaded DLC's and not DLC's that are currently loading.

public static DLCContent GetLoadedDLC(string uniqueKey)

Parameters

uniqueKey string

The unique key for the DLC

Returns

DLCContent

The DLC that is already loaded with the provided unique key, or null if the DLC was not found

GetLoadedDLC(string, Version)

Try to get the DLC loaded with the specified name and optional version if it has already been loaded. Note this will only detect successfully loaded DLC's and not DLC's that are currently loading.

public static DLCContent GetLoadedDLC(string name, Version version = null)

Parameters

name string

The name of the DLC

version Version

The optional version of the DLC if an explicit match is required

Returns

DLCContent

The DLC that is already loaded from the provided name and optional version, or null if the DLC was not found

GetLoadingDLC(string)

Try to get the DLC currently loading with the specified key. Note this will only detect successfully loaded DLC's and not DLC's that are currently loaded.

public static DLCContent GetLoadingDLC(string uniqueKey)

Parameters

uniqueKey string

The unique key for the DLC

Returns

DLCContent

The DLC that is loading with the provided unique key, or null if the DLC was not found

GetLoadingDLC(string, Version)

Try to get the DLC currently loading with the specified name and optional version. Note this will only detect DLC's that are currently in the process of being loaded and not DLC's that are currently loaded.

public static DLCContent GetLoadingDLC(string name, Version version = null)

Parameters

name string

The name of the DLC

version Version

The optional version of the DLC if an explicit match is required

Returns

DLCContent

The DLC that is loading with the provided name and optional version, or null if the DLC was not found

IsAvailable(string)

Check if the specified DLC is purchased and installed. Some providers may need to make a web request to check for purchased DLC, so this operations must be async.

public static DLCAsync<bool> IsAvailable(string uniqueKey)

Parameters

uniqueKey string

The unique key for the dlc

Returns

DLCAsync<bool>

True if the dlc is installed or false if not

Exceptions

NotSupportedException

No DRM provider for ths current platform

IsDLCFile(string)

Check if the specified file path is a valid DLC file format. This is intended to be a very quick check and will only load a few bytes from the source file in order to determine validity.

public static bool IsDLCFile(string path)

Parameters

path string

The path of the file to check

Returns

bool

True if the file is a valid DLC format which can be loaded, or false if not

IsDLCLoaded(string)

Check if the DLC with the specified unique key is currently loaded.

public static bool IsDLCLoaded(string uniqueKey)

Parameters

uniqueKey string

The unique key for the DLC

Returns

bool

True if the DLC is loaded or false if not

IsDLCLoaded(string, Version)

Check if the DLC with the specified name and optional version is currently loaded. Note that this method will check the DLC name/version and not the DLC unique key which can be checked by IsDLCLoaded(string) instead.

public static bool IsDLCLoaded(string name, Version version = null)

Parameters

name string

The name of the DLC

version Version

An optional version if you want to find a specific version of a loaded DLC

Returns

bool

True if the DLC is loaded or false if not

IsDLCLoading(string)

Check if the DLC with the specified unique key is currently being loaded. Note that this method is only of use when DLC async loading is used.

public static bool IsDLCLoading(string uniqueKey)

Parameters

uniqueKey string

The unique key for the DLC

Returns

bool

True if the DLC is loading or false if not

IsDLCLoading(string, Version)

Check if the DLC with the specified name and optional version is currently being loaded. Note that this method will check the DLC name/version and not the DLC unique key which can be checked by IsDLCLoading(string) instead. Note that this method is only of use when DLC async loading is used.

public static bool IsDLCLoading(string name, Version version = null)

Parameters

name string

The name of the DLC

version Version

An optional version if you want to find a specific version of a loading DLC

Returns

bool

True if the DLC is loading or false if not

LoadDLC(DLCStreamProvider)

Attempt to load DLC content with the specified unique key. Note that the unique key can be different between platforms and you should check the DLC profile to ensure that the correct key is used for the current platform. Alternatively you may be able to query IDRMProvider.DLCUniqueKeys to enumerate all available DLC's, but note that some DRM providers may not implement that property or only partially implement it (May not return all possible DLC's). The DLC will need to be available (Owned and installed) from the current DRM provider in order to succeed. The DLC will be loaded into memory and data may be preloaded according to the preload options set at build time.

public static DLCContent LoadDLC(DLCStreamProvider streamProvider)

Parameters

streamProvider DLCStreamProvider

The stream provider for the DLC content

Returns

DLCContent

A DLCContent containing the loaded DLC or null if the DLC could not be loaded

Exceptions

ArgumentNullException

The stream provider is null

NotSupportedException

There is not suitable DRM provider for this platform

TimeoutException

A DRM request timed out and the operation is aborted to avoid infinite waiting or freezing the application

DLCNotAvailableException

The requested DLC is owned but is not currently installed or available locally. You may need to request that the DLC is installed using RequestInstallDLCAsync(IDLCAsyncProvider, string)

DirectoryNotFoundException

Part of the file path could not be found

FileNotFoundException

The specified file path does not exist

FormatException

The specified file is not a valid DLC format

InvalidDataException

The specified file has been signed by another game or version - The DLC does not belong to this game

InvalidOperationException

The DLC file is missing required data or is possibly corrupt

LoadDLC(string)

Attempt to load DLC content with the specified unique key. Note that the unique key can be different between platforms and you should check the DLC profile to ensure that the correct key is used for the current platform. Alternatively you may be able to query IDRMProvider.DLCUniqueKeys to enumerate all available DLC's, but note that some DRM providers may not implement that property or only partially implement it (May not return all possible DLC's). The DLC will need to be available (Owned and installed) from the current DRM provider in order to succeed. The DLC will be loaded into memory and data may be preloaded according to the preload options set at build time.

public static DLCContent LoadDLC(string uniqueKey)

Parameters

uniqueKey string

The unique key for the DLC content

Returns

DLCContent

A DLCContent containing the loaded DLC or null if the DLC could not be loaded

Exceptions

ArgumentException

The unique key is null or empty

NotSupportedException

There is not suitable DRM provider for this platform

TimeoutException

A DRM request timed out and the operation is aborted to avoid infinite waiting or freezing the application

DLCNotAvailableException

The requested DLC is owned but is not currently installed or available locally. You may need to request that the DLC is installed using RequestInstallDLCAsync(IDLCAsyncProvider, string)

DirectoryNotFoundException

Part of the file path could not be found

FileNotFoundException

The specified file path does not exist

FormatException

The specified file is not a valid DLC format

InvalidDataException

The specified file has been signed by another game or version - The DLC does not belong to this game

InvalidOperationException

The DLC file is missing required data or is possibly corrupt

LoadDLCAsync(DLCStreamProvider)

Attempt to load DLC content from the specified stream provider asynchronously. If the target DLC is already being loaded or has been loaded, this method will simply return the current load operation or a completed operation with the already loaded DLCContent. Note that the unique key can be different between platforms and you should check the DLC profile to ensure that the correct key is used for the current platform. Alternatively you may be able to query IDRMProvider.DLCUniqueKeys to enumerate all available DLC's, but note that some DRM providers may not implement that property or only partially implement it (May not return all possible DLC's). The DLC will be loaded on the background thread so it is possible to continue with gameplay or show an animated loading screen. The DLC will be loaded into memory and data may be preloaded according to the preload options set at build time. Note that a DRM provider is required for the current platform, otherwise you should use LoadDLCFromAsync(string).

public static DLCAsync<DLCContent> LoadDLCAsync(DLCStreamProvider streamProvider)

Parameters

streamProvider DLCStreamProvider

The stream provider for the DLC content

Returns

DLCAsync<DLCContent>

A DLCContent containing the loaded DLC or null if the DLC could not be loaded

Exceptions

ArgumentNullException

The stream provider is null

NotSupportedException

There is no suitable DRM provider for this platform

DirectoryNotFoundException

Part of the file path could not be found

FileNotFoundException

The specified file path does not exist

FormatException

The specified file is not a valid DLC format

InvalidDataException

The specified file has been signed by another game or version - The DLC does not belong to this game

InvalidOperationException

The DLC file is missing required data or is possibly corrupt

LoadDLCAsync(string, bool)

Attempt to load DLC content with the specified unique key asynchronously. If the target DLC is already being loaded or has been loaded, this method will simply return the current load operation or a completed operation with the already loaded DLCContent. Note that the unique key can be different between platforms and you should check the DLC profile to ensure that the correct key is used for the current platform. Alternatively you may be able to query IDRMProvider.DLCUniqueKeys to enumerate all available DLC's, but note that some DRM providers may not implement that property or only partially implement it (May not return all possible DLC's). The DLC will be loaded on the background thread so it is possible to continue with gameplay or show an animated loading screen. The DLC will need to be available (Owned and installed, or owned with installOnDemand enabled) from the current DRM provider in order to succeed. The DLC will be loaded into memory and data may be preloaded according to the preload options set at build time. Note that a DRM provider is required for the current platform, otherwise you should use LoadDLCFromAsync(string).

public static DLCAsync<DLCContent> LoadDLCAsync(string uniqueKey, bool installOnDemand = false)

Parameters

uniqueKey string

The unique key for the DLC content

installOnDemand bool

Should the DLC be installed if it is owned by the used but not available locally. Only available in async mode

Returns

DLCAsync<DLCContent>

A DLCContent containing the loaded DLC or null if the DLC could not be loaded

Exceptions

ArgumentException

The unique key is null or empty

NotSupportedException

There is no suitable DRM provider for this platform

DirectoryNotFoundException

Part of the file path could not be found

FileNotFoundException

The specified file path does not exist

FormatException

The specified file is not a valid DLC format

InvalidDataException

The specified file has been signed by another game or version - The DLC does not belong to this game

InvalidOperationException

The DLC file is missing required data or is possibly corrupt

LoadDLCBatchAsync(string[], bool)

Attempt to load multiple DLC content simultaneously with the specified unique keys asynchronously. Note that the unique key can be different between platforms and you should check the DLC profile to ensure that the correct key is used for the current platform. Alternatively you may be able to query IDRMProvider.DLCUniqueKeys to enumerate all available DLC's, but note that some DRM providers may not implement that property or only partially implement it (May not return all possible DLC's). The DLC will be loaded on the background thread so it is possible to continue with gameplay or show an animated loading screen. The DLC will need to be available (Owned and installed, or owned with installOnDemand enabled) from the current DRM provider in order to succeed. The DLC will be loaded into memory and data may be preloaded according to the preload options set at build time. Note that a DRM provider is required for the current platform, otherwise you should use LoadDLCFromAsync(string). Note that this method will suppress any exceptions and report them in the resulting async operation if caught.

public static DLCBatchAsync<DLCContent> LoadDLCBatchAsync(string[] uniqueKeys, bool installOnDemand)

Parameters

uniqueKeys string[]

An array of unique keys for all DLC content to load

installOnDemand bool

Should the DLC be installed if it is owned by the user but not available locally. Only available in async mode

Returns

DLCBatchAsync<DLCContent>

A batch async operation which can report progress for the combined load operation as a whole, or can provide access to each inner load request

Exceptions

ArgumentNullException

The unique keys are empty

LoadDLCBatchFromAsync(string[])

Attempt to load multiple DLC content simultaneously from the paths asynchronously. The DLC will be loaded on the background thread so it is possible to continue with gameplay or show an animated loading screen. The DLC will be loaded into memory and data may be preloaded according to the preload options set at build time. Note that a DRM provider is required for the current platform, otherwise you should use LoadDLCFromAsync(string). Note that this method will suppress any exceptions and report them in the resulting async operation if caught.

public static DLCBatchAsync<DLCContent> LoadDLCBatchFromAsync(string[] paths)

Parameters

paths string[]

An array of paths for all DLC content to load

Returns

DLCBatchAsync<DLCContent>

A batch async operation which can report progress for the combined load operation as a whole, or can provide access to each inner load request

Exceptions

ArgumentNullException

The paths are empty

LoadDLCFrom(string)

Attempt to load DLC content from the specified file path. The DLC will be loaded into memory and data may be preloaded according to the preload options set at build time.

public static DLCContent LoadDLCFrom(string path)

Parameters

path string

The file path containing the DLC content

Returns

DLCContent

A DLCContent containing the loaded DLC

Exceptions

ArgumentException

The path is null or empty

DirectoryNotFoundException

Part of the file path could not be found

FileNotFoundException

The specified file path does not exist

FormatException

The specified file is not a valid DLC format

InvalidDataException

The specified file has been signed by another game or version - The DLC does not belong to this game

InvalidOperationException

The DLC file is missing required data or is possibly corrupt

LoadDLCFromAsync(string)

Attempt to load DLC content from the specified file path asynchronously. The DLC will be loaded into memory and data may be preloaded according to the preload options set at build time.

public static DLCAsync<DLCContent> LoadDLCFromAsync(string path)

Parameters

path string

The file path containing the DLC content

Returns

DLCAsync<DLCContent>

A DLCAsync operation that can be awaited and provides access to the loaded DLC

Exceptions

ArgumentException

The path is null or empty

DirectoryNotFoundException

Part of the file path could not be found

FileNotFoundException

The specified file path does not exist

FormatException

The specified file is not a valid DLC format

InvalidDataException

The specified file has been signed by another game or version - The DLC does not belong to this game

InvalidOperationException

The DLC file is missing required data or is possibly corrupt

LoadDLCMetadata(DLCStreamProvider)

Attempt to load DLC content with the specified unique key. This is a reduced load mode and it will only be possible to access the IDLCMetadata for the DLC and nothing more. Designed to be a quick operation for accessing metadata, but may take some time to complete depending upon DRM provider and availability. Use LoadDLCAsync(string, bool) if you need to load assets from the DLC. Note that the unique key can be different between platforms and you should check the DLC profile to ensure that the correct key is used for the current platform. Alternatively you may be able to query IDRMProvider.DLCUniqueKeys to enumerate all available DLC's, but note that some DRM providers may not implement that property or only partially implement it (May not return all possible DLC's). The DLC will need to be available (Owned and installed) from the current DRM provider in order to succeed. The DLC will be loaded into memory and data may be preloaded according to the preload options set at build time.

public static IDLCMetadata LoadDLCMetadata(DLCStreamProvider streamProvider)

Parameters

streamProvider DLCStreamProvider

The stream provider for the DLC content

Returns

IDLCMetadata

A DLCContent containing the loaded DLC or null if the DLC could not be loaded

Exceptions

ArgumentNullException

The stream provider is null

NotSupportedException

There is not suitable DRM provider for this platform

TimeoutException

A DRM request timed out and the operation is aborted to avoid infinite waiting or freezing the application

DLCNotAvailableException

The requested DLC is owned but is not currently installed or available locally. You may need to request that the DLC is installed using RequestInstallDLCAsync(IDLCAsyncProvider, string)

DirectoryNotFoundException

Part of the file path could not be found

FileNotFoundException

The specified file path does not exist

FormatException

The specified file is not a valid DLC format

InvalidDataException

The specified file has been signed by another game or version - The DLC does not belong to this game

InvalidOperationException

The DLC file is missing required data or is possibly corrupt

LoadDLCMetadata(string)

Attempt to load DLC content with the specified unique key. This is a reduced load mode and it will only be possible to access the IDLCMetadata for the DLC and nothing more. Designed to be a quick operation for accessing metadata, but may take some time to complete depending upon DRM provider and availability. Use LoadDLCAsync(string, bool) if you need to load assets from the DLC. Note that the unique key can be different between platforms and you should check the DLC profile to ensure that the correct key is used for the current platform. Alternatively you may be able to query IDRMProvider.DLCUniqueKeys to enumerate all available DLC's, but note that some DRM providers may not implement that property or only partially implement it (May not return all possible DLC's). The DLC will need to be available (Owned and installed) from the current DRM provider in order to succeed. The DLC will be loaded into memory and data may be preloaded according to the preload options set at build time.

public static IDLCMetadata LoadDLCMetadata(string uniqueKey)

Parameters

uniqueKey string

The unique key for the DLC content

Returns

IDLCMetadata

A DLCContent containing the loaded DLC or null if the DLC could not be loaded

Exceptions

ArgumentException

The unique key is null or empty

NotSupportedException

There is not suitable DRM provider for this platform

TimeoutException

A DRM request timed out and the operation is aborted to avoid infinite waiting or freezing the application

DLCNotAvailableException

The requested DLC is owned but is not currently installed or available locally. You may need to request that the DLC is installed using RequestInstallDLCAsync(IDLCAsyncProvider, string)

DirectoryNotFoundException

Part of the file path could not be found

FileNotFoundException

The specified file path does not exist

FormatException

The specified file is not a valid DLC format

InvalidDataException

The specified file has been signed by another game or version - The DLC does not belong to this game

InvalidOperationException

The DLC file is missing required data or is possibly corrupt

LoadDLCMetadataAsync(DLCStreamProvider)

Attempt to load DLC metadata only from the specified stream provider asynchronously in metadata. This is a reduced load mode and it will only be possible to access the IDLCMetadata for the DLC and nothing more. Designed to be a quick operation for accessing metadata, but may take some time to complete depending upon DRM provider and availability. Use LoadDLCAsync(string, bool) if you need to load assets from the DLC. Note that the unique key can be different between platforms and you should check the DLC profile to ensure that the correct key is used for the current platform. Alternatively you may be able to query IDRMProvider.DLCUniqueKeys to enumerate all available DLC's, but note that some DRM providers may not implement that property or only partially implement it (May not return all possible DLC's). The DLC metadata will be loaded on the background thread so it is possible to continue with gameplay or show an animated loading screen. The DLC will be loaded into memory and data may be preloaded according to the preload options set at build time. Note that a DRM provider is required for the current platform, otherwise you should use LoadDLCMetadataFrom(string).

public static DLCAsync<IDLCMetadata> LoadDLCMetadataAsync(DLCStreamProvider streamProvider)

Parameters

streamProvider DLCStreamProvider

The stream provider for the DLC content

Returns

DLCAsync<IDLCMetadata>

A DLCContent containing the loaded DLC or null if the DLC could not be loaded

Exceptions

ArgumentNullException

The stream provider is null

NotSupportedException

There is no suitable DRM provider for this platform

DirectoryNotFoundException

Part of the file path could not be found

FileNotFoundException

The specified file path does not exist

FormatException

The specified file is not a valid DLC format

InvalidDataException

The specified file has been signed by another game or version - The DLC does not belong to this game

InvalidOperationException

The DLC file is missing required data or is possibly corrupt

LoadDLCMetadataAsync(string, bool)

Attempt to load DLC metadata only with the specified unique key asynchronously in metadata with assets mode. This is a reduced load mode and it will only be possible to access the IDLCMetadata for the DLC and nothing more. Designed to be a quick operation for accessing metadata, but may take some time to complete depending upon DRM provider and availability. Use LoadDLCAsync(string, bool) if you need to load assets from the DLC. Note that the unique key can be different between platforms and you should check the DLC profile to ensure that the correct key is used for the current platform. Alternatively you may be able to query IDRMProvider.DLCUniqueKeys to enumerate all available DLC's, but note that some DRM providers may not implement that property or only partially implement it (May not return all possible DLC's). The DLC metadata will be loaded on the background thread so it is possible to continue with gameplay or show an animated loading screen. The DLC will need to be available (Owned and installed, or owned with installOnDemand enabled) from the current DRM provider in order to succeed. The DLC will be loaded into memory and data may be preloaded according to the preload options set at build time. Note that a DRM provider is required for the current platform, otherwise you should use LoadDLCMetadataFrom(string).

public static DLCAsync<IDLCMetadata> LoadDLCMetadataAsync(string uniqueKey, bool installOnDemand = false)

Parameters

uniqueKey string

The unique key for the DLC content

installOnDemand bool

Should the DLC be installed if it is owned by the used but not available locally. Only available in async mode

Returns

DLCAsync<IDLCMetadata>

A DLCContent containing the loaded DLC or null if the DLC could not be loaded

Exceptions

ArgumentException

The unique key is null or empty

NotSupportedException

There is no suitable DRM provider for this platform

DirectoryNotFoundException

Part of the file path could not be found

FileNotFoundException

The specified file path does not exist

FormatException

The specified file is not a valid DLC format

InvalidDataException

The specified file has been signed by another game or version - The DLC does not belong to this game

InvalidOperationException

The DLC file is missing required data or is possibly corrupt

LoadDLCMetadataFrom(string)

Attempt to load DLC metadata only from the specified file path. Intended to be very quick access and will only load the absolute minimum amount of data required to access the meta information for the DLC. Only the DLC metadata will be loaded into memory.

public static IDLCMetadata LoadDLCMetadataFrom(string path)

Parameters

path string

The file path containing the DLC content

Returns

IDLCMetadata

A IDLCMetadata containing the loaded DLC metadata

Exceptions

ArgumentException

The path is null or empty

DirectoryNotFoundException

Part of the file path could not be found

FileNotFoundException

The specified file path does not exist

FormatException

The specified file is not a valid DLC format

InvalidDataException

The specified file has been signed by another game or version - The DLC does not belong to this game

InvalidOperationException

The DLC file is missing required data or is possibly corrupt

LoadDLCMetadataFromAsync(string)

Attempt to load DLC metadata only from the specified file path asynchronously. Intended to be very quick access and will only load the absolute minimum amount of data required to access the meta information for the DLC. Only the DLC metadata will be loaded into memory.

public static DLCAsync<IDLCMetadata> LoadDLCMetadataFromAsync(string path)

Parameters

path string

The file path containing the DLC content

Returns

DLCAsync<IDLCMetadata>

A DLCAsync operation that can be awaited and provides access to the DLC metadata

Exceptions

ArgumentException

The path is null or empty

DirectoryNotFoundException

Part of the file path could not be found

FileNotFoundException

The specified file path does not exist

FormatException

The specified file is not a valid DLC format

InvalidDataException

The specified file has been signed by another game or version - The DLC does not belong to this game

InvalidOperationException

The DLC file is missing required data or is possibly corrupt

LoadDLCMetadataWithAssets(DLCStreamProvider)

Attempt to load DLC content with the specified unique key. This is a reduced load mode and it will be possible to access extra metadata for assets and scenes, but it will not be possible to load any asset or scene content into the game. Note that the unique key can be different between platforms and you should check the DLC profile to ensure that the correct key is used for the current platform. Alternatively you may be able to query IDRMProvider.DLCUniqueKeys to enumerate all available DLC's, but note that some DRM providers may not implement that property or only partially implement it (May not return all possible DLC's). The DLC will need to be available (Owned and installed) from the current DRM provider in order to succeed. The DLC will be loaded into memory and data may be preloaded according to the preload options set at build time.

public static DLCContent LoadDLCMetadataWithAssets(DLCStreamProvider streamProvider)

Parameters

streamProvider DLCStreamProvider

The stream provider for the DLC content

Returns

DLCContent

A DLCContent containing the loaded DLC or null if the DLC could not be loaded

Exceptions

ArgumentNullException

The stream provider is null

NotSupportedException

There is not suitable DRM provider for this platform

TimeoutException

A DRM request timed out and the operation is aborted to avoid infinite waiting or freezing the application

DLCNotAvailableException

The requested DLC is owned but is not currently installed or available locally. You may need to request that the DLC is installed using RequestInstallDLCAsync(IDLCAsyncProvider, string)

DirectoryNotFoundException

Part of the file path could not be found

FileNotFoundException

The specified file path does not exist

FormatException

The specified file is not a valid DLC format

InvalidDataException

The specified file has been signed by another game or version - The DLC does not belong to this game

InvalidOperationException

The DLC file is missing required data or is possibly corrupt

LoadDLCMetadataWithAssets(string)

Attempt to load DLC content with the specified unique key. This is a reduced load mode and it will be possible to access extra metadata for assets and scenes, but it will not be possible to load any asset or scene content into the game. Note that the unique key can be different between platforms and you should check the DLC profile to ensure that the correct key is used for the current platform. Alternatively you may be able to query IDRMProvider.DLCUniqueKeys to enumerate all available DLC's, but note that some DRM providers may not implement that property or only partially implement it (May not return all possible DLC's). The DLC will need to be available (Owned and installed) from the current DRM provider in order to succeed. The DLC will be loaded into memory and data may be preloaded according to the preload options set at build time.

public static DLCContent LoadDLCMetadataWithAssets(string uniqueKey)

Parameters

uniqueKey string

The unique key for the DLC content

Returns

DLCContent

A DLCContent containing the loaded DLC or null if the DLC could not be loaded

Exceptions

ArgumentException

The unique key is null or empty

NotSupportedException

There is not suitable DRM provider for this platform

TimeoutException

A DRM request timed out and the operation is aborted to avoid infinite waiting or freezing the application

DLCNotAvailableException

The requested DLC is owned but is not currently installed or available locally. You may need to request that the DLC is installed using RequestInstallDLCAsync(IDLCAsyncProvider, string)

DirectoryNotFoundException

Part of the file path could not be found

FileNotFoundException

The specified file path does not exist

FormatException

The specified file is not a valid DLC format

InvalidDataException

The specified file has been signed by another game or version - The DLC does not belong to this game

InvalidOperationException

The DLC file is missing required data or is possibly corrupt

LoadDLCMetadataWithAssetsAsync(DLCStreamProvider)

Attempt to load DLC content from the specified stream provider asynchronously in metadata with assets mode. This is a reduced load mode and it will be possible to access extra metadata for assets and scenes, but it will not be possible to load any asset or scene content into the game. Use LoadDLCAsync(string, bool) if you need to load assets from the DLC. Note that the unique key can be different between platforms and you should check the DLC profile to ensure that the correct key is used for the current platform. Alternatively you may be able to query IDRMProvider.DLCUniqueKeys to enumerate all available DLC's, but note that some DRM providers may not implement that property or only partially implement it (May not return all possible DLC's). The DLC will be loaded on the background thread so it is possible to continue with gameplay or show an animated loading screen. The DLC will be loaded into memory and data may be preloaded according to the preload options set at build time. Note that a DRM provider is required for the current platform, otherwise you should use LoadDLCMetadataWithAssetsFrom(string).

public static DLCAsync<DLCContent> LoadDLCMetadataWithAssetsAsync(DLCStreamProvider streamProvider)

Parameters

streamProvider DLCStreamProvider

The stream provider for the DLC content

Returns

DLCAsync<DLCContent>

A DLCContent containing the loaded DLC or null if the DLC could not be loaded

Exceptions

ArgumentNullException

The stream provider is null

NotSupportedException

There is no suitable DRM provider for this platform

DirectoryNotFoundException

Part of the file path could not be found

FileNotFoundException

The specified file path does not exist

FormatException

The specified file is not a valid DLC format

InvalidDataException

The specified file has been signed by another game or version - The DLC does not belong to this game

InvalidOperationException

The DLC file is missing required data or is possibly corrupt

LoadDLCMetadataWithAssetsAsync(string, bool)

Attempt to load DLC content with the specified unique key asynchronously in metadata with assets mode. This is a reduced load mode and it will be possible to access extra metadata for assets and scenes, but it will not be possible to load any asset or scene content into the game. Use LoadDLCAsync(string, bool) if you need to load assets from the DLC. Note that the unique key can be different between platforms and you should check the DLC profile to ensure that the correct key is used for the current platform. Alternatively you may be able to query IDRMProvider.DLCUniqueKeys to enumerate all available DLC's, but note that some DRM providers may not implement that property or only partially implement it (May not return all possible DLC's). The DLC will be loaded on the background thread so it is possible to continue with gameplay or show an animated loading screen. The DLC will need to be available (Owned and installed, or owned with installOnDemand enabled) from the current DRM provider in order to succeed. The DLC will be loaded into memory and data may be preloaded according to the preload options set at build time. Note that a DRM provider is required for the current platform, otherwise you should use LoadDLCMetadataWithAssetsFrom(string).

public static DLCAsync<DLCContent> LoadDLCMetadataWithAssetsAsync(string uniqueKey, bool installOnDemand = false)

Parameters

uniqueKey string

The unique key for the DLC content

installOnDemand bool

Should the DLC be installed if it is owned by the used but not available locally. Only available in async mode

Returns

DLCAsync<DLCContent>

A DLCContent containing the loaded DLC or null if the DLC could not be loaded

Exceptions

ArgumentException

The unique key is null or empty

NotSupportedException

There is no suitable DRM provider for this platform

DirectoryNotFoundException

Part of the file path could not be found

FileNotFoundException

The specified file path does not exist

FormatException

The specified file is not a valid DLC format

InvalidDataException

The specified file has been signed by another game or version - The DLC does not belong to this game

InvalidOperationException

The DLC file is missing required data or is possibly corrupt

LoadDLCMetadataWithAssetsFrom(string)

Attempt to load DLC metadata with assets only from the specified file path. Intended to be very quick access and will only load the absolute minimum amount of data required to access the meta information for the DLC. Only the DLC metadata and asset metadata will be loaded into memory (Assets, scenes and scripts will not be loadable). SharedAssets and SceneAssets will be accessible after successful load to discover meta information about included assets.

public static DLCContent LoadDLCMetadataWithAssetsFrom(string path)

Parameters

path string

The file path containing the DLC content

Returns

DLCContent

A DLCContent containing the loaded DLC

Exceptions

ArgumentException

The path is null or empty

DirectoryNotFoundException

Part of the file path could not be found

FileNotFoundException

The specified file path does not exist

FormatException

The specified file is not a valid DLC format

InvalidDataException

The specified file has been signed by another game or version - The DLC does not belong to this game

InvalidOperationException

The DLC file is missing required data or is possibly corrupt

LoadDLCMetadataWithAssetsFromAsync(string)

Attempt to load DLC metadata with assets only from the specified file path asynchronously. Intended to be very quick access and will only load the absolute minimum amount of data required to access the meta information for the DLC. Only the DLC metadata and asset metadata will be loaded into memory (Assets, scenes and scripts will not be loadable). SharedAssets and SceneAssets will be accessible after successful load to discover meta information only about included assets.

public static DLCAsync<DLCContent> LoadDLCMetadataWithAssetsFromAsync(string path)

Parameters

path string

The file path containing the DLC content

Returns

DLCAsync<DLCContent>

A DLCAsync operation that can be awaited and provides access to the loaded DLC

Exceptions

ArgumentException

The path is null or empty

DirectoryNotFoundException

Part of the file path could not be found

FileNotFoundException

The specified file path does not exist

FormatException

The specified file is not a valid DLC format

InvalidDataException

The specified file has been signed by another game or version - The DLC does not belong to this game

InvalidOperationException

The DLC file is missing required data or is possibly corrupt

RegisterDRMServiceProvider(IDRMServiceProvider)

Register a custom IDRMServiceProvider which is responsible for providing the correct DRM management for the current build configuration.

public static void RegisterDRMServiceProvider(IDRMServiceProvider serviceProvider)

Parameters

serviceProvider IDRMServiceProvider

The custom service provider or null, in which case the default DRM service provider will be used

RequestInstall(string)

Request that the dlc with the provided unique key is installed onto the system if it is available to the user.

public static DLCAsync RequestInstall(string uniqueKey)

Parameters

uniqueKey string

The async provider to allow async tasks to be started

Returns

DLCAsync

The unique key of the dlc

Exceptions

NotSupportedException

No DRM provider for ths current platform

RequestUninstall(string)

Request that the dlc with the provided unique key is uninstalled from the system if it is currently installed.

public static void RequestUninstall(string uniqueKey)

Parameters

uniqueKey string

The unique key of the dlc

Exceptions

NotSupportedException

No DRM provider for ths current platform