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:28 -06:00
parent 817a43b5e0
commit 02200e5793
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()) if (event.getChannel().getId().equals("faction") && myFaction.isNormal())
{ {
event.getThem().addAll(myFaction.getOnlinePlayers()); 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")) else if (event.getChannel().getId().equals("allies"))
{ {
@ -84,9 +91,10 @@ public class PluginCapiListener implements Listener
{ {
FPlayer someFPlayer = FPlayers.i.get(somePlayer); FPlayer someFPlayer = FPlayers.i.get(somePlayer);
if (someFPlayer.getRelationTo(fme).isAtLeast(Rel.ALLY)) if (someFPlayer.getRelationTo(fme).isAtLeast(Rel.ALLY))
{
event.getThem().add(somePlayer); event.getThem().add(somePlayer);
} // Send to any players who are spying chat
else if(someFPlayer.isSpyingChat())
someFPlayer.sendMessage("[ACspy]: " + event.getMessage());
} }
} }
} }