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
gameManagerIGameManager
Fields
GameManager
The current instance of IGameManager.
protected readonly IGameManager GameManager
Field Value
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
gameInstallerKindGameInstallerKindKind of game state of the size to retrieve.
cancelTokenGuidCancel token for the async operation.
resultnintA 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
gameInstallerKindGameInstallerKindThe method of the game installation kind.
tokenCancellationTokenA token for async operation cancellation.
Returns
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
gameInstallerKindGameInstallerKindKind of game state of the size to retrieve.
cancelTokenGuidCancel token for the async operation.
resultnintA 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
gameInstallerKindGameInstallerKindThe method of the game installation kind.
tokenCancellationTokenA token for async operation cancellation.
Returns
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
progressDelegateInstallProgressDelegateA delegate to get the progress of the routine.
progressStateDelegateInstallProgressStateDelegateA delegate to get the state of the progress of the routine.
cancelTokenGuidA cancel token for cancelling the async operation.
resultnintA 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
progressDelegateInstallProgressDelegateA callback which reports the progress of the current game installation process.
progressStateDelegateInstallProgressStateDelegateA callback which reports the state of the game installation process.
tokenCancellationTokenA token for async operation cancellation.
Returns
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
progressDelegateInstallProgressDelegateA delegate to get the progress of the routine.
progressStateDelegateInstallProgressStateDelegateA delegate to get the state of the progress of the routine.
cancelTokenGuidA cancel token for cancelling the async operation.
resultnintA 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
progressDelegateInstallProgressDelegateA callback which reports the progress of the current game update process.
progressStateDelegateInstallProgressStateDelegateA callback which reports the state of the game update process.
tokenCancellationTokenA token for async operation cancellation.
Returns
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
progressDelegateInstallProgressDelegateA delegate to get the progress of the routine.
progressStateDelegateInstallProgressStateDelegateA delegate to get the state of the progress of the routine.
cancelTokenGuidA cancel token for cancelling the async operation.
resultnintA 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
progressDelegateInstallProgressDelegateA callback which reports the progress of the current game update process.
progressStateDelegateInstallProgressStateDelegateA callback which reports the state of the game update process.
tokenCancellationTokenA token for async operation cancellation.
Returns
UninstallAsync(in Guid, out nint)
Perform uninstallation routine asynchronously.
public void UninstallAsync(in Guid cancelToken, out nint result)
Parameters
cancelTokenGuidCancel token for the async operation.
resultnintA 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
tokenCancellationTokenA token for async operation cancellation.