From f9c4251417ba7433c15f2621b9109b43c004ac8f Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 28 Jan 2013 09:19:06 +1100 Subject: [PATCH] Send forwaded data along the Bungee channel. --- .../src/main/java/net/md_5/bungee/UserConnection.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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 36bf8c28..ae323cd4 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -395,19 +395,26 @@ public class UserConnection extends GenericConnection implements ProxiedPlayer byte[] data = new byte[len]; in.readFully(data); + + ByteArrayOutputStream b = new ByteArrayOutputStream(); + DataOutputStream out = new DataOutputStream(b); + out.writeUTF(channel); + out.writeShort(data.length); + out.write(data); + if (target.equals("ALL")) { for (String s : BungeeCord.getInstance().getServers().keySet()) { Server server = BungeeCord.getInstance().getServer(s); - server.sendData(channel, data); + server.sendData("BungeeCord", b.toByteArray()); } } else { Server server = BungeeCord.getInstance().getServer(target); if (server != null) { - server.sendData(channel, data); + server.sendData("BungeeCord", b.toByteArray()); } } }