mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-09-21 17:04:00 +00:00
exp_scenario reached into @expcluster/roles/dist/node/* for the message classes and the controller plugin type. The package index now re-exports messages and the ControllerPlugin type, so consumers import from the package name like they do with @clusterio/lib. The controller export is type only, which keeps node code out of the web bundle. The test still requires the controller classes from dist since they cannot be re-exported at runtime. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
54 lines
1.3 KiB
TypeScript
54 lines
1.3 KiB
TypeScript
import * as lib from "@clusterio/lib";
|
|
import * as messages from "./messages";
|
|
|
|
export * from "./messages";
|
|
export type { ControllerPlugin } from "./controller";
|
|
|
|
declare module "@clusterio/lib" {
|
|
export interface InstanceConfigFields {
|
|
"exp_roles.sync_mode": "disabled" | "enabled" | "bidirectional";
|
|
}
|
|
}
|
|
|
|
// The in game properties of a role are part of the role, so they are covered by
|
|
// the core role permissions rather than permissions of their own. Assignments
|
|
// are only ever sent between the controller and an instance, so they need none.
|
|
|
|
export const plugin: lib.PluginDeclaration = {
|
|
name: "exp_roles",
|
|
title: "ExpGaming - Roles",
|
|
description: "Clusterio plugin providing syncing of in game roles",
|
|
|
|
features: [
|
|
"SavePatching",
|
|
"ScriptCommands",
|
|
],
|
|
|
|
messages: [
|
|
messages.RoleUpdatedEvent,
|
|
messages.AssignmentUpdatedEvent,
|
|
|
|
messages.RoleListRequest,
|
|
messages.RoleMetaUpdateRequest,
|
|
|
|
messages.AssignmentListRequest,
|
|
messages.AssignmentUpdateRequest,
|
|
],
|
|
|
|
instanceEntrypoint: "./dist/node/instance",
|
|
instanceConfigFields: {
|
|
"exp_roles.sync_mode": {
|
|
description: "Synchronize in game roles with the controller",
|
|
type: "string",
|
|
enum: ["disabled", "enabled", "bidirectional"],
|
|
initialValue: "bidirectional",
|
|
},
|
|
},
|
|
|
|
controllerEntrypoint: "./dist/node/controller",
|
|
controllerConfigFields: {
|
|
},
|
|
|
|
webEntrypoint: "./web",
|
|
};
|