From 0985794eab9dfce286a1fa74e49055443b022901 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 27 Jan 2013 10:05:22 +1100 Subject: [PATCH] Add GetServers channel. --- .../java/net/md_5/bungee/UserConnection.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java index 6c035ff4..36bf8c28 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -463,6 +463,22 @@ public class UserConnection extends GenericConnection implements ProxiedPlayer getServer().sendData("BungeeCord", b.toByteArray()); } } + if (subChannel.equals("GetServers")) + { + ByteArrayOutputStream b = new ByteArrayOutputStream(); + DataOutputStream out = new DataOutputStream(b); + out.writeUTF("GetServers"); + + StringBuilder sb = new StringBuilder(); + for (String server : ProxyServer.getInstance().getServers().keySet()) + { + sb.append(server); + sb.append(","); + } + out.writeUTF(sb.substring(0, sb.length() - 1)); + + getServer().sendData("BungeeCord", b.toByteArray()); + } continue; } }