Added chat spy feature for admins

This commit is contained in:
Harry Jeffery
2011-11-27 19:32:41 +00:00
committed by Harry Jeffery
parent 3d929138a5
commit 5bf3161cf0
6 changed files with 65 additions and 3 deletions

View File

@ -0,0 +1,40 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.P;
import com.massivecraft.factions.struct.Permission;
public class CmdChatSpy extends FCommand
{
public CmdChatSpy()
{
super();
this.aliases.add("chatspy");
this.optionalArgs.put("on/off", "flip");
this.permission = Permission.CHATSPY.node;
this.disableOnLock = false;
senderMustBePlayer = true;
senderMustBeMember = false;
senderMustBeOfficer = false;
senderMustBeLeader = false;
}
@Override
public void perform()
{
fme.setSpyingChat(this.argAsBool(0, ! fme.isSpyingChat()));
if ( fme.isSpyingChat())
{
fme.msg("<i>You have enabled chat spying mode.");
P.p.log(fme.getName() + " has ENABLED chat spying mode.");
}
else
{
fme.msg("<i>You have disabled chat spying mode.");
P.p.log(fme.getName() + " DISABLED chat spying mode.");
}
}
}

View File

@ -10,6 +10,7 @@ public class FCmdRoot extends FCommand
public CmdAutoClaim cmdAutoClaim = new CmdAutoClaim();
public CmdAdmin cmdBypass = new CmdAdmin();
public CmdChat cmdChat = new CmdChat();
public CmdChatSpy cmdChatSpy = new CmdChatSpy();
public CmdClaim cmdClaim = new CmdClaim();
public CmdConfig cmdConfig = new CmdConfig();
public CmdCreate cmdCreate = new CmdCreate();
@ -72,6 +73,7 @@ public class FCmdRoot extends FCommand
this.addSubCommand(this.cmdAutoClaim);
this.addSubCommand(this.cmdBypass);
this.addSubCommand(this.cmdChat);
this.addSubCommand(this.cmdChatSpy);
this.addSubCommand(this.cmdClaim);
this.addSubCommand(this.cmdConfig);
this.addSubCommand(this.cmdCreate);