/f showinvites for ability to see pending invites for current faction. Adds feature in ticket #76

This commit is contained in:
drtshock 2014-10-14 13:30:05 -05:00
parent bfc904332a
commit a170a0f4ad
4 changed files with 42 additions and 12 deletions

View File

@ -0,0 +1,27 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.struct.Permission;
public class CmdShowInvites extends FCommand {
public CmdShowInvites() {
super();
aliases.add("showinvites");
permission = Permission.SHOW_INVITES.node;
senderMustBePlayer = true;
senderMustBeMember = true;
}
@Override
public void perform() {
StringBuilder sb = new StringBuilder();
for (String id : myFaction.getInvites()) {
FPlayer fp = FPlayers.i.get(id);
sb.append(fp != null ? fp.getName() : id).append(" ");
}
msg("<a>Players with pending invites: <i> %s", sb.toString().trim());
}
}

View File

@ -52,6 +52,7 @@ public class FCmdRoot extends FCommand {
public CmdVersion cmdVersion = new CmdVersion();
public CmdWarunclaimall cmdWarunclaimall = new CmdWarunclaimall();
public CmdSB cmdSB = new CmdSB();
public CmdShowInvites cmdShowInvites = new CmdShowInvites();
public FCmdRoot() {
super();
@ -120,6 +121,7 @@ public class FCmdRoot extends FCommand {
this.addSubCommand(this.cmdVersion);
this.addSubCommand(this.cmdWarunclaimall);
this.addSubCommand(this.cmdSB);
this.addSubCommand(this.cmdShowInvites);
}
@Override

View File

@ -50,6 +50,7 @@ public enum Permission {
SET_PEACEFUL("setpeaceful"),
SET_PERMANENT("setpermanent"),
SET_PERMANENTPOWER("setpermanentpower"),
SHOW_INVITES("showinvites"),
POWERBOOST("powerboost"),
POWER("power"),
POWER_ANY("power.any"),