From 95ed7a5775e956e00062a3bd6e00a3c4edbf4d70 Mon Sep 17 00:00:00 2001 From: maol3 Date: Sat, 21 Jul 2018 10:56:49 +0200 Subject: [PATCH] #2474: Allow ALL in the Message channel --- .../bungee/connection/DownstreamBridge.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java index 842425bb..8f6f5c0f 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java @@ -391,10 +391,21 @@ public class DownstreamBridge extends PacketHandler } if ( subChannel.equals( "Message" ) ) { - ProxiedPlayer target = bungee.getPlayer( in.readUTF() ); - if ( target != null ) + String target = in.readUTF(); + String message = in.readUTF(); + if ( target.equals( "ALL" ) ) { - target.sendMessage( in.readUTF() ); + for ( ProxiedPlayer player : bungee.getPlayers() ) + { + player.sendMessage( message ); + } + } else + { + ProxiedPlayer player = bungee.getPlayer( target ); + if ( player != null ) + { + player.sendMessage( message ); + } } } if ( subChannel.equals( "GetServer" ) )