feat: 新增Native插件管理

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2020-12-07 11:12:49 +08:00
parent a3cbe455a1
commit ad85c3bc9b
18 changed files with 139 additions and 40 deletions

View File

@ -27,7 +27,8 @@ export class MiaoScriptConsole implements Console {
private _level: LogLevel = LogLevel.INFO
protected logger: any
protected prefix: string = '§6[§bMiaoScript§6]§r '
public prefix: string = '§6[§bMiaoScript§6]§r '
constructor(name?: string) {
this.name = name
@ -47,10 +48,10 @@ export class MiaoScriptConsole implements Console {
set name(name: string) {
if (name) {
this._name = `[${name}] `
// noinspection JSUnusedGlobalSymbols
this.prefix = `§6[§cMS§6][§b${name}§6]§r `
}
}
log(...args: any[]): void {
this.logger.info(this.name + args.join(' '))
}

View File

@ -12,4 +12,5 @@ export * from './console'
export * from './channel'
export * from './command'
export * from './database'
export * from './particle'
export * from './constants'

View File

@ -18,9 +18,15 @@ export namespace server {
export const ServerInstance = Symbol("ServerInstance")
@injectable()
export abstract class NativePluginManager {
list(): any[] {
throw new Error("Method not implemented.")
}
has(name: string): boolean {
return true
}
get(name: string): any {
throw new Error("Method not implemented.")
}
load(name: string): boolean {
throw new Error("Method not implemented.")
}

View File

@ -152,7 +152,7 @@ export namespace task {
* 提交任务
* @param args 任务参数
*/
submit(...args: any[]): Cancelable {
submit(...args: any[]): task.Task {
this.innerTask = this.submit0(...args)
return this
}