Added new Permissions support, and defined permissions in plugin.yml

Added Tips-and-Tricks on startup
This commit is contained in:
Evenprime 2011-07-18 17:18:26 +02:00
parent c438eee164
commit cd99a78718
9 changed files with 634 additions and 440 deletions

View File

@ -3,7 +3,7 @@ name: NoCheat
author: Evenprime author: Evenprime
main: cc.co.evenprime.bukkit.nocheat.NoCheat main: cc.co.evenprime.bukkit.nocheat.NoCheat
version: 1.10a version: 1.11
softdepend: [ Permissions, CraftIRC ] softdepend: [ Permissions, CraftIRC ]
@ -15,3 +15,46 @@ commands:
Example: /<command> | Displays version, enabled checks and bugfixes Example: /<command> | Displays version, enabled checks and bugfixes
Example: /<command> -p | Get your permissions, * = check disabled globally Example: /<command> -p | Get your permissions, * = check disabled globally
Example: /<command> -p [player] | Get permissions of the player, * = check disabled globally Example: /<command> -p [player] | Get permissions of the player, * = check disabled globally
permissions:
nocheat.all:
description: Allow the player to do everything (except for getting log messages)
children:
nocheat.moving: true
nocheat.speedhack: true
nocheat.airbuild: true
nocheat.bogusitems: true
nocheat.nuke: true
nocheat.flying: true
nocheat.fakesneak: true
nocheat.fastswim: true
nocheat.moving:
description: Allow to player to move/fly without getting checked at all
default: op
nocheat.speedhack:
description: Don't observe the number of move events sent by the player
default: op
nocheat.airbuild:
description: Allow placing blocks against air/in midair
default: op
nocheat.bogusitems:
description: Allow the use of items with invalid values e.g. negative stacksize
default: op
nocheat.nuke:
description: Allow breaking of blocks that are not in the field of view of the player
default: op
nocheat.notify:
description: Receive log messages in chat
default: op
nocheat.flying:
description: Allow the player to fly at normal walking speed
default: op
nocheat.fakesneak:
description: Allow the player to sneak at normal walking speed
default: op
nocheat.fastswim:
description: Allow the player to swim at normal walking speed
default: op

View File

@ -0,0 +1,106 @@
package cc.co.evenprime.bukkit.nocheat;
import java.util.Set;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.Permission;
import org.bukkit.permissions.PermissionAttachment;
import org.bukkit.permissions.PermissionAttachmentInfo;
import org.bukkit.plugin.Plugin;
public class CustomCommandSender implements CommandSender {
private final Server server;
public CustomCommandSender(Server server) {
this.server = server;
}
@Override
public boolean isPermissionSet(String name) {
// Just pretend that we have a permission, no matter which one
return true;
}
@Override
public boolean isPermissionSet(Permission perm) {
// Just pretend that we have a permission, no matter which one
return true;
}
@Override
public boolean hasPermission(String name) {
// Just pretend that we have a permission, no matter which one
return true;
}
@Override
public boolean hasPermission(Permission perm) {
// Just pretend that we have a permission, no matter which one
return true;
}
@Override
public PermissionAttachment addAttachment(Plugin plugin, String name,
boolean value) {
// Whatever it is, I don't care
return null;
}
@Override
public PermissionAttachment addAttachment(Plugin plugin) {
// Whatever it is, I don't care
return null;
}
@Override
public PermissionAttachment addAttachment(Plugin plugin, String name,
boolean value, int ticks) {
// Whatever it is, I don't care
return null;
}
@Override
public PermissionAttachment addAttachment(Plugin plugin, int ticks) {
// Whatever it is, I don't care
return null;
}
@Override
public void removeAttachment(PermissionAttachment attachment) {
// Whatever it is, I don't care
}
@Override
public void recalculatePermissions() {
// Nothing to calculate
}
@Override
public Set<PermissionAttachmentInfo> getEffectivePermissions() {
// Nothing
return null;
}
@Override
public void setOp(boolean value) {
// Nothing
}
@Override
public void sendMessage(String message) {
// we don't receive messages
}
@Override
public boolean isOp() {
// We declare ourselves to be OP to be allowed to do more commands
return true;
}
@Override
public Server getServer() {
return server;
}
}

View File

@ -32,9 +32,13 @@ public class DataManager {
Iterator<Map.Entry<Player, NoCheatData>> it = playerData.entrySet().iterator(); Iterator<Map.Entry<Player, NoCheatData>> it = playerData.entrySet().iterator();
while (it.hasNext()) { while (it.hasNext()) {
Map.Entry<Player, NoCheatData> pairs = (Map.Entry<Player, NoCheatData>)it.next(); Map.Entry<Player, NoCheatData> pairs = (Map.Entry<Player, NoCheatData>)it.next();
if(!pairs.getKey().isOnline()) if(!pairs.getKey().isOnline()) {
// Cancel all referenced tasks before removing the entry
cancelTasks(pairs.getValue());
it.remove(); it.remove();
} }
}
} }
} }
@ -127,9 +131,14 @@ public class DataManager {
synchronized(playerData) { synchronized(playerData) {
Iterator<Map.Entry<Player, NoCheatData>> it = playerData.entrySet().iterator(); Iterator<Map.Entry<Player, NoCheatData>> it = playerData.entrySet().iterator();
while (it.hasNext()) { while (it.hasNext()) {
Map.Entry<Player, NoCheatData> pairs = (Map.Entry<Player, NoCheatData>)it.next(); cancelTasks(it.next().getValue());
}
}
}
AirbuildData d = pairs.getValue().airbuild; private void cancelTasks(NoCheatData data) {
AirbuildData d = data.airbuild;
if(d != null) { if(d != null) {
int id = d.summaryTask; int id = d.summaryTask;
@ -143,7 +152,7 @@ public class DataManager {
} }
} }
MovingData d2 = pairs.getValue().moving; MovingData d2 = data.moving;
if(d2 != null) { if(d2 != null) {
int id = d2.summaryTask; int id = d2.summaryTask;
@ -158,6 +167,3 @@ public class DataManager {
} }
} }
} }
}
}

View File

@ -1,6 +1,5 @@
package cc.co.evenprime.bukkit.nocheat; package cc.co.evenprime.bukkit.nocheat;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.File; import java.io.File;
import java.io.FileReader; import java.io.FileReader;
@ -35,11 +34,12 @@ import org.bukkit.plugin.Plugin;
* *
* NoCheat * NoCheat
* *
* Check various player events for their plausibility and log/deny them based on configuration * Check various player events for their plausibility and log/deny them based on
* configuration
* *
* @author Evenprime * @author Evenprime
*/ */
public class NoCheat extends JavaPlugin implements CommandSender { public class NoCheat extends JavaPlugin {
private MovingCheck movingCheck; private MovingCheck movingCheck;
private SpeedhackCheck speedhackCheck; private SpeedhackCheck speedhackCheck;
@ -50,6 +50,8 @@ public class NoCheat extends JavaPlugin implements CommandSender {
private NoCheatConfiguration config; private NoCheatConfiguration config;
private boolean useNewPermissionSystem = false;
private long exceptionWithPermissions = 0; private long exceptionWithPermissions = 0;
private int cleanUpTaskId = -1; private int cleanUpTaskId = -1;
@ -72,40 +74,43 @@ public class NoCheat extends JavaPlugin implements CommandSender {
private String ircTag; private String ircTag;
private NukeCheck nukeCheck; private NukeCheck nukeCheck;
private DataManager dataManager; private DataManager dataManager;
private CustomCommandSender sender;
private boolean showStartupMessages = true;
public NoCheat() { public NoCheat() {
} }
public String[] getMessagesOfTheDay() {
return new String[] {"NoCheat now supports the new Bukkit-Permission system. You can activate it in the config file.", "There will be a change in the near future to how movement in CraftBukkit works, which will break NoCheats moving-check(s) completely, causing tons of false positives. Be careful if you tend to run bleeding edge builds of CraftBukkit.", "This version of NoCheat was written for CraftBukkit RB 1000, but may still work for some older or newer versions.", "You can find detailed information about all configuration options of NoCheat in the file \"descriptions.txt\" in your \"plugins/NoCheat\" folder", "You can deactivate these Messages in the config file, if they annoy you."};
}
@Override @Override
public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) {
{
if(args.length == 0) { if(args.length == 0) {
sender.sendMessage("NC: Using " + ((permissions == null) ? "isOp()" : "Permissions") + ". Activated checks/bugfixes: " + getActiveChecksAsString() + ". Total time used for moving check so far: " + (movingCheck.statisticElapsedTimeNano / 1000000L + " ms. Average time per move event: " + (movingCheck.statisticElapsedTimeNano / 1000L) / movingCheck.statisticTotalEvents + " us")); sender.sendMessage("NC: Using " + ((permissions == null) ? "isOp()" : "Permissions") + ". Activated checks/bugfixes: " + getActiveChecksAsString() + ". Total time used for moving check so far: " + (movingCheck.statisticElapsedTimeNano / 1000000L + " ms. Average time per move event: " + (movingCheck.statisticElapsedTimeNano / 1000L) / movingCheck.statisticTotalEvents + " us"));
return true; return true;
} } else if(args.length == 1 && args[0] != null && args[0].trim().equals("-p")) {
else if(args.length == 1 && args[0] != null && args[0].trim().equals("-p")) {
if(sender instanceof Player) { if(sender instanceof Player) {
Player p = (Player) sender; Player p = (Player) sender;
sender.sendMessage("NC: You have permissions: " + getPermissionsForPlayerAsString(p)); sender.sendMessage("NC: You have permissions: " + getPermissionsForPlayerAsString(p));
return true; return true;
} } else {
else {
sender.sendMessage("NC: You have to be a player to use this command"); sender.sendMessage("NC: You have to be a player to use this command");
return true; return true;
} }
} } else if(args.length == 2 && args[0] != null && args[0].trim().equals("-p")) {
else if(args.length == 2 && args[0] != null && args[0].trim().equals("-p")) {
Player p = getServer().getPlayer(args[1]); Player p = getServer().getPlayer(args[1]);
if(p != null) { if(p != null) {
sender.sendMessage("NC: " + p.getName() + " has permissions: " + getPermissionsForPlayerAsString(p)); sender.sendMessage("NC: " + p.getName() + " has permissions: " + getPermissionsForPlayerAsString(p));
return true; return true;
} } else {
else {
sender.sendMessage("NC: Player " + args[1] + " was not found."); sender.sendMessage("NC: Player " + args[1] + " was not found.");
return true; return true;
} }
@ -114,8 +119,6 @@ public class NoCheat extends JavaPlugin implements CommandSender {
return false; return false;
} }
public void onDisable() { public void onDisable() {
PluginDescriptionFile pdfFile = this.getDescription(); PluginDescriptionFile pdfFile = this.getDescription();
@ -124,18 +127,20 @@ public class NoCheat extends JavaPlugin implements CommandSender {
config.cleanup(); config.cleanup();
try { try {
dataManager.cancelPlayerDataTasks();
teardownCleanupTask(); teardownCleanupTask();
teardownServerLagMeasureTask(); teardownServerLagMeasureTask();
} catch(Exception e) { /* Can't do much in case of error here... */
dataManager.cancelPlayerDataTasks();
} }
catch(Exception e) { /* Can't do much in case of error here... */ }
Logger.getLogger("Minecraft").info("[NoCheat] version [" + pdfFile.getVersion() + "] is disabled."); Logger.getLogger("Minecraft").info("[NoCheat] version [" + pdfFile.getVersion() + "] is disabled.");
} }
public void onEnable() { public void onEnable() {
dataManager = new DataManager(); dataManager = new DataManager();
sender = new CustomCommandSender(getServer());
// parse the nocheat.yml config file // parse the nocheat.yml config file
setupConfig(); setupConfig();
@ -152,10 +157,17 @@ public class NoCheat extends JavaPlugin implements CommandSender {
Logger.getLogger("Minecraft").warning("[NoCheat] you have set \"allow-flight=false\" in your server.properties file. That builtin anti-flying-mechanism will likely conflict with this plugin. Please consider deactivating it by setting it to \"true\""); Logger.getLogger("Minecraft").warning("[NoCheat] you have set \"allow-flight=false\" in your server.properties file. That builtin anti-flying-mechanism will likely conflict with this plugin. Please consider deactivating it by setting it to \"true\"");
} }
for(String s : getMessagesOfTheDay()) {
if(showStartupMessages)
Logger.getLogger("Minecraft").info("(NoCheat) Did you know? " + s);
}
PluginDescriptionFile pdfFile = this.getDescription(); PluginDescriptionFile pdfFile = this.getDescription();
// Get, if available, the Permissions and irc plugin // Get, if available, the Permissions and irc plugin
if(!useNewPermissionSystem) {
setupPermissions(); setupPermissions();
}
setupIRC(); setupIRC();
Logger.getLogger("Minecraft").info("[NoCheat] version [" + pdfFile.getVersion() + "] is enabled with the following checks: " + getActiveChecksAsString()); Logger.getLogger("Minecraft").info("[NoCheat] version [" + pdfFile.getVersion() + "] is enabled with the following checks: " + getActiveChecksAsString());
@ -166,52 +178,67 @@ public class NoCheat extends JavaPlugin implements CommandSender {
} }
public DataManager getDataManager() { public DataManager getDataManager() {
return dataManager; return dataManager;
} }
private void setupCleanupTask() { private void setupCleanupTask() {
if(cleanUpTaskId != -1) return; if(cleanUpTaskId != -1) {
return;
}
try { try {
cleanUpTaskId = Bukkit.getServer().getScheduler().scheduleAsyncRepeatingTask(this, new Runnable() { cleanUpTaskId = Bukkit.getServer().getScheduler().scheduleAsyncRepeatingTask(this, new Runnable() {
@Override @Override
public void run() { public void run() {
dataManager.cleanPlayerDataCollection();
try {
if(getDataManager() != null) {
getDataManager().cleanPlayerDataCollection();
}
} catch(Exception e) {}
} }
}, 5000, 5000); }, 5000, 5000);
} } catch(Exception e) {
catch(Exception e) { // It's not THAT important, so if it fails for whatever reason, just
// It's not THAT important, so if it fails for whatever reason, just let it be. // let it be.
} }
} }
private void teardownCleanupTask() { private void teardownCleanupTask() {
if(cleanUpTaskId != -1)
if(cleanUpTaskId != -1) {
Bukkit.getServer().getScheduler().cancelTask(cleanUpTaskId); Bukkit.getServer().getScheduler().cancelTask(cleanUpTaskId);
} }
}
private void setupServerLagMeasureTask() { private void setupServerLagMeasureTask() {
if(serverLagMeasureTaskSetup != -1) return; if(serverLagMeasureTaskSetup != -1) {
return;
}
serverLagMeasureTaskSetup = Bukkit.getServer().getScheduler().scheduleAsyncRepeatingTask(this, new Runnable() { serverLagMeasureTaskSetup = Bukkit.getServer().getScheduler().scheduleAsyncRepeatingTask(this, new Runnable() {
@Override @Override
public void run() { public void run() {
serverTicks += 10; serverTicks += 10;
long time = System.currentTimeMillis(); long time = System.currentTimeMillis();
serverLagInMilliSeconds = Math.abs((time - lastServerTime - 500) * 2); serverLagInMilliSeconds = Math.abs((time - lastServerTime - 500) * 2);
lastServerTime = time; lastServerTime = time;
} }
}, 10, 10); }, 10, 10);
} }
private void teardownServerLagMeasureTask() { private void teardownServerLagMeasureTask() {
if(serverLagMeasureTaskSetup != -1)
if(serverLagMeasureTaskSetup != -1) {
Bukkit.getServer().getScheduler().cancelTask(serverLagMeasureTaskSetup); Bukkit.getServer().getScheduler().cancelTask(serverLagMeasureTaskSetup);
} }
}
/** /**
* Get, if available, a reference to the Permissions-plugin * Get, if available, a reference to the Permissions-plugin
@ -234,6 +261,7 @@ public class NoCheat extends JavaPlugin implements CommandSender {
* Get, if available, a reference to the Permissions-plugin * Get, if available, a reference to the Permissions-plugin
*/ */
private void setupIRC() { private void setupIRC() {
CraftIRC p = null; CraftIRC p = null;
Plugin test = this.getServer().getPluginManager().getPlugin("CraftIRC"); Plugin test = this.getServer().getPluginManager().getPlugin("CraftIRC");
@ -252,9 +280,11 @@ public class NoCheat extends JavaPlugin implements CommandSender {
/** /**
* Log a violation message to all locations declared in the config file * Log a violation message to all locations declared in the config file
*
* @param message * @param message
*/ */
public void log(Level l, String message) { public void log(Level l, String message) {
if(l != null && message != null) { if(l != null && message != null) {
message = "NC: " + message; message = "NC: " + message;
config.logger.log(l, message); config.logger.log(l, message);
@ -266,6 +296,7 @@ public class NoCheat extends JavaPlugin implements CommandSender {
} }
private void logToChat(Level l, String message) { private void logToChat(Level l, String message) {
if(chatLevel.intValue() <= l.intValue()) { if(chatLevel.intValue() <= l.intValue()) {
for(Player player : getServer().getOnlinePlayers()) { for(Player player : getServer().getOnlinePlayers()) {
if(hasPermission(player, PermissionData.PERMISSION_NOTIFY, false)) { if(hasPermission(player, PermissionData.PERMISSION_NOTIFY, false)) {
@ -276,33 +307,38 @@ public class NoCheat extends JavaPlugin implements CommandSender {
} }
private void logToIRC(Level l, String message) { private void logToIRC(Level l, String message) {
if(irc != null && ircLevel.intValue() <= l.intValue()) { if(irc != null && ircLevel.intValue() <= l.intValue()) {
irc.sendMessageToTag("[" + l.getName() + "] " + message, ircTag); irc.sendMessageToTag("[" + l.getName() + "] " + message, ircTag);
} }
} }
private void logToConsole(Level l, String message) { private void logToConsole(Level l, String message) {
if(consoleLevel.intValue() <= l.intValue()) { if(consoleLevel.intValue() <= l.intValue()) {
Logger.getLogger("Minecraft").log(l, message); Logger.getLogger("Minecraft").log(l, message);
} }
} }
public boolean hasPermission(Player player, int permission, boolean ignoreOPstatus) {
public boolean hasPermission(Player player, int permission, boolean checkOPs) { if(player == null)
return false;
if(player == null) return false; if(useNewPermissionSystem) {
//System.out.println("New permissions system asked for " + PermissionData.permissionNames[permission] + " got " + player.hasPermission(PermissionData.permissionNames[permission]));
return player.hasPermission(PermissionData.permissionNames[permission]);
}
try { try {
if(permissions == null) { if(permissions == null) {
if(checkOPs) { if(ignoreOPstatus) {
// OPs don't get special treatment // OPs don't get special treatment
return false; return false;
} } else {
else {
return player.isOp(); return player.isOp();
} }
} } else {
else {
PermissionData data = dataManager.getPermissionData(player); PermissionData data = dataManager.getPermissionData(player);
long time = System.currentTimeMillis(); long time = System.currentTimeMillis();
if(data.lastUpdate[permission] + 10000 < time) { if(data.lastUpdate[permission] + 10000 < time) {
@ -311,8 +347,7 @@ public class NoCheat extends JavaPlugin implements CommandSender {
} }
return data.cache[permission]; return data.cache[permission];
} }
} } catch(Throwable e) {
catch(Throwable e) {
if(this.exceptionWithPermissions + 60000 < System.currentTimeMillis()) { if(this.exceptionWithPermissions + 60000 < System.currentTimeMillis()) {
// Prevent spam and recursion by definitely doing this only once // Prevent spam and recursion by definitely doing this only once
this.exceptionWithPermissions = System.currentTimeMillis(); this.exceptionWithPermissions = System.currentTimeMillis();
@ -331,6 +366,7 @@ public class NoCheat extends JavaPlugin implements CommandSender {
* Read the config file * Read the config file
*/ */
private void setupConfig() { private void setupConfig() {
if(this.config == null) if(this.config == null)
this.config = new NoCheatConfiguration(new File(NoCheatConfiguration.configFile), new File(NoCheatConfiguration.descriptionsFile)); this.config = new NoCheatConfiguration(new File(NoCheatConfiguration.configFile), new File(NoCheatConfiguration.descriptionsFile));
else else
@ -343,7 +379,10 @@ public class NoCheat extends JavaPlugin implements CommandSender {
this.ircLevel = config.getLogLevelValue("logging.logtoirc"); this.ircLevel = config.getLogLevelValue("logging.logtoirc");
this.consoleLevel = config.getLogLevelValue("logging.logtoconsole"); this.consoleLevel = config.getLogLevelValue("logging.logtoconsole");
this.ircTag = config.getStringValue("logging.logtoirctag"); this.ircTag = config.getStringValue("logging.logtoirctag");
this.useNewPermissionSystem = this.config.getBooleanValue("newpermsystem");
this.showStartupMessages = this.config.getBooleanValue("showinfomessages");
} catch(ConfigurationException e) { } catch(ConfigurationException e) {
e.printStackTrace();
this.setEnabled(false); this.setEnabled(false);
} }
@ -363,8 +402,8 @@ public class NoCheat extends JavaPlugin implements CommandSender {
e.printStackTrace(); e.printStackTrace();
// ignore errors // ignore errors
} }
}
}
private String getActiveChecksAsString() { private String getActiveChecksAsString() {
@ -381,7 +420,6 @@ public class NoCheat extends JavaPlugin implements CommandSender {
return s; return s;
} }
private String getPermissionsForPlayerAsString(Player p) { private String getPermissionsForPlayerAsString(Player p) {
String s = ""; String s = "";
@ -400,10 +438,12 @@ public class NoCheat extends JavaPlugin implements CommandSender {
} }
public int getServerTicks() { public int getServerTicks() {
return serverTicks; return serverTicks;
} }
public long getServerLag() { public long getServerLag() {
return this.serverLagInMilliSeconds; return this.serverLagInMilliSeconds;
} }
@ -419,33 +459,18 @@ public class NoCheat extends JavaPlugin implements CommandSender {
if(com != null) { if(com != null) {
if(commandParts.length > 1) { // Command + parameters if(commandParts.length > 1) { // Command + parameters
String[] commandArgs = commandParts[1].split(" "); String[] commandArgs = commandParts[1].split(" ");
com.execute(this, commandName, commandArgs); com.execute(sender, commandName, commandArgs);
} } else {
else {
String[] commandArgs = new String[0]; String[] commandArgs = new String[0];
com.execute(this, commandName, commandArgs); com.execute(sender, commandName, commandArgs);
} }
} } else {
else
{
// The standard server should do it // The standard server should do it
Bukkit.getServer().dispatchCommand(this, command); Bukkit.getServer().dispatchCommand(sender, command);
} }
} } catch(Exception e) {
catch(Exception e) {
this.log(Level.WARNING, "NoCheat couldn't execute custom server command: \"" + command + "\""); this.log(Level.WARNING, "NoCheat couldn't execute custom server command: \"" + command + "\"");
} }
} }
@Override
public void sendMessage(String message) {
// we don't receive messages
}
@Override
public boolean isOp() {
// We declare ourselves to be OP to be allowed to do more commands
return true;
}
} }

View File

@ -53,9 +53,11 @@ public class AirbuildCheck extends Check {
@Override @Override
public void run() { public void run() {
try {
summary(p, data); summary(p, data);
// deleting its own reference // deleting its own reference
data.summaryTask = -1; data.summaryTask = -1;
}catch(Exception e) {}
} }
}; };

View File

@ -223,6 +223,8 @@ public class MovingCheck extends Check {
@Override @Override
public void run() { public void run() {
try {
if(data.highestLogLevel != null) { if(data.highestLogLevel != null) {
String logString = String.format(summaryMessage, p.getName(), ticksBeforeSummary/20, data.violationsInARow[0], data.violationsInARow[1],data.violationsInARow[2]); String logString = String.format(summaryMessage, p.getName(), ticksBeforeSummary/20, data.violationsInARow[0], data.violationsInARow[1],data.violationsInARow[2]);
plugin.log(data.highestLogLevel, logString); plugin.log(data.highestLogLevel, logString);
@ -236,6 +238,8 @@ public class MovingCheck extends Check {
data.violationsInARow[1] = 0; data.violationsInARow[1] = 0;
data.violationsInARow[2] = 0; data.violationsInARow[2] = 0;
} }
catch(Exception e) { }
}
}; };
// Give a summary in x ticks. 20 ticks ~ 1 second // Give a summary in x ticks. 20 ticks ~ 1 second

View File

@ -92,6 +92,9 @@ public class NoCheatConfiguration {
SimpleYaml.getString("logging.logtoirctag", "nocheat", yamlContent))); SimpleYaml.getString("logging.logtoirctag", "nocheat", yamlContent)));
} }
root.add(new BooleanOption("newpermsystem", SimpleYaml.getBoolean("newpermsystem", false, yamlContent)));
root.add(new BooleanOption("showinfomessages", SimpleYaml.getBoolean("showinfomessages", true, yamlContent)));
/*** ACTIVE section ***/ /*** ACTIVE section ***/
{ {
ParentOption activeNode = new ParentOption("active", false); ParentOption activeNode = new ParentOption("active", false);

View File

@ -11,10 +11,10 @@ public class PermissionData {
public static final int PERMISSION_FLYING = 1; public static final int PERMISSION_FLYING = 1;
public static final int PERMISSION_SPEEDHACK = 2; public static final int PERMISSION_SPEEDHACK = 2;
public static final int PERMISSION_AIRBUILD = 3; public static final int PERMISSION_AIRBUILD = 3;
public static final int PERMISSION_BEDTELEPORT = 4; public static final int PERMISSION_BEDTELEPORT = 4; // No longer used
public static final int PERMISSION_BOGUSITEMS = 5; public static final int PERMISSION_BOGUSITEMS = 5;
public static final int PERMISSION_NOTIFY = 6; public static final int PERMISSION_NOTIFY = 6;
public static final int PERMISSION_ITEMDUPE = 7; public static final int PERMISSION_ITEMDUPE = 7; // No longer used
public static final int PERMISSION_FAKESNEAK = 8; public static final int PERMISSION_FAKESNEAK = 8;
public static final int PERMISSION_FASTSWIM = 9; public static final int PERMISSION_FASTSWIM = 9;
public static final int PERMISSION_NUKE = 10; public static final int PERMISSION_NUKE = 10;

View File

@ -37,6 +37,11 @@ public class Explainations {
"blocks that are outside his field of sight, he'll get kicked from the server.\n" + "blocks that are outside his field of sight, he'll get kicked from the server.\n" +
"This is only a temporary solution (and will probably not hold for long), but it's better than nothing, I guess..."); "This is only a temporary solution (and will probably not hold for long), but it's better than nothing, I guess...");
set("newpermsystem", "If activated, NoCheat will fully rely on the new Permission system of Bukkit, introduced with build 1000.\n" +
"This only makes sense if you also have a permission plugin that is capable of managing permissions in the new system.");
set("showinfomessages", "If activated, NoCheat will give useful advice and information on startup, about recent changes and potential \n" +
"problems with your servers configuration or conflicts with other plugins.");
set("logging.filename", "Determines where the various messages by NoCheat are stored at, if logging to file is activated."); set("logging.filename", "Determines where the various messages by NoCheat are stored at, if logging to file is activated.");
set("logging.logtofile", "Determine what severeness messages need to have to be printed to the logfile.\n" + set("logging.logtofile", "Determine what severeness messages need to have to be printed to the logfile.\n" +
"The values that can be used are:\n" + "The values that can be used are:\n" +