2020-01-15 08:43:00 +00:00
|
|
|
import { server } from '@ms/api'
|
2020-02-26 02:15:33 +00:00
|
|
|
import { provideSingleton } from '@ms/container';
|
2020-01-15 08:43:00 +00:00
|
|
|
|
|
|
|
let Bungee: net.md_5.bungee.api.ProxyServer = base.getInstance().getProxy();
|
|
|
|
|
2020-02-26 02:15:33 +00:00
|
|
|
@provideSingleton(server.Server)
|
2020-01-15 08:43:00 +00:00
|
|
|
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
|
|
|
}
|
2020-02-29 14:28:43 +00:00
|
|
|
getPluginsFolder(): string {
|
|
|
|
return Bungee.getPluginsFolder().getCanonicalPath();
|
|
|
|
}
|
2020-01-15 08:43:00 +00:00
|
|
|
sendJson(sender: string | any, json: string): void {
|
|
|
|
throw new Error("Method not implemented.");
|
|
|
|
}
|
|
|
|
}
|