add API to ignore alliance chat

This commit is contained in:
vemacs 2015-02-25 07:38:03 -07:00
parent d88332c06a
commit 4484eae5b8
3 changed files with 16 additions and 1 deletions

View File

@ -66,6 +66,10 @@ public interface FPlayer extends EconomyParticipator {
public ChatMode getChatMode();
public void setIgnoreAllianceChat(boolean ignore);
public boolean isIgnoreAllianceChat();
public void setSpyingChat(boolean chatSpying);
public boolean isSpyingChat();

View File

@ -58,7 +58,7 @@ public class FactionsChatListener implements Listener {
//Send to all our allies
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) {
if (myFaction.getRelationTo(fplayer) == Relation.ALLY) {
if (myFaction.getRelationTo(fplayer) == Relation.ALLY && !fplayer.isIgnoreAllianceChat()) {
fplayer.sendMessage(message);
}

View File

@ -64,6 +64,9 @@ public abstract class MemoryFPlayer implements FPlayer {
// FIELD: chatMode
protected ChatMode chatMode;
// FIELD: ignoreAllianceChat
protected boolean ignoreAllianceChat = false;
protected String id;
protected String name;
@ -199,6 +202,14 @@ public abstract class MemoryFPlayer implements FPlayer {
return chatMode;
}
public void setIgnoreAllianceChat(boolean ignore) {
this.ignoreAllianceChat = ignore;
}
public boolean isIgnoreAllianceChat() {
return ignoreAllianceChat;
}
public void setSpyingChat(boolean chatSpying) {
this.spyingChat = chatSpying;
}