UNTESTED: fix for chatspy not working with CAPI chat integration

If it's still not working correctly, let me know
This commit is contained in:
Brettflan 2012-02-25 04:44:26 -06:00
parent c1f5475d0c
commit 503233b916
2 changed files with 11 additions and 3 deletions

View File

@ -77,6 +77,13 @@ public class PluginCapiListener implements Listener
if (event.getChannel().getId().equals("faction") && myFaction.isNormal())
{
event.getThem().addAll(myFaction.getOnlinePlayers());
// Send to any players who are spying chat... could probably be implemented better than this
for (FPlayer fplayer : FPlayers.i.getOnline())
{
if(fplayer.isSpyingChat() && fplayer.getFaction() != myFaction)
fplayer.sendMessage("[FCspy] "+myFaction.getTag()+": "+event.getMessage());
}
}
else if (event.getChannel().getId().equals("allies"))
{
@ -84,9 +91,10 @@ public class PluginCapiListener implements Listener
{
FPlayer someFPlayer = FPlayers.i.get(somePlayer);
if (someFPlayer.getRelationTo(fme).isAtLeast(Relation.ALLY))
{
event.getThem().add(somePlayer);
}
// Send to any players who are spying chat
else if(someFPlayer.isSpyingChat())
someFPlayer.sendMessage("[ACspy]: " + event.getMessage());
}
}
}