From e8baaa2460a460e70b265e748d799e686acb844c Mon Sep 17 00:00:00 2001 From: Brettflan Date: Sun, 15 Jan 2012 01:41:03 -0600 Subject: [PATCH] Minor tweaks to chatspy, added it to /f help --- src/com/massivecraft/factions/cmd/CmdHelp.java | 1 + .../factions/listeners/FactionsChatEarlyListener.java | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/com/massivecraft/factions/cmd/CmdHelp.java b/src/com/massivecraft/factions/cmd/CmdHelp.java index c0b12a6a..c5ddd038 100644 --- a/src/com/massivecraft/factions/cmd/CmdHelp.java +++ b/src/com/massivecraft/factions/cmd/CmdHelp.java @@ -165,6 +165,7 @@ public class CmdHelp extends FCommand pageLines = new ArrayList(); pageLines.add(p.txt.parse("More commands for server admins:")); + pageLines.add( p.cmdBase.cmdChatSpy.getUseageTemplate(true) ); pageLines.add(p.txt.parse("Peaceful factions are protected from PvP and land capture.")); pageLines.add( p.cmdBase.cmdLock.getUseageTemplate(true) ); pageLines.add( p.cmdBase.cmdReload.getUseageTemplate(true) ); diff --git a/src/com/massivecraft/factions/listeners/FactionsChatEarlyListener.java b/src/com/massivecraft/factions/listeners/FactionsChatEarlyListener.java index 83637fab..dbef7ac2 100644 --- a/src/com/massivecraft/factions/listeners/FactionsChatEarlyListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsChatEarlyListener.java @@ -55,8 +55,8 @@ public class FactionsChatEarlyListener extends PlayerListener //Send to any players who are spying chat for (FPlayer fplayer : FPlayers.i.getOnline()) { - if( fplayer.isSpyingChat() ) - fplayer.sendMessage("FactionChat "+me.getFaction().getTag()+": "+message); + if(fplayer.isSpyingChat() && fplayer.getFaction() != myFaction) + fplayer.sendMessage("[FCspy] "+me.getFaction().getTag()+": "+message); } event.setCancelled(true); @@ -79,11 +79,11 @@ public class FactionsChatEarlyListener extends PlayerListener fplayer.sendMessage(message); //Send to any players who are spying chat - if( fplayer.isSpyingChat() ) - fplayer.sendMessage("AllianceChat " + message); + else if(fplayer.isSpyingChat()) + fplayer.sendMessage("[ACspy]: " + message); } - P.p.log(Level.INFO, ChatColor.stripColor("AllianceChat "+message)); + P.p.log(Level.INFO, ChatColor.stripColor("AllianceChat: "+message)); event.setCancelled(true); return;