mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-12-30 20:37:52 +01:00
Added new Permissions support, and defined permissions in plugin.yml
Added Tips-and-Tricks on startup
This commit is contained in:
parent
c438eee164
commit
cd99a78718
47
plugin.yml
47
plugin.yml
@ -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 ]
|
||||||
|
|
||||||
@ -14,4 +14,47 @@ commands:
|
|||||||
/<command>
|
/<command>
|
||||||
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
|
||||||
|
|
||||||
|
|
||||||
|
|
106
src/cc/co/evenprime/bukkit/nocheat/CustomCommandSender.java
Normal file
106
src/cc/co/evenprime/bukkit/nocheat/CustomCommandSender.java
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
@ -32,8 +32,12 @@ 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()) {
|
||||||
it.remove();
|
// Cancel all referenced tasks before removing the entry
|
||||||
|
cancelTasks(pairs.getValue());
|
||||||
|
it.remove();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -127,37 +131,39 @@ 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;
|
|
||||||
|
|
||||||
if(d != null) {
|
|
||||||
int id = d.summaryTask;
|
|
||||||
|
|
||||||
if(id != -1) {
|
|
||||||
Bukkit.getServer().getScheduler().cancelTask(id);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// To prevent accidentially creating a new one while cleaning up
|
|
||||||
d.summaryTask = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MovingData d2 = pairs.getValue().moving;
|
|
||||||
|
|
||||||
if(d2 != null) {
|
|
||||||
int id = d2.summaryTask;
|
|
||||||
|
|
||||||
if(id != -1) {
|
|
||||||
Bukkit.getServer().getScheduler().cancelTask(id);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// To prevent accidentially creating a new one while cleaning up
|
|
||||||
d2.summaryTask = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void cancelTasks(NoCheatData data) {
|
||||||
|
|
||||||
|
AirbuildData d = data.airbuild;
|
||||||
|
|
||||||
|
if(d != null) {
|
||||||
|
int id = d.summaryTask;
|
||||||
|
|
||||||
|
if(id != -1) {
|
||||||
|
Bukkit.getServer().getScheduler().cancelTask(id);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// To prevent accidentially creating a new one while cleaning up
|
||||||
|
d.summaryTask = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MovingData d2 = data.moving;
|
||||||
|
|
||||||
|
if(d2 != null) {
|
||||||
|
int id = d2.summaryTask;
|
||||||
|
|
||||||
|
if(id != -1) {
|
||||||
|
Bukkit.getServer().getScheduler().cancelTask(id);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// To prevent accidentially creating a new one while cleaning up
|
||||||
|
d2.summaryTask = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -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,417 +34,443 @@ 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;
|
||||||
private AirbuildCheck airbuildCheck;
|
private AirbuildCheck airbuildCheck;
|
||||||
private BogusitemsCheck bogusitemsCheck;
|
private BogusitemsCheck bogusitemsCheck;
|
||||||
|
|
||||||
private Check[] checks;
|
|
||||||
|
|
||||||
private NoCheatConfiguration config;
|
|
||||||
|
|
||||||
private long exceptionWithPermissions = 0;
|
|
||||||
|
|
||||||
private int cleanUpTaskId = -1;
|
|
||||||
private int serverLagMeasureTaskSetup = -1;
|
|
||||||
|
|
||||||
private int serverTicks = 0;
|
|
||||||
private long serverLagInMilliSeconds = 0;
|
|
||||||
private long lastServerTime = 0;
|
|
||||||
|
|
||||||
// Permissions, if available
|
|
||||||
private PermissionHandler permissions;
|
|
||||||
|
|
||||||
// CraftIRC, if available
|
private Check[] checks;
|
||||||
private CraftIRC irc;
|
|
||||||
private boolean allowFlightSet;
|
|
||||||
|
|
||||||
private Level chatLevel;
|
private NoCheatConfiguration config;
|
||||||
private Level ircLevel;
|
|
||||||
private Level consoleLevel;
|
|
||||||
private String ircTag;
|
|
||||||
private NukeCheck nukeCheck;
|
|
||||||
|
|
||||||
|
private boolean useNewPermissionSystem = false;
|
||||||
|
|
||||||
private DataManager dataManager;
|
private long exceptionWithPermissions = 0;
|
||||||
|
|
||||||
public NoCheat() {
|
|
||||||
|
|
||||||
}
|
private int cleanUpTaskId = -1;
|
||||||
|
private int serverLagMeasureTaskSetup = -1;
|
||||||
|
|
||||||
@Override
|
private int serverTicks = 0;
|
||||||
public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args)
|
private long serverLagInMilliSeconds = 0;
|
||||||
{
|
private long lastServerTime = 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"));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else if(args.length == 1 && args[0] != null && args[0].trim().equals("-p")) {
|
|
||||||
if(sender instanceof Player) {
|
|
||||||
Player p = (Player) sender;
|
|
||||||
|
|
||||||
sender.sendMessage("NC: You have permissions: " + getPermissionsForPlayerAsString(p));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
sender.sendMessage("NC: You have to be a player to use this command");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(args.length == 2 && args[0] != null && args[0].trim().equals("-p")) {
|
|
||||||
Player p = getServer().getPlayer(args[1]);
|
|
||||||
|
|
||||||
if(p != null) {
|
// Permissions, if available
|
||||||
sender.sendMessage("NC: "+p.getName() + " has permissions: " + getPermissionsForPlayerAsString(p));
|
private PermissionHandler permissions;
|
||||||
return true;
|
|
||||||
}
|
// CraftIRC, if available
|
||||||
else {
|
private CraftIRC irc;
|
||||||
sender.sendMessage("NC: Player " + args[1] + " was not found.");
|
private boolean allowFlightSet;
|
||||||
return true;
|
|
||||||
}
|
private Level chatLevel;
|
||||||
}
|
private Level ircLevel;
|
||||||
|
private Level consoleLevel;
|
||||||
return false;
|
private String ircTag;
|
||||||
}
|
private NukeCheck nukeCheck;
|
||||||
|
|
||||||
|
private DataManager dataManager;
|
||||||
|
|
||||||
public void onDisable() {
|
private CustomCommandSender sender;
|
||||||
|
private boolean showStartupMessages = true;
|
||||||
PluginDescriptionFile pdfFile = this.getDescription();
|
|
||||||
|
public NoCheat() {
|
||||||
if(config != null)
|
|
||||||
config.cleanup();
|
}
|
||||||
|
|
||||||
try {
|
public String[] getMessagesOfTheDay() {
|
||||||
teardownCleanupTask();
|
|
||||||
teardownServerLagMeasureTask();
|
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."};
|
||||||
|
}
|
||||||
dataManager.cancelPlayerDataTasks();
|
|
||||||
}
|
@Override
|
||||||
catch(Exception e) { /* Can't do much in case of error here... */ }
|
public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) {
|
||||||
Logger.getLogger("Minecraft").info( "[NoCheat] version [" + pdfFile.getVersion() + "] is disabled.");
|
|
||||||
}
|
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"));
|
||||||
public void onEnable() {
|
return true;
|
||||||
|
} else if(args.length == 1 && args[0] != null && args[0].trim().equals("-p")) {
|
||||||
dataManager = new DataManager();
|
if(sender instanceof Player) {
|
||||||
// parse the nocheat.yml config file
|
Player p = (Player) sender;
|
||||||
setupConfig();
|
|
||||||
|
sender.sendMessage("NC: You have permissions: " + getPermissionsForPlayerAsString(p));
|
||||||
movingCheck = new MovingCheck(this, config);
|
return true;
|
||||||
speedhackCheck = new SpeedhackCheck(this, config);
|
} else {
|
||||||
airbuildCheck = new AirbuildCheck(this, config);
|
sender.sendMessage("NC: You have to be a player to use this command");
|
||||||
bogusitemsCheck = new BogusitemsCheck(this, config);
|
return true;
|
||||||
nukeCheck = new NukeCheck(this, config);
|
}
|
||||||
|
} else if(args.length == 2 && args[0] != null && args[0].trim().equals("-p")) {
|
||||||
// just for convenience
|
Player p = getServer().getPlayer(args[1]);
|
||||||
checks = new Check[] { movingCheck, speedhackCheck, airbuildCheck, bogusitemsCheck, nukeCheck };
|
|
||||||
|
if(p != null) {
|
||||||
if(!allowFlightSet && movingCheck.isActive()) {
|
sender.sendMessage("NC: " + p.getName() + " has permissions: " + getPermissionsForPlayerAsString(p));
|
||||||
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\"");
|
return true;
|
||||||
}
|
} else {
|
||||||
|
sender.sendMessage("NC: Player " + args[1] + " was not found.");
|
||||||
PluginDescriptionFile pdfFile = this.getDescription();
|
return true;
|
||||||
|
}
|
||||||
// Get, if available, the Permissions and irc plugin
|
}
|
||||||
setupPermissions();
|
|
||||||
setupIRC();
|
return false;
|
||||||
|
}
|
||||||
Logger.getLogger("Minecraft").info( "[NoCheat] version [" + pdfFile.getVersion() + "] is enabled with the following checks: "+getActiveChecksAsString());
|
|
||||||
|
public void onDisable() {
|
||||||
setupCleanupTask();
|
|
||||||
|
PluginDescriptionFile pdfFile = this.getDescription();
|
||||||
setupServerLagMeasureTask();
|
|
||||||
}
|
if(config != null)
|
||||||
|
config.cleanup();
|
||||||
public DataManager getDataManager() {
|
|
||||||
return dataManager;
|
try {
|
||||||
}
|
dataManager.cancelPlayerDataTasks();
|
||||||
|
|
||||||
private void setupCleanupTask() {
|
teardownCleanupTask();
|
||||||
|
teardownServerLagMeasureTask();
|
||||||
if(cleanUpTaskId != -1) return;
|
} catch(Exception e) { /* Can't do much in case of error here... */
|
||||||
|
}
|
||||||
try {
|
Logger.getLogger("Minecraft").info("[NoCheat] version [" + pdfFile.getVersion() + "] is disabled.");
|
||||||
cleanUpTaskId = Bukkit.getServer().getScheduler().scheduleAsyncRepeatingTask(this, new Runnable() {
|
}
|
||||||
|
|
||||||
@Override
|
public void onEnable() {
|
||||||
public void run() {
|
|
||||||
dataManager.cleanPlayerDataCollection();
|
dataManager = new DataManager();
|
||||||
}
|
|
||||||
}, 5000, 5000);
|
sender = new CustomCommandSender(getServer());
|
||||||
}
|
// parse the nocheat.yml config file
|
||||||
catch(Exception e) {
|
setupConfig();
|
||||||
// It's not THAT important, so if it fails for whatever reason, just let it be.
|
|
||||||
}
|
movingCheck = new MovingCheck(this, config);
|
||||||
}
|
speedhackCheck = new SpeedhackCheck(this, config);
|
||||||
|
airbuildCheck = new AirbuildCheck(this, config);
|
||||||
private void teardownCleanupTask() {
|
bogusitemsCheck = new BogusitemsCheck(this, config);
|
||||||
if(cleanUpTaskId != -1)
|
nukeCheck = new NukeCheck(this, config);
|
||||||
Bukkit.getServer().getScheduler().cancelTask(cleanUpTaskId);
|
|
||||||
}
|
// just for convenience
|
||||||
|
checks = new Check[] {movingCheck, speedhackCheck, airbuildCheck, bogusitemsCheck, nukeCheck};
|
||||||
private void setupServerLagMeasureTask() {
|
|
||||||
|
if(!allowFlightSet && movingCheck.isActive()) {
|
||||||
if(serverLagMeasureTaskSetup != -1) return;
|
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\"");
|
||||||
|
}
|
||||||
serverLagMeasureTaskSetup = Bukkit.getServer().getScheduler().scheduleAsyncRepeatingTask(this, new Runnable() {
|
|
||||||
|
for(String s : getMessagesOfTheDay()) {
|
||||||
@Override
|
if(showStartupMessages)
|
||||||
public void run() {
|
Logger.getLogger("Minecraft").info("(NoCheat) Did you know? " + s);
|
||||||
serverTicks += 10;
|
}
|
||||||
long time = System.currentTimeMillis();
|
|
||||||
serverLagInMilliSeconds = Math.abs((time - lastServerTime - 500)*2);
|
PluginDescriptionFile pdfFile = this.getDescription();
|
||||||
lastServerTime = time;
|
|
||||||
}
|
// Get, if available, the Permissions and irc plugin
|
||||||
}, 10, 10);
|
if(!useNewPermissionSystem) {
|
||||||
}
|
setupPermissions();
|
||||||
|
}
|
||||||
private void teardownServerLagMeasureTask() {
|
setupIRC();
|
||||||
if(serverLagMeasureTaskSetup != -1)
|
|
||||||
Bukkit.getServer().getScheduler().cancelTask(serverLagMeasureTaskSetup);
|
Logger.getLogger("Minecraft").info("[NoCheat] version [" + pdfFile.getVersion() + "] is enabled with the following checks: " + getActiveChecksAsString());
|
||||||
}
|
|
||||||
|
setupCleanupTask();
|
||||||
/**
|
|
||||||
* Get, if available, a reference to the Permissions-plugin
|
setupServerLagMeasureTask();
|
||||||
*/
|
}
|
||||||
private void setupPermissions() {
|
|
||||||
|
public DataManager getDataManager() {
|
||||||
Plugin permissionsPlugin = this.getServer().getPluginManager().getPlugin("Permissions");
|
|
||||||
|
return dataManager;
|
||||||
if (this.permissions == null) {
|
}
|
||||||
if (permissionsPlugin != null) {
|
|
||||||
this.permissions = ((Permissions) permissionsPlugin).getHandler();
|
private void setupCleanupTask() {
|
||||||
} else {
|
|
||||||
PluginDescriptionFile pdfFile = this.getDescription();
|
if(cleanUpTaskId != -1) {
|
||||||
Logger.getLogger("Minecraft").warning("[NoCheat] version [" + pdfFile.getVersion() + "] couldn't find Permissions plugin. Fallback to 'isOp()' equals 'nocheat.*'");
|
return;
|
||||||
}
|
}
|
||||||
}
|
try {
|
||||||
}
|
cleanUpTaskId = Bukkit.getServer().getScheduler().scheduleAsyncRepeatingTask(this, new Runnable() {
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Get, if available, a reference to the Permissions-plugin
|
public void run() {
|
||||||
*/
|
|
||||||
private void setupIRC() {
|
try {
|
||||||
CraftIRC p = null;
|
if(getDataManager() != null) {
|
||||||
|
getDataManager().cleanPlayerDataCollection();
|
||||||
Plugin test = this.getServer().getPluginManager().getPlugin("CraftIRC");
|
}
|
||||||
|
} catch(Exception e) {}
|
||||||
if(test != null && test instanceof CraftIRC) {
|
}
|
||||||
p = (CraftIRC)test;
|
}, 5000, 5000);
|
||||||
}
|
} catch(Exception e) {
|
||||||
|
// It's not THAT important, so if it fails for whatever reason, just
|
||||||
if(p == null) {
|
// let it be.
|
||||||
PluginDescriptionFile pdfFile = this.getDescription();
|
}
|
||||||
Logger.getLogger("Minecraft").info("[NoCheat] version [" + pdfFile.getVersion() + "] couldn't find CrafTIRC plugin. Disabling logging to IRC.");
|
}
|
||||||
}
|
|
||||||
|
private void teardownCleanupTask() {
|
||||||
irc = p;
|
|
||||||
}
|
if(cleanUpTaskId != -1) {
|
||||||
|
Bukkit.getServer().getScheduler().cancelTask(cleanUpTaskId);
|
||||||
/**
|
}
|
||||||
* Log a violation message to all locations declared in the config file
|
}
|
||||||
* @param message
|
|
||||||
*/
|
private void setupServerLagMeasureTask() {
|
||||||
public void log(Level l, String message) {
|
|
||||||
if(l != null && message != null) {
|
if(serverLagMeasureTaskSetup != -1) {
|
||||||
message = "NC: " + message;
|
return;
|
||||||
config.logger.log(l, message);
|
}
|
||||||
logToConsole(l, message);
|
|
||||||
logToChat(l, message);
|
serverLagMeasureTaskSetup = Bukkit.getServer().getScheduler().scheduleAsyncRepeatingTask(this, new Runnable() {
|
||||||
logToIRC(l, message);
|
|
||||||
|
@Override
|
||||||
}
|
public void run() {
|
||||||
}
|
|
||||||
|
serverTicks += 10;
|
||||||
private void logToChat(Level l, String message) {
|
long time = System.currentTimeMillis();
|
||||||
if(chatLevel.intValue() <= l.intValue()) {
|
serverLagInMilliSeconds = Math.abs((time - lastServerTime - 500) * 2);
|
||||||
for(Player player : getServer().getOnlinePlayers()) {
|
lastServerTime = time;
|
||||||
if(hasPermission(player, PermissionData.PERMISSION_NOTIFY, false)) {
|
|
||||||
player.sendMessage("["+l.getName()+"] " + message);
|
}
|
||||||
}
|
}, 10, 10);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
private void teardownServerLagMeasureTask() {
|
||||||
|
|
||||||
private void logToIRC(Level l, String message) {
|
if(serverLagMeasureTaskSetup != -1) {
|
||||||
if(irc != null && ircLevel.intValue() <= l.intValue()) {
|
Bukkit.getServer().getScheduler().cancelTask(serverLagMeasureTaskSetup);
|
||||||
irc.sendMessageToTag("["+l.getName()+"] " + message , ircTag);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
private void logToConsole(Level l, String message) {
|
* Get, if available, a reference to the Permissions-plugin
|
||||||
if( consoleLevel.intValue() <= l.intValue()) {
|
*/
|
||||||
Logger.getLogger("Minecraft").log(l, message);
|
private void setupPermissions() {
|
||||||
}
|
|
||||||
}
|
Plugin permissionsPlugin = this.getServer().getPluginManager().getPlugin("Permissions");
|
||||||
|
|
||||||
|
if(this.permissions == null) {
|
||||||
public boolean hasPermission(Player player, int permission, boolean checkOPs) {
|
if(permissionsPlugin != null) {
|
||||||
|
this.permissions = ((Permissions) permissionsPlugin).getHandler();
|
||||||
if(player == null) return false;
|
} else {
|
||||||
|
PluginDescriptionFile pdfFile = this.getDescription();
|
||||||
try {
|
Logger.getLogger("Minecraft").warning("[NoCheat] version [" + pdfFile.getVersion() + "] couldn't find Permissions plugin. Fallback to 'isOp()' equals 'nocheat.*'");
|
||||||
if(permissions == null) {
|
}
|
||||||
if(checkOPs) {
|
}
|
||||||
// OPs don't get special treatment
|
}
|
||||||
return false;
|
|
||||||
}
|
/**
|
||||||
else {
|
* Get, if available, a reference to the Permissions-plugin
|
||||||
return player.isOp();
|
*/
|
||||||
}
|
private void setupIRC() {
|
||||||
}
|
|
||||||
else {
|
CraftIRC p = null;
|
||||||
PermissionData data = dataManager.getPermissionData(player);
|
|
||||||
long time = System.currentTimeMillis();
|
Plugin test = this.getServer().getPluginManager().getPlugin("CraftIRC");
|
||||||
if(data.lastUpdate[permission] + 10000 < time) {
|
|
||||||
data.lastUpdate[permission] = time;
|
if(test != null && test instanceof CraftIRC) {
|
||||||
data.cache[permission] = permissions.has(player, PermissionData.permissionNames[permission]);
|
p = (CraftIRC) test;
|
||||||
}
|
}
|
||||||
return data.cache[permission];
|
|
||||||
}
|
if(p == null) {
|
||||||
}
|
PluginDescriptionFile pdfFile = this.getDescription();
|
||||||
catch(Throwable e) {
|
Logger.getLogger("Minecraft").info("[NoCheat] version [" + pdfFile.getVersion() + "] couldn't find CrafTIRC plugin. Disabling logging to IRC.");
|
||||||
if(this.exceptionWithPermissions + 60000 < System.currentTimeMillis()) {
|
}
|
||||||
// Prevent spam and recursion by definitely doing this only once
|
|
||||||
this.exceptionWithPermissions = System.currentTimeMillis();
|
irc = p;
|
||||||
|
}
|
||||||
String logtext = "Asking Permissions-Plugin if "+player.getName()+" has permission "+PermissionData.permissionNames[permission]+" caused an Exception "+ e.getMessage() + ". Please review your permissions config file. This message is displayed at most once every 60 seconds.";
|
|
||||||
log(Level.SEVERE, logtext);
|
/**
|
||||||
for(StackTraceElement s : e.getStackTrace()) {
|
* Log a violation message to all locations declared in the config file
|
||||||
config.logger.log(Level.SEVERE, s.toString());
|
*
|
||||||
}
|
* @param message
|
||||||
}
|
*/
|
||||||
return false;
|
public void log(Level l, String message) {
|
||||||
}
|
|
||||||
}
|
if(l != null && message != null) {
|
||||||
|
message = "NC: " + message;
|
||||||
/**
|
config.logger.log(l, message);
|
||||||
* Read the config file
|
logToConsole(l, message);
|
||||||
*/
|
logToChat(l, message);
|
||||||
private void setupConfig() {
|
logToIRC(l, message);
|
||||||
if(this.config == null)
|
|
||||||
this.config = new NoCheatConfiguration(new File(NoCheatConfiguration.configFile), new File(NoCheatConfiguration.descriptionsFile));
|
}
|
||||||
else
|
}
|
||||||
this.config.config(new File(NoCheatConfiguration.configFile), new File(NoCheatConfiguration.descriptionsFile));
|
|
||||||
|
private void logToChat(Level l, String message) {
|
||||||
config.setupFileLogger();
|
|
||||||
|
if(chatLevel.intValue() <= l.intValue()) {
|
||||||
try {
|
for(Player player : getServer().getOnlinePlayers()) {
|
||||||
this.chatLevel = config.getLogLevelValue("logging.logtochat");
|
if(hasPermission(player, PermissionData.PERMISSION_NOTIFY, false)) {
|
||||||
this.ircLevel = config.getLogLevelValue("logging.logtoirc");
|
player.sendMessage("[" + l.getName() + "] " + message);
|
||||||
this.consoleLevel = config.getLogLevelValue("logging.logtoconsole");
|
}
|
||||||
this.ircTag = config.getStringValue("logging.logtoirctag");
|
}
|
||||||
} catch (ConfigurationException e) {
|
}
|
||||||
this.setEnabled(false);
|
}
|
||||||
}
|
|
||||||
|
private void logToIRC(Level l, String message) {
|
||||||
try {
|
|
||||||
BufferedReader reader = new BufferedReader(new FileReader(new File("server.properties")));
|
if(irc != null && ircLevel.intValue() <= l.intValue()) {
|
||||||
|
irc.sendMessageToTag("[" + l.getName() + "] " + message, ircTag);
|
||||||
allowFlightSet = true;
|
}
|
||||||
String s = null;
|
}
|
||||||
|
|
||||||
while((s = reader.readLine()) != null) {
|
private void logToConsole(Level l, String message) {
|
||||||
if(s.startsWith("allow-flight=false")) {
|
|
||||||
allowFlightSet = false;
|
if(consoleLevel.intValue() <= l.intValue()) {
|
||||||
}
|
Logger.getLogger("Minecraft").log(l, message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
public boolean hasPermission(Player player, int permission, boolean ignoreOPstatus) {
|
||||||
// ignore errors
|
|
||||||
}
|
if(player == null)
|
||||||
}
|
return false;
|
||||||
|
|
||||||
|
if(useNewPermissionSystem) {
|
||||||
private String getActiveChecksAsString() {
|
//System.out.println("New permissions system asked for " + PermissionData.permissionNames[permission] + " got " + player.hasPermission(PermissionData.permissionNames[permission]));
|
||||||
|
return player.hasPermission(PermissionData.permissionNames[permission]);
|
||||||
String s = "";
|
}
|
||||||
|
|
||||||
for(Check c : checks) {
|
try {
|
||||||
s = s + (c.isActive() ? c.getName() + " " : "");
|
if(permissions == null) {
|
||||||
}
|
if(ignoreOPstatus) {
|
||||||
|
// OPs don't get special treatment
|
||||||
s = s + (movingCheck.isActive() && !movingCheck.allowFlying ? "flying " : "");
|
return false;
|
||||||
s = s + (movingCheck.isActive() && !movingCheck.allowFakeSneak ? "fakesneak " : "");
|
} else {
|
||||||
s = s + (movingCheck.isActive() && !movingCheck.allowFastSwim ? "fastswim " : "");
|
return player.isOp();
|
||||||
|
}
|
||||||
return s;
|
} else {
|
||||||
}
|
PermissionData data = dataManager.getPermissionData(player);
|
||||||
|
long time = System.currentTimeMillis();
|
||||||
|
if(data.lastUpdate[permission] + 10000 < time) {
|
||||||
private String getPermissionsForPlayerAsString(Player p) {
|
data.lastUpdate[permission] = time;
|
||||||
|
data.cache[permission] = permissions.has(player, PermissionData.permissionNames[permission]);
|
||||||
String s = "";
|
}
|
||||||
|
return data.cache[permission];
|
||||||
for(Check c : checks) {
|
}
|
||||||
s = s + (!c.isActive() ? c.getName() + "* " : (c.skipCheck(p) ? c.getName() + " " : ""));
|
} catch(Throwable e) {
|
||||||
}
|
if(this.exceptionWithPermissions + 60000 < System.currentTimeMillis()) {
|
||||||
|
// Prevent spam and recursion by definitely doing this only once
|
||||||
s = s + (!movingCheck.isActive() || movingCheck.allowFlying ? "flying* " : (hasPermission(p, PermissionData.PERMISSION_FLYING, movingCheck.checkOPs) ? "flying " : ""));
|
this.exceptionWithPermissions = System.currentTimeMillis();
|
||||||
s = s + (!movingCheck.isActive() || movingCheck.allowFakeSneak ? "fakesneak* " : (hasPermission(p, PermissionData.PERMISSION_FAKESNEAK, movingCheck.checkOPs) ? "fakesneak " : ""));
|
|
||||||
s = s + (!movingCheck.isActive() || movingCheck.allowFastSwim ? "fastswim* " : (hasPermission(p, PermissionData.PERMISSION_FASTSWIM, movingCheck.checkOPs) ? "fastswim " : ""));
|
String logtext = "Asking Permissions-Plugin if " + player.getName() + " has permission " + PermissionData.permissionNames[permission] + " caused an Exception " + e.getMessage() + ". Please review your permissions config file. This message is displayed at most once every 60 seconds.";
|
||||||
|
log(Level.SEVERE, logtext);
|
||||||
s = s + (hasPermission(p, PermissionData.PERMISSION_NOTIFY, false) ? "notify " : "");
|
for(StackTraceElement s : e.getStackTrace()) {
|
||||||
|
config.logger.log(Level.SEVERE, s.toString());
|
||||||
return s;
|
}
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
public int getServerTicks() {
|
}
|
||||||
return serverTicks;
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
public long getServerLag() {
|
* Read the config file
|
||||||
return this.serverLagInMilliSeconds;
|
*/
|
||||||
}
|
private void setupConfig() {
|
||||||
|
|
||||||
public void handleCustomAction(CustomAction a, Player player) {
|
if(this.config == null)
|
||||||
|
this.config = new NoCheatConfiguration(new File(NoCheatConfiguration.configFile), new File(NoCheatConfiguration.descriptionsFile));
|
||||||
String command = a.command.replace("[player]", player.getName());
|
else
|
||||||
try {
|
this.config.config(new File(NoCheatConfiguration.configFile), new File(NoCheatConfiguration.descriptionsFile));
|
||||||
String[] commandParts = command.split(" ", 2);
|
|
||||||
String commandName = commandParts[0];
|
config.setupFileLogger();
|
||||||
PluginCommand com = Bukkit.getServer().getPluginCommand(commandName);
|
|
||||||
|
try {
|
||||||
// If there's a plugin that can handle it
|
this.chatLevel = config.getLogLevelValue("logging.logtochat");
|
||||||
if(com != null) {
|
this.ircLevel = config.getLogLevelValue("logging.logtoirc");
|
||||||
if(commandParts.length > 1) { // Command + parameters
|
this.consoleLevel = config.getLogLevelValue("logging.logtoconsole");
|
||||||
String[] commandArgs = commandParts[1].split(" ");
|
this.ircTag = config.getStringValue("logging.logtoirctag");
|
||||||
com.execute(this, commandName, commandArgs);
|
this.useNewPermissionSystem = this.config.getBooleanValue("newpermsystem");
|
||||||
}
|
this.showStartupMessages = this.config.getBooleanValue("showinfomessages");
|
||||||
else {
|
} catch(ConfigurationException e) {
|
||||||
String[] commandArgs = new String[0];
|
e.printStackTrace();
|
||||||
com.execute(this, commandName, commandArgs);
|
this.setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
try {
|
||||||
{
|
BufferedReader reader = new BufferedReader(new FileReader(new File("server.properties")));
|
||||||
// The standard server should do it
|
|
||||||
Bukkit.getServer().dispatchCommand(this, command);
|
allowFlightSet = true;
|
||||||
}
|
String s = null;
|
||||||
}
|
|
||||||
catch(Exception e) {
|
while((s = reader.readLine()) != null) {
|
||||||
this.log(Level.WARNING, "NoCheat couldn't execute custom server command: \""+command+"\"");
|
if(s.startsWith("allow-flight=false")) {
|
||||||
}
|
allowFlightSet = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
}
|
||||||
public void sendMessage(String message) {
|
} catch(Exception e) {
|
||||||
// we don't receive messages
|
e.printStackTrace();
|
||||||
|
// ignore errors
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
}
|
||||||
public boolean isOp() {
|
|
||||||
// We declare ourselves to be OP to be allowed to do more commands
|
private String getActiveChecksAsString() {
|
||||||
return true;
|
|
||||||
}
|
String s = "";
|
||||||
}
|
|
||||||
|
for(Check c : checks) {
|
||||||
|
s = s + (c.isActive() ? c.getName() + " " : "");
|
||||||
|
}
|
||||||
|
|
||||||
|
s = s + (movingCheck.isActive() && !movingCheck.allowFlying ? "flying " : "");
|
||||||
|
s = s + (movingCheck.isActive() && !movingCheck.allowFakeSneak ? "fakesneak " : "");
|
||||||
|
s = s + (movingCheck.isActive() && !movingCheck.allowFastSwim ? "fastswim " : "");
|
||||||
|
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getPermissionsForPlayerAsString(Player p) {
|
||||||
|
|
||||||
|
String s = "";
|
||||||
|
|
||||||
|
for(Check c : checks) {
|
||||||
|
s = s + (!c.isActive() ? c.getName() + "* " : (c.skipCheck(p) ? c.getName() + " " : ""));
|
||||||
|
}
|
||||||
|
|
||||||
|
s = s + (!movingCheck.isActive() || movingCheck.allowFlying ? "flying* " : (hasPermission(p, PermissionData.PERMISSION_FLYING, movingCheck.checkOPs) ? "flying " : ""));
|
||||||
|
s = s + (!movingCheck.isActive() || movingCheck.allowFakeSneak ? "fakesneak* " : (hasPermission(p, PermissionData.PERMISSION_FAKESNEAK, movingCheck.checkOPs) ? "fakesneak " : ""));
|
||||||
|
s = s + (!movingCheck.isActive() || movingCheck.allowFastSwim ? "fastswim* " : (hasPermission(p, PermissionData.PERMISSION_FASTSWIM, movingCheck.checkOPs) ? "fastswim " : ""));
|
||||||
|
|
||||||
|
s = s + (hasPermission(p, PermissionData.PERMISSION_NOTIFY, false) ? "notify " : "");
|
||||||
|
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getServerTicks() {
|
||||||
|
|
||||||
|
return serverTicks;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getServerLag() {
|
||||||
|
|
||||||
|
return this.serverLagInMilliSeconds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void handleCustomAction(CustomAction a, Player player) {
|
||||||
|
|
||||||
|
String command = a.command.replace("[player]", player.getName());
|
||||||
|
try {
|
||||||
|
String[] commandParts = command.split(" ", 2);
|
||||||
|
String commandName = commandParts[0];
|
||||||
|
PluginCommand com = Bukkit.getServer().getPluginCommand(commandName);
|
||||||
|
|
||||||
|
// If there's a plugin that can handle it
|
||||||
|
if(com != null) {
|
||||||
|
if(commandParts.length > 1) { // Command + parameters
|
||||||
|
String[] commandArgs = commandParts[1].split(" ");
|
||||||
|
com.execute(sender, commandName, commandArgs);
|
||||||
|
} else {
|
||||||
|
String[] commandArgs = new String[0];
|
||||||
|
com.execute(sender, commandName, commandArgs);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// The standard server should do it
|
||||||
|
Bukkit.getServer().dispatchCommand(sender, command);
|
||||||
|
}
|
||||||
|
} catch(Exception e) {
|
||||||
|
this.log(Level.WARNING, "NoCheat couldn't execute custom server command: \"" + command + "\"");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -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) {}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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);
|
||||||
@ -235,6 +237,8 @@ public class MovingCheck extends Check {
|
|||||||
data.violationsInARow[0] = 0;
|
data.violationsInARow[0] = 0;
|
||||||
data.violationsInARow[1] = 0;
|
data.violationsInARow[1] = 0;
|
||||||
data.violationsInARow[2] = 0;
|
data.violationsInARow[2] = 0;
|
||||||
|
}
|
||||||
|
catch(Exception e) { }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -91,6 +91,9 @@ public class NoCheatConfiguration {
|
|||||||
loggingNode.add(new ShortStringOption("logtoirctag",
|
loggingNode.add(new ShortStringOption("logtoirctag",
|
||||||
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 ***/
|
||||||
{
|
{
|
||||||
|
@ -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;
|
||||||
|
@ -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" +
|
||||||
|
Loading…
Reference in New Issue
Block a user