|
@@ -19,6 +19,7 @@ import java.util.Collection;
|
|
|
import net.sf.l2j.Config;
|
|
|
import net.sf.l2j.gameserver.datatables.MapRegionTable;
|
|
|
import net.sf.l2j.gameserver.handler.IChatHandler;
|
|
|
+import net.sf.l2j.gameserver.model.BlockList;
|
|
|
import net.sf.l2j.gameserver.model.L2World;
|
|
|
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
|
|
|
import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
|
|
@@ -44,19 +45,26 @@ public class ChatShout implements IChatHandler
|
|
|
{
|
|
|
CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text);
|
|
|
|
|
|
+ Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().values();
|
|
|
+
|
|
|
if (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("on") || (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("gm") && activeChar.isGM()))
|
|
|
{
|
|
|
int region = MapRegionTable.getInstance().getMapRegion(activeChar.getX(), activeChar.getY());
|
|
|
- Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().values();
|
|
|
//synchronized (L2World.getInstance().getAllPlayers())
|
|
|
{
|
|
|
for (L2PcInstance player : pls)
|
|
|
- if (region == MapRegionTable.getInstance().getMapRegion(player.getX(), player.getY()))
|
|
|
+ if (region == MapRegionTable.getInstance().getMapRegion(player.getX(), player.getY()) && !BlockList.isBlocked(player, activeChar))
|
|
|
player.sendPacket(cs);
|
|
|
}
|
|
|
}
|
|
|
else if (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("global"))
|
|
|
- Broadcast.toAllOnlinePlayers(cs);
|
|
|
+ {
|
|
|
+ for (L2PcInstance player : pls)
|
|
|
+ {
|
|
|
+ if (!BlockList.isBlocked(player, activeChar))
|
|
|
+ player.sendPacket(cs);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|