From d3b214965b8e37b6106fcbabfae2c0c4b1d62888 Mon Sep 17 00:00:00 2001 From: Matsv Date: Sun, 2 Oct 2016 11:27:45 +0200 Subject: [PATCH] Add server info to the dump (#505) --- bungee/src/main/java/us/myles/ViaVersion/BungeePlugin.java | 2 +- .../ViaVersion/bungee/service/ProtocolDetectorService.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bungee/src/main/java/us/myles/ViaVersion/BungeePlugin.java b/bungee/src/main/java/us/myles/ViaVersion/BungeePlugin.java index f94352e14..d70bf3b49 100644 --- a/bungee/src/main/java/us/myles/ViaVersion/BungeePlugin.java +++ b/bungee/src/main/java/us/myles/ViaVersion/BungeePlugin.java @@ -160,7 +160,7 @@ public class BungeePlugin extends Plugin implements ViaPlatform, Listener { plugins.add(new PluginInfo(true, p.getDescription().getName(), p.getDescription().getVersion(), p.getDescription().getMain(), Arrays.asList(p.getDescription().getAuthor()))); platformSpecific.add("plugins", GsonUtil.getGson().toJsonTree(plugins)); - + platformSpecific.add("servers", GsonUtil.getGson().toJsonTree(ProtocolDetectorService.getProtocolIds())); return platformSpecific; } diff --git a/bungee/src/main/java/us/myles/ViaVersion/bungee/service/ProtocolDetectorService.java b/bungee/src/main/java/us/myles/ViaVersion/bungee/service/ProtocolDetectorService.java index 0f9e2d189..f0bc5fe55 100644 --- a/bungee/src/main/java/us/myles/ViaVersion/bungee/service/ProtocolDetectorService.java +++ b/bungee/src/main/java/us/myles/ViaVersion/bungee/service/ProtocolDetectorService.java @@ -6,6 +6,7 @@ import net.md_5.bungee.api.ServerPing; import net.md_5.bungee.api.config.ServerInfo; import us.myles.ViaVersion.BungeePlugin; +import java.util.HashMap; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -47,4 +48,8 @@ public class ProtocolDetectorService implements Runnable { }); } + public static Map getProtocolIds() { + return new HashMap<>(protocolIds); + } + }