#2875: Add the MessageRaw channel
This commit is contained in:
parent
1d40b8a88a
commit
a64c34d29e
@ -27,6 +27,7 @@ import net.md_5.bungee.ServerConnection.KeepAliveData;
|
|||||||
import net.md_5.bungee.UserConnection;
|
import net.md_5.bungee.UserConnection;
|
||||||
import net.md_5.bungee.Util;
|
import net.md_5.bungee.Util;
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
|
import net.md_5.bungee.api.chat.BaseComponent;
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
import net.md_5.bungee.api.chat.TextComponent;
|
||||||
import net.md_5.bungee.api.config.ServerInfo;
|
import net.md_5.bungee.api.config.ServerInfo;
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
@ -435,6 +436,25 @@ public class DownstreamBridge extends PacketHandler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ( subChannel.equals( "MessageRaw" ) )
|
||||||
|
{
|
||||||
|
String target = in.readUTF();
|
||||||
|
BaseComponent[] message = ComponentSerializer.parse( in.readUTF() );
|
||||||
|
if ( target.equals( "ALL" ) )
|
||||||
|
{
|
||||||
|
for ( ProxiedPlayer player : bungee.getPlayers() )
|
||||||
|
{
|
||||||
|
player.sendMessage( message );
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
ProxiedPlayer player = bungee.getPlayer( target );
|
||||||
|
if ( player != null )
|
||||||
|
{
|
||||||
|
player.sendMessage( message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if ( subChannel.equals( "GetServer" ) )
|
if ( subChannel.equals( "GetServer" ) )
|
||||||
{
|
{
|
||||||
out.writeUTF( "GetServer" );
|
out.writeUTF( "GetServer" );
|
||||||
|
Loading…
Reference in New Issue
Block a user