mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-12-25 18:17:38 +01:00
Added 'ForwardToPlayer' subchannel
This commit is contained in:
parent
be35e283ec
commit
f9f9c3213d
@ -232,6 +232,29 @@ public class DownstreamBridge extends PacketHandler
|
|||||||
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
||||||
String subChannel = in.readUTF();
|
String subChannel = in.readUTF();
|
||||||
|
|
||||||
|
if ( subChannel.equals( "ForwardToPlayer" ) )
|
||||||
|
{
|
||||||
|
ProxiedPlayer target = bungee.getPlayer( in.readUTF() );
|
||||||
|
if ( target != null )
|
||||||
|
{
|
||||||
|
// Read data from server
|
||||||
|
String channel = in.readUTF();
|
||||||
|
short len = in.readShort();
|
||||||
|
byte[] data = new byte[ len ];
|
||||||
|
in.readFully( data );
|
||||||
|
|
||||||
|
// Prepare new data to send
|
||||||
|
out.writeUTF( channel );
|
||||||
|
out.writeShort( data.length );
|
||||||
|
out.write( data );
|
||||||
|
byte[] payload = out.toByteArray();
|
||||||
|
|
||||||
|
target.getServer().sendData( "BungeeCord", payload );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Null out stream, important as we don't want to send to ourselves
|
||||||
|
out = null;
|
||||||
|
}
|
||||||
if ( subChannel.equals( "Forward" ) )
|
if ( subChannel.equals( "Forward" ) )
|
||||||
{
|
{
|
||||||
// Read data from server
|
// Read data from server
|
||||||
|
Loading…
Reference in New Issue
Block a user