4 Commits
Author SHA1 Message Date
BastiaanandClaude Opus 5.5 2cca280e30 Use controller.hosts.records for the host datastore (#520)
clusterio #1180 made controller.hosts a HostManager. The datastore with
set and the update event now lives on controller.hosts.records.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 14:29:58 +00:00
bbassieandClaude Opus 5.5 389004d652 Replace RequestError with the HTTP-style error classes
clusterio#999 removed RequestError. Handlers now throw NotFoundError,
ValidationError, ConflictError or UnavailableError, and exp_auto_restart
treats any ClientError from the host as a final refusal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 23:43:25 +00:00
BastiaanandClaude Opus 5.5 ea9bf1fb78 Construct plugins with a static fromContext (#487)
Each plugin class now has a private constructor and a static async
fromContext(context) that loads its datastores, constructs the instance
and attaches its handlers and hooks. This replaces the public constructor
followed by init(), and AutoRestart's start().

Datastores are loaded before construction and passed to the constructor,
so the definite assignment assertions on them are gone. Tests build the
plugins through fromContext and pass a wrapped logger in the context
instead of overwriting plugin.logger before init().

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 01:19:53 +01:00
bbassieandClaude Fable 5.1 5a6f3b46fe Add exp_auto_restart plugin
Restarts hosts, and optionally the controller, that report a pending
restart once no players have been online for a configurable time. Only
loaded on the controller: it counts players from the users online on
running instances, sends HostRestartRequest through the existing core
path, and starts the instances that were running once the host reports
back. Each host process is asked at most once, keyed on its process
start time, so a stale system info poll cannot trigger a second restart.

Uses the function-style entrypoint clusterio now documents, so it loads
without the deprecated class export warning.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 19:39:31 +00:00