Send forwaded data along the Bungee channel.

This commit is contained in:
md_5 2013-01-28 09:19:06 +11:00
parent f53cbc2ab6
commit f9c4251417

View File

@ -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());
}
}
}