From 364463dc6a39fff00274d3c5a4a53e92b92748cd Mon Sep 17 00:00:00 2001 From: MiaoWoo Date: Mon, 4 Nov 2019 20:18:30 +0800 Subject: [PATCH] feat: add server interface Signed-off-by: MiaoWoo --- packages/api/package.json | 4 ++-- packages/api/src/console.ts | 2 +- packages/api/src/interfaces/server.ts | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/api/package.json b/packages/api/package.json index fbb960c4..c95f5a0a 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -22,8 +22,8 @@ "test": "echo \"Error: run tests from root\" && exit 1" }, "dependencies": { - "@ms/common": "^0.1.0", - "@ms/container": "^0.1.0" + "@ms/container": "^0.1.0", + "@ms/ployfill": "^0.1.0" }, "devDependencies": { "reflect-metadata": "^0.1.13", diff --git a/packages/api/src/console.ts b/packages/api/src/console.ts index a43b2a16..15143718 100644 --- a/packages/api/src/console.ts +++ b/packages/api/src/console.ts @@ -1,6 +1,6 @@ let Arrays = Java.type('java.util.Arrays'); let Level = Java.type('java.util.logging.Level'); -let ignoreLogPrefix = ['java.', 'net.minecraft.', 'org.bukkit.', 'jdk.nashorn.']; +let ignoreLogPrefix = ['java.', 'net.minecraft.', 'org.bukkit.', 'jdk.nashorn.', 'io.netty.']; export class MiaoScriptConsole implements Console { Console: NodeJS.ConsoleConstructor; diff --git a/packages/api/src/interfaces/server.ts b/packages/api/src/interfaces/server.ts index 83b4b299..e1d32e1a 100644 --- a/packages/api/src/interfaces/server.ts +++ b/packages/api/src/interfaces/server.ts @@ -1,4 +1,9 @@ export namespace server { export const ServerType = Symbol("ServerType"); export const Console = Symbol("Console"); + export const Server = Symbol("Server"); + export interface Server { + getVersion(): string; + getPlayer(name: string): any; + } }