Table of Contents

Class GameManagerBase

Namespace
Hi3Helper.Plugin.Core.Management
Assembly
Hi3Helper.Plugin.Core.dll
[GeneratedComClass]
[ComExposedClass<ComClassInformation>]
public abstract class GameManagerBase : LauncherApiBase, ILauncherApi, IGameManager, IInitializableTask, IFree
Inheritance
GameManagerBase
Implements
Inherited Members

Properties

ApiGameVersion

Gets the current version of available game on the API.

protected virtual GameVersion ApiGameVersion { get; set; }

Property Value

GameVersion

Remarks

The property should expect to NEVER return Empty.

ApiPreloadGameVersion

Gets the upcoming version of available game on the API.

protected virtual GameVersion ApiPreloadGameVersion { get; set; }

Property Value

GameVersion

Remarks

The property should expect to return Empty if preload/upcoming game version isn't available on the API.

CurrentGameInstallPath

Gets the current game installation path.

protected virtual string? CurrentGameInstallPath { get; set; }

Property Value

string

CurrentGameVersion

Gets the current version of installed game.

protected virtual GameVersion CurrentGameVersion { get; set; }

Property Value

GameVersion

Remarks

The property should expect to return Empty if the game isn't installed or the version isn't set.

HasPreload

Gets whether the preload/upcoming game version is available on the API.

protected abstract bool HasPreload { get; }

Property Value

bool

Remarks

The property should expect to follow this logic formula in order to return the exact value:
IsInstalled == true AND
ApiPreloadGameVersion != Empty

HasUpdate

Gets whether the game update is available on the API.

protected abstract bool HasUpdate { get; }

Property Value

bool

Remarks

The property should expect to follow this logic formula in order to return the exact value:
IsInstalled == true AND
CurrentGameVersion != ApiGameVersion

IsInstalled

Gets whether the game is currently installed.

protected abstract bool IsInstalled { get; }

Property Value

bool

Remarks

The property should expect to follow this logic formula in order to return the exact value:
IsNullOrEmpty(string)(CurrentGameInstallPath) != true AND
CurrentGameVersion != Empty AND
Exists(string)(Game Executable Path) AND
So-on...

Methods

FindExistingInstallPathAsync(in Guid, out nint)

Finds the existing installation path of the game asynchronously.

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

Parameters

cancelToken Guid

A Guid value token for the cancelling asynchronous operation.

result nint

A safe pointer to the ComAsyncResult.

Remarks

This method returns a safe pointer to the ComAsyncResult via result.
The pointer needs to be passed to AsTask<T>(nint) and the generic type must be PluginDisposableMemoryMarshal of byte

FindExistingInstallPathAsyncInner(CancellationToken)

Find the existing installation path of the game asynchronously.

protected abstract Task<string?> FindExistingInstallPathAsyncInner(CancellationToken token)

Parameters

token CancellationToken

Cancel token for async operations.

Returns

Task<string>

Returns null if none was found. Otherwise, returns the path of the directory which contains the main game executable.

GetApiGameVersion(out GameVersion)

Gets the latest game version available from the API.

public void GetApiGameVersion(out GameVersion gameVersion)

Parameters

gameVersion GameVersion

An GameVersion representing the latest available game version.

GetApiPreloadGameVersion(out GameVersion)

Gets the preload version of the game available from the API, if any.

public void GetApiPreloadGameVersion(out GameVersion gameVersion)

Parameters

gameVersion GameVersion

An GameVersion representing the preload version, or Empty if not available.

GetCurrentGameVersion(out GameVersion)

Gets the current version of the installed game.

public void GetCurrentGameVersion(out GameVersion gameVersion)

Parameters

gameVersion GameVersion

An GameVersion representing the installed game version.

GetGamePath(out string?)

Gets the current path where the game is installed.

public void GetGamePath(out string? result)

Parameters

result string

The file system path to the game installation directory.

IsGameHasPreload(out bool)

Determines whether a preload version is available for the game.

public void IsGameHasPreload(out bool result)

Parameters

result bool

true if a preload version is available; otherwise, false.

IsGameHasUpdate(out bool)

Determines whether an update is available for the game.

public void IsGameHasUpdate(out bool result)

Parameters

result bool

true if an update is available; otherwise, false.

IsGameInstalled(out bool)

Determines whether the game is currently installed.

public void IsGameInstalled(out bool result)

Parameters

result bool

true if the game is installed; otherwise, false.

LoadConfig()

Perform config loading mechanism. Before calling this method, ensure that you have set the game path using SetGamePath(string).

public abstract void LoadConfig()

SaveConfig()

Perform config saving mechanism. Before calling this method, ensure that you have set the game path using SetGamePath(string).

public abstract void SaveConfig()

SetCurrentGameVersion(in GameVersion)

Sets the current version of the installed game.

public void SetCurrentGameVersion(in GameVersion gameVersion)

Parameters

gameVersion GameVersion

SetCurrentGameVersionInner(in GameVersion)

Sets the current version of the installed game.

protected abstract void SetCurrentGameVersionInner(in GameVersion gameVersion)

Parameters

gameVersion GameVersion

SetGamePath(string)

Set-only or Set-Save the path of the game installation.

public void SetGamePath(string gamePath)

Parameters

gamePath string

The new file system path to the game installation directory.

SetGamePathInner(string)

Set-only or Set-Save the path of the game installation.

protected abstract void SetGamePathInner(string gamePath)

Parameters

gamePath string

The new file system path to the game installation directory.