feat: add server interface

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
MiaoWoo 2019-11-04 20:18:30 +08:00
parent 8e94683757
commit 364463dc6a
3 changed files with 8 additions and 3 deletions

View File

@ -22,8 +22,8 @@
"test": "echo \"Error: run tests from root\" && exit 1" "test": "echo \"Error: run tests from root\" && exit 1"
}, },
"dependencies": { "dependencies": {
"@ms/common": "^0.1.0", "@ms/container": "^0.1.0",
"@ms/container": "^0.1.0" "@ms/ployfill": "^0.1.0"
}, },
"devDependencies": { "devDependencies": {
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.13",

View File

@ -1,6 +1,6 @@
let Arrays = Java.type('java.util.Arrays'); let Arrays = Java.type('java.util.Arrays');
let Level = Java.type('java.util.logging.Level'); 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 { export class MiaoScriptConsole implements Console {
Console: NodeJS.ConsoleConstructor; Console: NodeJS.ConsoleConstructor;

View File

@ -1,4 +1,9 @@
export namespace server { export namespace server {
export const ServerType = Symbol("ServerType"); export const ServerType = Symbol("ServerType");
export const Console = Symbol("Console"); export const Console = Symbol("Console");
export const Server = Symbol("Server");
export interface Server {
getVersion(): string;
getPlayer(name: string): any;
}
} }