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>
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>
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>