Class SharedStaticV1Ext<T>
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
contextDiscordPresenceExtension.DiscordPresenceContextThe context containing details about the Discord presence request.
presenceIdulongUnique identifier for the Discord presence, if available.
largeIconUrlstringURL of the large icon to display in the presence, or null if not set.
largeIconTooltipstringTooltip text for the large icon, or null if not set.
smallIconUrlstringURL of the small icon to display in the presence, or null if not set.
smallIconTooltipstringTooltip text for the small icon, or null if not set.
Returns
- bool
Returns
falseif 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,trueif 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
contextGameManagerExtension.RunGameFromGameManagerContextThe context to launch the game from IGameManager.
isGameRunningboolWhether the game is currently running or not.
gameStartTimeDateTimeThe date time stamp of when the process was started.
Returns
- bool
To find the actual return value, please use
isGameRunningout-argument.Returns
falseif 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,trueif 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
contextGameManagerExtension.RunGameFromGameManagerContextThe context to launch the game from IGameManager.
wasGameRunningboolWhether to indicate that the game was running or not.
gameStartTimeDateTimeThe date time stamp of when the process was started.
Returns
- bool
To find the actual return value, please use
wasGameRunningout-argument.Returns
falseif 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,trueif 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
contextGameManagerExtension.RunGameFromGameManagerContextThe context to launch the game from IGameManager.
startArgumentstringThe additional argument to run the game executable.
isRunBoostedboolBased on PriorityBoostEnabled, boost the process temporarily when the game window is focused (Default: false).
processPriorityProcessPriorityClassBased on PriorityClass, run the game process with specific priority (Default: Normal).
tokenCancellationTokenCancellation 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.falseif 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.trueif 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
interceptDllVersionToGameVersion
Type Parameters
TPluginA 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
contextGameManagerExtension.RunGameFromGameManagerContextThe context to launch the game from IGameManager.
executableNamestringThe name of the game executable.
heightint?Height of the host screen.
widthint?Width of the host screen.
executableDirectorystringThe path to the directory where the game executable is located.
tokenCancellationTokenCancellation 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.falseif the plugin's API Standard is equal or lower than v0.1.3 or if this method isn't overriden.
Otherwise,IsSupported.trueif 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
contextGameManagerExtension.RunGameFromGameManagerContextThe context to launch the game from IGameManager.
tokenCancellationTokenCancellation 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.falseif 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.trueif the plugin does support game launch mechanism and the game ran successfully.