Compare commits

...

3 Commits

Author SHA1 Message Date
72277f4d1a v0.9.5 2020-09-24 15:36:45 +08:00
d85f75ba1f fix: plugin bug
Signed-off-by: MiaoWoo <admin@yumc.pw>
2020-09-24 15:32:05 +08:00
ed14d317f4 fix: command tab complate error
Signed-off-by: MiaoWoo <admin@yumc.pw>
2020-09-24 15:27:34 +08:00
18 changed files with 38 additions and 38 deletions

View File

@@ -1,5 +1,5 @@
{
"version": "0.9.4",
"version": "0.9.5",
"useWorkspaces": true,
"npmClient": "yarn",
"packages": [

View File

@@ -1,6 +1,6 @@
{
"name": "@ccms/amqp",
"version": "0.9.4",
"version": "0.9.5",
"description": "MiaoScript amqp package",
"keywords": [
"miaoscript",
@@ -19,7 +19,7 @@
"test": "echo \"Error: run tests from root\" && exit 1"
},
"dependencies": {
"@ccms/api": "^0.9.4",
"@ccms/api": "^0.9.5",
"@ccms/common": "^0.9.4",
"@ccms/container": "^0.9.4"
},

View File

@@ -1,6 +1,6 @@
{
"name": "@ccms/api",
"version": "0.9.4",
"version": "0.9.5",
"description": "MiaoScript api package",
"keywords": [
"miaoscript",

View File

@@ -13,7 +13,7 @@ export namespace command {
*/
on(plugin: plugin.Plugin, name: string, exec: { cmd: Function, tab?: Function }) {
var cmd = this.create(plugin, name)
if (!cmd) { throw Error("") }
if (!cmd) { throw Error(`Plugin ${plugin.description.name} can't create Command ${name}!`) }
console.debug(i18n.translate("ms.api.command.register", { plugin: plugin.description.name, name, cmd }))
if (exec.cmd && typeof exec.cmd === "function") {
this.onCommand(plugin, cmd, exec.cmd)

View File

@@ -1,6 +1,6 @@
{
"name": "@ccms/bukkit",
"version": "0.9.4",
"version": "0.9.5",
"description": "MiaoScript bukkit package",
"keywords": [
"miaoscript",
@@ -25,7 +25,7 @@
"typescript": "^4.0.3"
},
"dependencies": {
"@ccms/api": "^0.9.4",
"@ccms/api": "^0.9.5",
"@ccms/common": "^0.9.4",
"@ccms/container": "^0.9.4"
}

View File

@@ -1,6 +1,6 @@
{
"name": "@ccms/bungee",
"version": "0.9.4",
"version": "0.9.5",
"description": "MiaoScript bungee package",
"keywords": [
"miaoscript",
@@ -25,7 +25,7 @@
"typescript": "^4.0.3"
},
"dependencies": {
"@ccms/api": "^0.9.4",
"@ccms/api": "^0.9.5",
"@ccms/common": "^0.9.4",
"@ccms/container": "^0.9.4"
}

View File

@@ -1,6 +1,6 @@
{
"name": "@ccms/core",
"version": "0.9.4",
"version": "0.9.5",
"description": "MiaoScript api package",
"keywords": [
"miaoscript",
@@ -24,7 +24,7 @@
"typescript": "^4.0.3"
},
"dependencies": {
"@ccms/api": "^0.9.4",
"@ccms/api": "^0.9.5",
"@ccms/container": "^0.9.4"
},
"gitHead": "781524f83e52cad26d7c480513e3c525df867121"

View File

@@ -1,6 +1,6 @@
{
"name": "@ccms/database",
"version": "0.9.4",
"version": "0.9.5",
"description": "MiaoScript database package",
"keywords": [
"miaoscript",
@@ -25,7 +25,7 @@
"typescript": "^4.0.3"
},
"dependencies": {
"@ccms/api": "^0.9.4",
"@ccms/api": "^0.9.5",
"@ccms/container": "^0.9.4"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@ccms/keyvalue",
"version": "0.9.4",
"version": "0.9.5",
"description": "MiaoScript keyvalue package",
"keywords": [
"miaoscript",
@@ -19,7 +19,7 @@
"test": "echo \"Error: run tests from root\" && exit 1"
},
"dependencies": {
"@ccms/api": "^0.9.4",
"@ccms/api": "^0.9.5",
"@ccms/common": "^0.9.4",
"@ccms/container": "^0.9.4"
},

View File

@@ -1,6 +1,6 @@
{
"name": "@ccms/nukkit",
"version": "0.9.4",
"version": "0.9.5",
"description": "MiaoScript nukkit package",
"keywords": [
"miaoscript",
@@ -25,7 +25,7 @@
"typescript": "^4.0.3"
},
"dependencies": {
"@ccms/api": "^0.9.4",
"@ccms/api": "^0.9.5",
"@ccms/common": "^0.9.4",
"@ccms/container": "^0.9.4"
}

View File

@@ -1,6 +1,6 @@
{
"name": "@ccms/plugin",
"version": "0.9.4",
"version": "0.9.5",
"description": "MiaoScript api package",
"keywords": [
"miaoscript",
@@ -25,7 +25,7 @@
"typescript": "^4.0.3"
},
"dependencies": {
"@ccms/api": "^0.9.4",
"@ccms/api": "^0.9.5",
"@ccms/common": "^0.9.4",
"@ccms/container": "^0.9.4",
"@ccms/i18n": "^0.9.4",

View File

@@ -18,17 +18,17 @@ export class PluginCommandManager {
let cmds = getPluginCommandMetadata(pluginInstance)
let tabs = getPluginTabCompleterMetadata(pluginInstance)
for (const cmd of cmds) {
let tab = tabs.get(cmd.name)
if (!this.ServerChecker.check(cmd.servers)) {
console.debug(`[${pluginInstance.description.name}] ${cmd.target.constructor.name} incompatible command ${cmd.name} server(${cmd.servers}) ignore.`)
continue
}
let exec = {
cmd: pluginInstance[cmd.executor].bind(pluginInstance),
tab: tab ? pluginInstance[tab.executor].bind(pluginInstance) : undefined
}
for (let command of [cmd.name, ...cmd.alias]) {
this.CommandManager.on(pluginInstance, command, exec)
this.CommandManager.on(pluginInstance, command, {
cmd: pluginInstance[cmd.executor].bind(pluginInstance),
tab: tabs.has(command) ?
pluginInstance[tabs.get(command).executor].bind(pluginInstance) :
console.debug(`[${pluginInstance.description.name}] command ${cmd.name} is not registry tabCompleter`)
})
}
}
}

View File

@@ -1,7 +1,7 @@
{
"private": true,
"name": "@ccms/plugins",
"version": "0.9.4",
"version": "0.9.5",
"description": "MiaoScript plugins package",
"keywords": [
"miaoscript",
@@ -28,8 +28,8 @@
"typescript": "^4.0.3"
},
"dependencies": {
"@ccms/api": "^0.9.4",
"@ccms/api": "^0.9.5",
"@ccms/container": "^0.9.4",
"@ccms/plugin": "^0.9.4"
"@ccms/plugin": "^0.9.5"
}
}

View File

@@ -197,7 +197,7 @@ export class MiaoReward extends interfaces.Plugin {
}
disable() {
this.server.getOnlinePlayers().forEach(p => this.checkAndClear(p))
Java.from(this.server.getOnlinePlayers()).forEach(p => this.checkAndClear(p))
this.channelOff?.off()
}

View File

@@ -430,7 +430,7 @@ return ''+ eval(${JSON.stringify(code)});`)
version: plugin.description.version,
source: base.read((plugin.description.source || plugin.description.loadMetadata.file).toString())
})
this.i18n(sender, result.code == 200 ? 'deploy.success' : 'deploy.fail', { name, msg: result.msg })
this.i18n(sender, result.code == 200 ? 'deploy.success' : 'deploy.fail', { name, version: plugin.description.version, msg: result.msg })
}
}).async().submit()
}
@@ -445,7 +445,7 @@ return ''+ eval(${JSON.stringify(code)});`)
}
@Tab({ alias: ['gmspm', 'bungeemspm'] })
tabmspm(args: string | any[]) {
tabmspm(_sender: any, _command: any, args: string | any[]) {
if (args.length === 1) { return ['list', 'install', 'update', 'upgrade', 'reload', 'restart', 'run', 'help', 'create', 'deploy'] }
if (args.length > 1) {
switch (args[0]) {

View File

@@ -1,6 +1,6 @@
{
"name": "@ccms/sponge",
"version": "0.9.4",
"version": "0.9.5",
"description": "MiaoScript api package",
"keywords": [
"miaoscript",
@@ -25,7 +25,7 @@
"typescript": "^4.0.3"
},
"dependencies": {
"@ccms/api": "^0.9.4",
"@ccms/api": "^0.9.5",
"@ccms/common": "^0.9.4",
"@ccms/container": "^0.9.4"
}

View File

@@ -1,6 +1,6 @@
{
"name": "@ccms/spring",
"version": "0.9.4",
"version": "0.9.5",
"description": "MiaoScript spring package",
"keywords": [
"miaoscript",
@@ -24,9 +24,9 @@
"typescript": "^4.0.3"
},
"dependencies": {
"@ccms/api": "^0.9.4",
"@ccms/api": "^0.9.5",
"@ccms/common": "^0.9.4",
"@ccms/container": "^0.9.4",
"@ccms/database": "^0.9.4"
"@ccms/database": "^0.9.5"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@ccms/web",
"version": "0.9.4",
"version": "0.9.5",
"description": "MiaoScript web package",
"keywords": [
"miaoscript",
@@ -29,7 +29,7 @@
"typescript": "^4.0.3"
},
"dependencies": {
"@ccms/api": "^0.9.4",
"@ccms/api": "^0.9.5",
"@ccms/container": "^0.9.4"
}
}