OpenMod Docs OpenMod Docs
OpenMod Docs OpenMod Docs
OpenMod .NET Plugin Framework.

Interface IRuntime

The OpenMod runtime is responsible for initializing OpenMod.

Inherited Members
IOpenModComponent.OpenModComponentId
IOpenModComponent.WorkingDirectory
IOpenModComponent.IsComponentAlive
IOpenModComponent.LifetimeScope
IOpenModComponent.DataStore
Namespace: OpenMod.API
Assembly: OpenMod.API.dll
Syntax
public interface IRuntime : IOpenModComponent

Properties

| Improve this Doc View Source

CommandlineArgs

Gets the commandline arguments.

Declaration
string[] CommandlineArgs { get; }
Property Value
Type Description
System.String[]
| Improve this Doc View Source

Host

Gets the .NET generic host instance. Returns null if the host is not loaded yet.

Declaration
IHost? Host { get; }
Property Value
Type Description
System.Nullable<IHost>
| Improve this Doc View Source

HostAssemblies

Gets the OpenMod host assemblies.

Declaration
IReadOnlyCollection<Assembly> HostAssemblies { get; }
Property Value
Type Description
IReadOnlyCollection<Assembly>
| Improve this Doc View Source

HostInformation

Information about the OpenMod host. Returns null if the host is not loaded yet.

Declaration
IHostInformation HostInformation { get; }
Property Value
Type Description
IHostInformation
| Improve this Doc View Source

IsDisposing

Checks if the runtime is shutting down or disposing.

Declaration
bool IsDisposing { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Status

Gets the runtime status.

Declaration
RuntimeStatus Status { get; }
Property Value
Type Description
RuntimeStatus
| Improve this Doc View Source

Version

Gets the OpenMod runtime version.

Declaration
SemVersion Version { get; }
Property Value
Type Description
SemVersion

Methods

| Improve this Doc View Source

InitAsync(List<Assembly>, RuntimeInitParameters, Func<IHostBuilder>)

Initializes the runtime.

Declaration
Task<IHost> InitAsync(List<Assembly> openModHostAssemblies, RuntimeInitParameters parameters, Func<IHostBuilder> hostBuilder)
Parameters
Type Name Description
List<Assembly> openModHostAssemblies
RuntimeInitParameters parameters
Func<IHostBuilder> hostBuilder
Returns
Type Description
Task<IHost>

The .NET Generic Host interface.

| Improve this Doc View Source

PerformSoftReloadAsync()

Rebuilds the DI container and reloads all plugins, services, configurations etc.

Declaration
Task PerformSoftReloadAsync()
Returns
Type Description
Task
| Improve this Doc View Source

ShutdownAsync()

Shuts OpenMod down gracefully and disposes all services.

Declaration
Task ShutdownAsync()
Returns
Type Description
Task

Extension Methods

DisposeHelper.DisposeSyncOrAsync(Object)