import { BaseControllerPlugin } from "@clusterio/controller"; import { ControllerEcho, HostEcho } from "./messages.js"; export class ControllerPlugin extends BaseControllerPlugin { async init() { this.logger.info("test_plugin controller loaded"); this.controller.handle(ControllerEcho, this.handleControllerEcho.bind(this)); } async handleControllerEcho(request) { this.logger.info(`test_plugin controller echo ${request.text}`); this.broadcastEventToHosts(new HostEcho(request.text)); return request.text; } }