From 23f1589c286f8f7ab59efda1dca4d30ad71a160d Mon Sep 17 00:00:00 2001 From: Myles Date: Thu, 29 Sep 2016 22:35:51 +0100 Subject: [PATCH] Update commands to add new platform specific command also add platform to updater. --- bukkit/src/main/resources/plugin.yml | 2 +- .../us/myles/ViaVersion/bungee/commands/BungeeCommand.java | 2 +- .../us/myles/ViaVersion/bungee/platform/BungeeViaInjector.java | 3 +-- .../us/myles/ViaVersion/bungee/platform/BungeeViaLoader.java | 1 - .../src/main/java/us/myles/ViaVersion/update/UpdateUtil.java | 2 +- sponge/src/main/java/us/myles/ViaVersion/SpongePlugin.java | 2 +- 6 files changed, 5 insertions(+), 7 deletions(-) diff --git a/bukkit/src/main/resources/plugin.yml b/bukkit/src/main/resources/plugin.yml index 524051b93..d2cf3947c 100644 --- a/bukkit/src/main/resources/plugin.yml +++ b/bukkit/src/main/resources/plugin.yml @@ -9,4 +9,4 @@ softdepend: [ProtocolSupport, PacketListenerApi] commands: viaversion: description: Shows ViaVersion Version and more. - aliases: [viaver] \ No newline at end of file + aliases: [viaver, vvbukkit] \ No newline at end of file diff --git a/bungee/src/main/java/us/myles/ViaVersion/bungee/commands/BungeeCommand.java b/bungee/src/main/java/us/myles/ViaVersion/bungee/commands/BungeeCommand.java index b2a2b4137..b5114b9b4 100644 --- a/bungee/src/main/java/us/myles/ViaVersion/bungee/commands/BungeeCommand.java +++ b/bungee/src/main/java/us/myles/ViaVersion/bungee/commands/BungeeCommand.java @@ -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; } diff --git a/bungee/src/main/java/us/myles/ViaVersion/bungee/platform/BungeeViaInjector.java b/bungee/src/main/java/us/myles/ViaVersion/bungee/platform/BungeeViaInjector.java index 948247652..b3a0efe48 100644 --- a/bungee/src/main/java/us/myles/ViaVersion/bungee/platform/BungeeViaInjector.java +++ b/bungee/src/main/java/us/myles/ViaVersion/bungee/platform/BungeeViaInjector.java @@ -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 diff --git a/bungee/src/main/java/us/myles/ViaVersion/bungee/platform/BungeeViaLoader.java b/bungee/src/main/java/us/myles/ViaVersion/bungee/platform/BungeeViaLoader.java index 0cd351d36..436a99216 100644 --- a/bungee/src/main/java/us/myles/ViaVersion/bungee/platform/BungeeViaLoader.java +++ b/bungee/src/main/java/us/myles/ViaVersion/bungee/platform/BungeeViaLoader.java @@ -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()); } } diff --git a/common/src/main/java/us/myles/ViaVersion/update/UpdateUtil.java b/common/src/main/java/us/myles/ViaVersion/update/UpdateUtil.java index 32abb3d5a..cfcc67ff5 100644 --- a/common/src/main/java/us/myles/ViaVersion/update/UpdateUtil.java +++ b/common/src/main/java/us/myles/ViaVersion/update/UpdateUtil.java @@ -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; diff --git a/sponge/src/main/java/us/myles/ViaVersion/SpongePlugin.java b/sponge/src/main/java/us/myles/ViaVersion/SpongePlugin.java index d2725bf6e..33e9a4830 100644 --- a/sponge/src/main/java/us/myles/ViaVersion/SpongePlugin.java +++ b/sponge/src/main/java/us/myles/ViaVersion/SpongePlugin.java @@ -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()