A bit of cleaning up and explaining, moved javadocs to AnticheatAPI.java

This commit is contained in:
Adam committed 2012-05-21 18:47:31 -04:00
1 parent 51557c20a6
commit a50a57353a
5 files changed
+114 -65

No files matched your search

@@ -35,80 +35,40 @@ public class CheckManager
private static List<CheckType> checkIgnoreList = new ArrayList<CheckType>();
private static Multimap<Player,CheckType> exemptList = ArrayListMultimap.create();
/**
* Initialize the class.
*
* @param instance The AntiCheat Manager
*/
public CheckManager(AnticheatManager instance)
{
manager = instance;
}
/**
* Start running a certain check
*
* @param type Check to start watching for
*/
public void activateCheck(CheckType type)
{
manager.log("The "+type.toString()+" check was activated.");
checkIgnoreList.remove(type);
}
/**
* Stop running a certain check
*
* @param type Check to stop watching for
*/
public void deactivateCheck(CheckType type)
{
manager.log("The "+type.toString()+" check was deactivated.");
checkIgnoreList.add(type);
}
/**
* Find out if a check is currently being watched for
*
* @param type Type to check
* @return true if plugin is watching for this check
*/
public boolean isActive(CheckType type)
{
return !checkIgnoreList.contains(type);
}
/**
* Allow a player to skip a certain check
*
* @param player Player to stop watching
* @param type Check to stop watching for
*/
public void exemptPlayer(Player player, CheckType type)
{
manager.log(player.getName()+" was exempted from the "+type.toString()+" check.");
exemptList.put(player,type);
}
/**
* Stop allowing a player to skip a certain check
*
* @param player Player to start watching
* @param type Check to start watching for
*/
public void unexemptPlayer(Player player, CheckType type)
{
manager.log(player.getName()+" was re-added to the "+type.toString()+" check.");
exemptList.remove(type, type);
}
/**
* Find out if a player is currently exempt from a certain check
*
* @param player Player to check
* @param type Type to check
* @return true if plugin is ignoring this check on this player
*/
public boolean isExempt(Player player, CheckType type)
{
return exemptList.containsEntry(player, type);
@@ -118,14 +78,7 @@ public class CheckManager
{
return player.hasPermission(permission);
}
/**
* Find out if a check will occur for a player. This checks if they are being tracked, the check is active, the player isn't exempt from the check, and the player doesn't have override permission.
*
* @param player Player to check
* @param type Type to check
* @return true if plugin will check this player, and that all things allow it to happen.
*/
public boolean willCheck(Player player, CheckType type)
{
return isActive(type)