diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 10acc024..a8650c81 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -4,7 +4,6 @@ import { plugin, server, task, constants } from '@ccms/api' import { DefaultContainer as container, inject, provideSingleton, ContainerInstance, buildProviderModule } from '@ccms/container' console.i18n("ms.core.ioc.completed", { scope: global.scope, time: (Date.now() - containerStartTime) / 1000 }) import http from '@ccms/common/dist/http' -import { EventEmitter } from 'events' @provideSingleton(MiaoScriptCore) class MiaoScriptCore { diff --git a/packages/i18n/languages/zh_cn.yml b/packages/i18n/languages/zh_cn.yml index 9fe1b3a0..34338a8a 100644 --- a/packages/i18n/languages/zh_cn.yml +++ b/packages/i18n/languages/zh_cn.yml @@ -21,8 +21,8 @@ ms.api.event.not.found: "§6插件 §b{name} §6注册事件 §c{event} §6失 ms.api.event.execute.slow: "§c注意! §6插件 §b{name} §6处理 §d{event} §6事件 §c耗时 §4{cost}ms !" ms.api.event.execute.error: "§6插件 §b{name} §6处理 §d{event} §6事件时发生异常 §4{ex}" ms.api.event.listen.plugin.name.empty: "插件名称为空 请检查传入参数!" -ms.api.event.register: "[{name}] 注册事件 {event}" -ms.api.event.unregister: "[{name}] 注销事件 {event}" +ms.api.event.register: "[{name}] 注册事件 {event} => {exec}" +ms.api.event.unregister: "[{name}] 注销事件 {event} => {exec}" ms.api.command.register.input.error: "CommandExec 必须为一个函数... 输入: {exec}" ms.api.command.register: "[{plugin}] 注册命令 {name}({cmd})..." ms.api.command.unregister: "[{plugin}] 注销命令 {name}..." diff --git a/packages/plugin/src/event.ts b/packages/plugin/src/event.ts index c9625a9a..cb884a67 100644 --- a/packages/plugin/src/event.ts +++ b/packages/plugin/src/event.ts @@ -20,7 +20,7 @@ export class PluginEventManager { // ignore space listener if (!this.ServerChecker.check(event.servers)) { continue } // here must bind this to pluginInstance - this.EventManager.listen(pluginInstance, event.name, pluginInstance[event.executor].bind(pluginInstance)) + this.EventManager.listen(pluginInstance, event.name, pluginInstance[event.executor].bind(pluginInstance), event.priority, event.ignoreCancel) } }