mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-24 03:05:49 +01:00
Send forwaded data along the Bungee channel.
This commit is contained in:
parent
f53cbc2ab6
commit
f9c4251417
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user