Merge pull request #481 from bbassie/fix/upstream-plugin-changes

Restore seeding without controller.plugins
This commit is contained in:
Bastiaan authored and GitHub committed 2026-09-26 22:48:17 +01:00
1 parent 862fe49b60
commit 53e07aa761
4 files changed
+28 -16

No files matched your search

+9 -1
View File
@@ -1,12 +1,20 @@
import { BaseControllerPlugin, InstanceRecord } from "@clusterio/controller";
import { BaseControllerPlugin, InstanceRecord, type Controller } from "@clusterio/controller";
import * as lib from "@clusterio/lib";
import * as messages from "./messages.js";
import * as path from "node:path";
const loaded = new WeakMap<Controller, ControllerPlugin>();
export class ControllerPlugin extends BaseControllerPlugin {
roleMeta!: lib.SubscribableDatastore<messages.RoleMetaRecord>;
/** The plugin loaded on a controller, for the exp_scenario seed. */
static get(controller: Controller) {
return loaded.get(controller);
}
async init() {
loaded.set(this.controller, this);
const databaseDirectory = this.controller.config.get("controller.database_directory");
this.roleMeta = new lib.SubscribableDatastore(