Table of Contents

Interface IPluginHost

Namespace
AcDream.Plugin.Abstractions
Assembly
AcDream.Plugin.Abstractions.dll

Everything a plugin can reach in the client, handed to it once at startup. A host that cannot provide a facility (a bot process with no window, for example) exposes the inert default for it rather than throwing, so the same plugin still loads there.

public interface IPluginHost

Properties

Automation

Reading and driving live gameplay: the character, spells, items, combat, movement and the rest.

IAutomationSurface Automation { get; }

Property Value

IAutomationSurface

Clipboard

The host's text clipboard; inert without a window.

IPluginClipboard Clipboard { get; }

Property Value

IPluginClipboard

Commands

Registers chat commands this plugin answers to. Inert on a host that has no command line.

IPluginCommandRegistry Commands { get; }

Property Value

IPluginCommandRegistry

Events

The client's notifications: tick, login, objects, and the rest.

IEvents Events { get; }

Property Value

IEvents

HasUi

Whether this host draws a user interface at all. False in a window-less process, where panels and hotkeys go nowhere.

bool HasUi { get; }

Property Value

bool

Hotkeys

Plugin-owned keyboard hotkeys; a no-op on a host with nothing to bind.

IHotkeyRegistry Hotkeys { get; }

Property Value

IHotkeyRegistry

IsHotReload

Whether this copy of the plugin was loaded by a reload while the client was already running, rather than when the client started. A reload starts a fresh copy: nothing the previous copy kept in memory survives it, so a plugin that wants to carry something across keeps it in Storage. When the character is already in the world, the host raises LoginComplete to the new copy right after Enable(), so a plugin that does its setup on login needs nothing extra. False by default.

bool IsHotReload { get; }

Property Value

bool

Log

Writes to the client's log, tagged with this plugin.

IPluginLogger Log { get; }

Property Value

IPluginLogger

LootClassifiers

Registers this plugin's own rules for deciding what loot is worth keeping. Inert on a host that does no loot classification.

IPluginLootClassifierRegistry LootClassifiers { get; }

Property Value

IPluginLootClassifierRegistry

MapResources

Asynchronous tiled map resources, or an inert catalog without map assets.

IPluginMapResourceCatalog MapResources { get; }

Property Value

IPluginMapResourceCatalog

Maps

Map controls, or an inert registry in a headless host.

IPluginMapRegistry Maps { get; }

Property Value

IPluginMapRegistry

PluginDirectory

The folder this plugin was installed in: the one holding its plugin.json, its assembly and whatever else its package ships. The host loads a plugin's assemblies from memory so the folder can be updated while the client runs, which leaves Location empty; read package files relative to this instead. A relative markup path given to IUiRegistry is already read from here. Null on a host that does not say.

string? PluginDirectory { get; }

Property Value

string

Rendering

Plugin-owned HUD and drawing services, or an inert registry without a renderer.

IPluginRenderRegistry Rendering { get; }

Property Value

IPluginRenderRegistry

Resources

Declared package resources and layered user data for this plugin.

IPluginResourceCatalog Resources { get; }

Property Value

IPluginResourceCatalog

Selection

What the player currently has selected.

ISelectionService Selection { get; }

Property Value

ISelectionService

SessionSettings

Settings this session was started with for this plugin, keyed by setting name -- for example the profile a bot session should apply on login. Empty when the session declared none.

IReadOnlyDictionary<string, string> SessionSettings { get; }

Property Value

IReadOnlyDictionary<string, string>

State

What the client currently has in the world.

IGameState State { get; }

Property Value

IGameState

StatusBoard

Named status lines the plugins in this client share: this plugin publishes under its own id and reads what any plugin published. The default implementation keeps nothing.

IPluginStatusBoard StatusBoard { get; }

Property Value

IPluginStatusBoard

Storage

Durable storage scoped by the host to this plugin's manifest id. The shipped hosts keep it in the files folder inside the plugin's own folder, which installs, updates and removing the plugin's code leave alone. No-window/test hosts may explicitly expose the inert implementation.

IPluginStorage Storage { get; }

Property Value

IPluginStorage

Ui

Registers this plugin's own windows and drives the client's.

IUiRegistry Ui { get; }

Property Value

IUiRegistry

VtankProfiles

A second storage area, shared by every plugin in the process, holding the automation profile files in the community layout so several plugins can read one set of profiles. Inert when the host configured no profile directory.

IPluginStorage VtankProfiles { get; }

Property Value

IPluginStorage

Window

The host's own OS window; inert without one.

IHostWindow Window { get; }

Property Value

IHostWindow

WorldLines

Lines a plugin draws in the world, such as a route. A host without a window hands out no layer, and the plugin draws nothing.

IPluginWorldLines WorldLines { get; }

Property Value

IPluginWorldLines