use of cn.nukkit.command.RemoteConsoleCommandSender in project Nukkit by Nukkit.
the class RCON method check.
public void check() {
if (this.serverThread == null) {
return;
} else if (!this.serverThread.isAlive()) {
return;
}
RCONCommand command;
while ((command = serverThread.receive()) != null) {
RemoteConsoleCommandSender sender = new RemoteConsoleCommandSender();
RemoteServerCommandEvent event = new RemoteServerCommandEvent(sender, command.getCommand());
this.server.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
this.server.dispatchCommand(sender, command.getCommand());
}
this.serverThread.respond(command.getSender(), command.getId(), TextFormat.clean(sender.getMessages()));
}
}
use of cn.nukkit.command.RemoteConsoleCommandSender in project Nukkit by Nukkit.
the class TimingsExport method start.
@Override
public synchronized void start() {
if (this.sender instanceof RemoteConsoleCommandSender) {
this.sender.sendMessage(new TranslationContainer("nukkit.command.timings.rcon"));
run();
} else {
super.start();
}
}
Aggregations