Table of Contents

Class SharedStaticV1Ext<T>

Namespace
Hi3Helper.Plugin.Core
Assembly
Hi3Helper.Plugin.Core.dll

Inherited SharedStatic with additional supports for API extensions which require call or property access to derived exports.

public class SharedStaticV1Ext<T> : SharedStaticV1Ext where T : SharedStaticV1Ext<T>, new()

Type Parameters

T
Inheritance
SharedStaticV1Ext<T>
Inherited Members

Methods

GetCurrentDiscordPresenceInfoCore(DiscordPresenceContext, out ulong, out string?, out string?, out string?, out string?)

Retrieves the current Discord Rich Presence information for the specified game region from its context.

protected virtual bool GetCurrentDiscordPresenceInfoCore(DiscordPresenceExtension.DiscordPresenceContext context, out ulong presenceId, out string? largeIconUrl, out string? largeIconTooltip, out string? smallIconUrl, out string? smallIconTooltip)

Parameters

context DiscordPresenceExtension.DiscordPresenceContext

The context containing details about the Discord presence request.

presenceId ulong

Unique identifier for the Discord presence, if available.

largeIconUrl string

URL of the large icon to display in the presence, or null if not set.

largeIconTooltip string

Tooltip text for the large icon, or null if not set.

smallIconUrl string

URL of the small icon to display in the presence, or null if not set.

smallIconTooltip string

Tooltip text for the small icon, or null if not set.

Returns

bool

Returns false if the plugin doesn't have game launch mechanism (or API Standard is equal or lower than v0.1.2) or if this method isn't overriden.
Otherwise, true if the plugin supports game launch mechanism.

IsGameRunningCore(RunGameFromGameManagerContext, out bool, out DateTime)

Check if the game from the current IGameManager is running or not.

protected virtual bool IsGameRunningCore(GameManagerExtension.RunGameFromGameManagerContext context, out bool isGameRunning, out DateTime gameStartTime)

Parameters

context GameManagerExtension.RunGameFromGameManagerContext

The context to launch the game from IGameManager.

isGameRunning bool

Whether the game is currently running or not.

gameStartTime DateTime

The date time stamp of when the process was started.

Returns

bool

To find the actual return value, please use isGameRunning out-argument.

Returns false if the plugin doesn't have game launch mechanism (or API Standard is equal or lower than v0.1.1) or if this method isn't overriden.
Otherwise, true if the plugin supports game launch mechanism.

KillRunningGameCore(RunGameFromGameManagerContext, out bool, out DateTime)

Kill the process of the currently running game.

protected virtual bool KillRunningGameCore(GameManagerExtension.RunGameFromGameManagerContext context, out bool wasGameRunning, out DateTime gameStartTime)

Parameters

context GameManagerExtension.RunGameFromGameManagerContext

The context to launch the game from IGameManager.

wasGameRunning bool

Whether to indicate that the game was running or not.

gameStartTime DateTime

The date time stamp of when the process was started.

Returns

bool

To find the actual return value, please use wasGameRunning out-argument.

Returns false if the plugin doesn't have game launch mechanism (or API Standard is equal or lower than v0.1.1) or if this method isn't overriden.
Otherwise, true if the plugin supports game launch mechanism.

LaunchGameFromGameManagerCoreAsync(RunGameFromGameManagerContext, string?, bool, ProcessPriorityClass, CancellationToken)

Asynchronously launch the game using plugin's built-in game launch mechanism and wait until the game exit.

protected virtual (bool IsSupported, Task<bool> Task) LaunchGameFromGameManagerCoreAsync(GameManagerExtension.RunGameFromGameManagerContext context, string? startArgument, bool isRunBoosted, ProcessPriorityClass processPriority, CancellationToken token)

Parameters

context GameManagerExtension.RunGameFromGameManagerContext

The context to launch the game from IGameManager.

startArgument string

The additional argument to run the game executable.

isRunBoosted bool

Based on PriorityBoostEnabled, boost the process temporarily when the game window is focused (Default: false).

processPriority ProcessPriorityClass

Based on PriorityClass, run the game process with specific priority (Default: Normal).

token CancellationToken

Cancellation token to pass into the plugin's game launch mechanism.
If cancellation is requested, it will cancel the awaiting but not killing the game process.

Returns

(bool IsSupported, Task<bool> Task)

Returns IsSupported.false if the plugin doesn't have game launch mechanism (or API Standard is equal or lower than v0.1.1) or if this method isn't overriden.
Otherwise, IsSupported.true if the plugin supports game launch mechanism.

Load<TPlugin>(GameVersion)

Specify which IPlugin instance to load and use in this plugin.

protected static void Load<TPlugin>(GameVersion interceptDllVersionTo = default) where TPlugin : class, IPlugin, new()

Parameters

interceptDllVersionTo GameVersion

Type Parameters

TPlugin

A member of COM Interface of IPlugin.

StartResizableWindowHookAsync(RunGameFromGameManagerContext, string?, int?, int?, string?, CancellationToken)

Asynchronously hook to the game process making the window resizable and wait until the game exit.

protected virtual (bool IsSupported, Task<bool> Task) StartResizableWindowHookAsync(GameManagerExtension.RunGameFromGameManagerContext context, string? executableName, int? height, int? width, string? executableDirectory, CancellationToken token)

Parameters

context GameManagerExtension.RunGameFromGameManagerContext

The context to launch the game from IGameManager.

executableName string

The name of the game executable.

height int?

Height of the host screen.

width int?

Width of the host screen.

executableDirectory string

The path to the directory where the game executable is located.

token CancellationToken

Cancellation token to pass into the plugin's game launch mechanism.
If cancellation is requested, it will cancel the awaiting but not killing the game process.

Returns

(bool IsSupported, Task<bool> Task)

Returns IsSupported.false if the plugin's API Standard is equal or lower than v0.1.3 or if this method isn't overriden.
Otherwise, IsSupported.true if the plugin supports game launch mechanism and this method.

WaitRunningGameCoreAsync(RunGameFromGameManagerContext, CancellationToken)

Asynchronously wait currently running game until it exit.

protected virtual (bool IsSupported, Task<bool> Task) WaitRunningGameCoreAsync(GameManagerExtension.RunGameFromGameManagerContext context, CancellationToken token)

Parameters

context GameManagerExtension.RunGameFromGameManagerContext

The context to launch the game from IGameManager.

token CancellationToken

Cancellation token to pass into the plugin's game launch mechanism.
If cancellation is requested, it will cancel the awaiting but not killing the game process.

Returns

(bool IsSupported, Task<bool> Task)

Returns IsSupported.false if the plugin doesn't have game launch mechanism (or API Standard is equal or lower than v0.1.1) or if this method isn't overriden.
Otherwise, IsSupported.true if the plugin does support game launch mechanism and the game ran successfully.