Table of Contents

Class GameInstallerBase

Namespace
Hi3Helper.Plugin.Core.Management
Assembly
Hi3Helper.Plugin.Core.dll
[GeneratedComClass]
[ComExposedClass<ComClassInformation>]
public abstract class GameInstallerBase : InitializableTask, IGameInstaller, IGameUninstaller, IInitializableTask, IFree
Inheritance
GameInstallerBase
Implements
Inherited Members

Constructors

GameInstallerBase(IGameManager?)

protected GameInstallerBase(IGameManager? gameManager)

Parameters

gameManager IGameManager

Fields

GameManager

The current instance of IGameManager.

protected readonly IGameManager GameManager

Field Value

IGameManager

Methods

Dispose()

public abstract void Dispose()

EnsureAndGetGamePath()

Gets the current game installation path and throw if it's empty (or unset).

protected string EnsureAndGetGamePath()

Returns

string

A path of the current game installation.

Exceptions

InvalidOperationException

If the current game installation path isn't set.

Free()

Free the resources associated by an instance.

public override void Free()

GetGameDownloadedSizeAsync(GameInstallerKind, in Guid, out nint)

Gets the size of existing/downloaded assets depends on the current state.

public void GetGameDownloadedSizeAsync(GameInstallerKind gameInstallerKind, in Guid cancelToken, out nint result)

Parameters

gameInstallerKind GameInstallerKind

Kind of game state of the size to retrieve.

cancelToken Guid

Cancel token for the async operation.

result nint

A pointer to the ComAsyncResult instance.

Remarks

This method returns a pointer to the ComAsyncResult instance via result.
The pointer must be passed to AsTask<T>(nint) and set the generic
result to long in order to await and get the result from this async function.

GetGameDownloadedSizeAsyncInner(GameInstallerKind, CancellationToken)

Gets only the total size of the downloaded files based on the method of the game installation.

protected abstract Task<long> GetGameDownloadedSizeAsyncInner(GameInstallerKind gameInstallerKind, CancellationToken token)

Parameters

gameInstallerKind GameInstallerKind

The method of the game installation kind.

token CancellationToken

A token for async operation cancellation.

Returns

Task<long>

The total size of already downloaded files.

GetGameSizeAsync(GameInstallerKind, in Guid, out nint)

Gets the estimated total size of the game depends on the current state.

public void GetGameSizeAsync(GameInstallerKind gameInstallerKind, in Guid cancelToken, out nint result)

Parameters

gameInstallerKind GameInstallerKind

Kind of game state of the size to retrieve.

cancelToken Guid

Cancel token for the async operation.

result nint

A pointer to the ComAsyncResult instance.

Remarks

This method returns a pointer to the ComAsyncResult instance via result.
The pointer must be passed to AsTask<T>(nint) and set the generic
result to long in order to await and get the result from this async function.

GetGameSizeAsyncInner(GameInstallerKind, CancellationToken)

Gets the game size based on the method of the game installation.

protected abstract Task<long> GetGameSizeAsyncInner(GameInstallerKind gameInstallerKind, CancellationToken token)

Parameters

gameInstallerKind GameInstallerKind

The method of the game installation kind.

token CancellationToken

A token for async operation cancellation.

Returns

Task<long>

The total size of the game installation based on its method.

StartInstallAsync(InstallProgressDelegate?, InstallProgressStateDelegate?, in Guid, out nint)

Perform installation routine asynchronously.

public void StartInstallAsync(InstallProgressDelegate? progressDelegate, InstallProgressStateDelegate? progressStateDelegate, in Guid cancelToken, out nint result)

Parameters

progressDelegate InstallProgressDelegate

A delegate to get the progress of the routine.

progressStateDelegate InstallProgressStateDelegate

A delegate to get the state of the progress of the routine.

cancelToken Guid

A cancel token for cancelling the async operation.

result nint

A pointer to the ComAsyncResult instance.

Remarks

This method returns a pointer to the ComAsyncResult instance via result.
The pointer must be passed to AsTask(nint) in order to await the async function.
The function, however is not-returnable.

StartInstallAsyncInner(InstallProgressDelegate?, InstallProgressStateDelegate?, CancellationToken)

Starts performing game installation operation.

protected abstract Task StartInstallAsyncInner(InstallProgressDelegate? progressDelegate, InstallProgressStateDelegate? progressStateDelegate, CancellationToken token)

Parameters

progressDelegate InstallProgressDelegate

A callback which reports the progress of the current game installation process.

progressStateDelegate InstallProgressStateDelegate

A callback which reports the state of the game installation process.

token CancellationToken

A token for async operation cancellation.

Returns

Task

StartPreloadAsync(InstallProgressDelegate?, InstallProgressStateDelegate?, in Guid, out nint)

Perform preload routine asynchronously. Returns immediately if no preload is available.

public void StartPreloadAsync(InstallProgressDelegate? progressDelegate, InstallProgressStateDelegate? progressStateDelegate, in Guid cancelToken, out nint result)

Parameters

progressDelegate InstallProgressDelegate

A delegate to get the progress of the routine.

progressStateDelegate InstallProgressStateDelegate

A delegate to get the state of the progress of the routine.

cancelToken Guid

A cancel token for cancelling the async operation.

result nint

A pointer to the ComAsyncResult instance.

Remarks

This method returns a pointer to the ComAsyncResult instance via result.
The pointer must be passed to AsTask(nint) in order to await the async function.
The function, however is not-returnable.

StartPreloadAsyncInner(InstallProgressDelegate?, InstallProgressStateDelegate?, CancellationToken)

Starts performing game preloading operation.

protected abstract Task StartPreloadAsyncInner(InstallProgressDelegate? progressDelegate, InstallProgressStateDelegate? progressStateDelegate, CancellationToken token)

Parameters

progressDelegate InstallProgressDelegate

A callback which reports the progress of the current game update process.

progressStateDelegate InstallProgressStateDelegate

A callback which reports the state of the game update process.

token CancellationToken

A token for async operation cancellation.

Returns

Task

StartUpdateAsync(InstallProgressDelegate?, InstallProgressStateDelegate?, in Guid, out nint)

Perform update routine asynchronously. Returns immediately if no update is available.

public void StartUpdateAsync(InstallProgressDelegate? progressDelegate, InstallProgressStateDelegate? progressStateDelegate, in Guid cancelToken, out nint result)

Parameters

progressDelegate InstallProgressDelegate

A delegate to get the progress of the routine.

progressStateDelegate InstallProgressStateDelegate

A delegate to get the state of the progress of the routine.

cancelToken Guid

A cancel token for cancelling the async operation.

result nint

A pointer to the ComAsyncResult instance.

Remarks

This method returns a pointer to the ComAsyncResult instance via result.
The pointer must be passed to AsTask(nint) in order to await the async function.
The function, however is not-returnable.

StartUpdateAsyncInner(InstallProgressDelegate?, InstallProgressStateDelegate?, CancellationToken)

Starts performing game update operation.

protected abstract Task StartUpdateAsyncInner(InstallProgressDelegate? progressDelegate, InstallProgressStateDelegate? progressStateDelegate, CancellationToken token)

Parameters

progressDelegate InstallProgressDelegate

A callback which reports the progress of the current game update process.

progressStateDelegate InstallProgressStateDelegate

A callback which reports the state of the game update process.

token CancellationToken

A token for async operation cancellation.

Returns

Task

UninstallAsync(in Guid, out nint)

Perform uninstallation routine asynchronously.

public void UninstallAsync(in Guid cancelToken, out nint result)

Parameters

cancelToken Guid

Cancel token for the async operation.

result nint

A pointer to the ComAsyncResult instance.

Remarks

A pointer to the ComAsyncResult instance via result.
The pointer must be passed to AsTask(nint) in order to await the async function.
The function, however is not-returnable.

UninstallAsyncInner(CancellationToken)

Starts performing game uninstall operation.

protected abstract Task UninstallAsyncInner(CancellationToken token)

Parameters

token CancellationToken

A token for async operation cancellation.

Returns

Task