Update commands to add new platform specific command also add platform to updater.

This commit is contained in:
Myles 2016-09-29 22:35:51 +01:00
parent eb72db9a5f
commit 23f1589c28
6 changed files with 5 additions and 7 deletions

View File

@ -9,4 +9,4 @@ softdepend: [ProtocolSupport, PacketListenerApi]
commands:
viaversion:
description: Shows ViaVersion Version and more.
aliases: [viaver]
aliases: [viaver, vvbukkit]

View File

@ -7,7 +7,7 @@ public class BungeeCommand extends Command {
private final BungeeCommandHandler handler;
public BungeeCommand(BungeeCommandHandler handler) {
super("viaversion", "", "viaver"); // The CommandHandler will handle the permission
super("viaversion", "", "viaver", "vvbungee"); // The CommandHandler will handle the permission
this.handler = handler;
}

View File

@ -36,14 +36,13 @@ public class BungeeViaInjector implements ViaInjector {
@Override
public void uninject() {
// TODO: Uninject from players currently online
Via.getPlatform().getLogger().severe("ViaVersion cannot remove itself from Bungee without a reboot!");
}
@Override
public int getServerProtocolVersion() throws Exception {
return 47;
return 47; // TODO Config Option
}
@Override

View File

@ -9,7 +9,6 @@ public class BungeeViaLoader implements ViaPlatformLoader {
@Override
public void load() {
// TODO: Config
// TODO: Platform specific commands
Via.getManager().getProviders().use(MovementTransmitterProvider.class, new BungeeMovementTransmitter());
}
}

View File

@ -95,7 +95,7 @@ public class UpdateUtil {
URL url = new URL(URL + PLUGIN + LATEST_VERSION + "?" + System.currentTimeMillis());
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setUseCaches(true);
connection.addRequestProperty("User-Agent", "ViaVersion " + Via.getPlatform().getPluginVersion());
connection.addRequestProperty("User-Agent", "ViaVersion " + Via.getPlatform().getPluginVersion() + " " + Via.getPlatform().getPlatformName());
connection.setDoOutput(true);
BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String input;

View File

@ -68,7 +68,7 @@ public class SpongePlugin implements ViaPlatform {
syncExecutor = game.getScheduler().createSyncExecutor(this);
asyncExecutor = game.getScheduler().createAsyncExecutor(this);
SpongeCommandHandler commandHandler = new SpongeCommandHandler();
game.getCommandManager().register(this, commandHandler, Arrays.asList("viaversion", "viaver"));
game.getCommandManager().register(this, commandHandler, Arrays.asList("viaversion", "viaver", "vvsponge"));
getLogger().info("ViaVersion " + getPluginVersion() + " is now loaded, injecting!");
// Init platform
Via.init(ViaManager.builder()