2020-01-15 08:43:00 +00:00
|
|
|
import { server } from '@ms/api'
|
|
|
|
import { injectable } from '@ms/container';
|
|
|
|
|
|
|
|
let Bungee: net.md_5.bungee.api.ProxyServer = base.getInstance().getProxy();
|
|
|
|
|
|
|
|
@injectable()
|
|
|
|
export class BungeeServer implements server.Server {
|
|
|
|
getPlayer(name: string) {
|
|
|
|
return Bungee.getPlayer(name);
|
|
|
|
}
|
|
|
|
getVersion(): string {
|
|
|
|
return Bungee.getVersion()
|
|
|
|
}
|
|
|
|
getOnlinePlayers() {
|
|
|
|
return Bungee.getPlayers()
|
|
|
|
}
|
|
|
|
getConsoleSender() {
|
|
|
|
return Bungee.getConsole()
|
|
|
|
}
|
|
|
|
getService(service: string) {
|
|
|
|
throw new Error("Method not implemented.");
|
|
|
|
}
|
|
|
|
dispatchCommand(sender: string | any, command: string): boolean {
|
2020-01-16 09:19:10 +00:00
|
|
|
if (typeof sender === 'string') {
|
|
|
|
sender = this.getPlayer(sender)
|
|
|
|
}
|
|
|
|
return Bungee.getPluginManager().dispatchCommand(sender, command)
|
2020-01-15 08:43:00 +00:00
|
|
|
}
|
|
|
|
dispatchConsoleCommand(command: string): boolean {
|
2020-01-16 09:19:10 +00:00
|
|
|
return Bungee.getPluginManager().dispatchCommand(Bungee.getConsole(), command)
|
2020-01-15 08:43:00 +00:00
|
|
|
}
|
|
|
|
sendJson(sender: string | any, json: string): void {
|
|
|
|
throw new Error("Method not implemented.");
|
|
|
|
}
|
|
|
|
}
|