diff --git a/.gitignore b/.gitignore index b69b421..01d4018 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target/ /.* *.iml +*.properties diff --git a/README.md b/README.md index 9bb1aba..6d18bff 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ AntiCheat helps server admins easily identify and block malicious users by monit Usage ------- Simply drag and drop the plugin into your Plugins folder. Optional configuration and permissions are available: - + http://dev.bukkit.org/server-mods/anticheat/pages/configuration/ http://dev.bukkit.org/server-mods/anticheat/pages/permissions/ @@ -24,13 +24,13 @@ Bug Reporting/Support/Questions Issues should be filed by hitting the [issues](https://github.com/h31ix/AntiCheat/issues?state=open) tab above. Please make sure you search your issue before opening a new ticket. -All opened tickets that are bug reports require a debug log that includes logs of the issue in question. To obtain this, type `/anticheat debug` on your server. Note that for the debug output to contain valid information and help us diagnose your issue, you need to issue this command AFTER the issue occurs at least once and BEFORE you reload or restart it. +All opened tickets that are bug reports require a debug log that includes logs of the issue in question. To obtain this, type `/anticheat debug` on your server. Note that for the debug output to contain valid information and help us diagnose your issue, you need to issue this command AFTER the issue occurs at least once and BEFORE you reload or restart it. Resources ------- -BukkitDev --- http://dev.bukkit.org/server-mods/anticheat/ +BukkitDev: http://dev.bukkit.org/server-mods/anticheat/ -Development Builds --- http://ci.gravitydevelopment.net/job/AntiCheat/ +Development Builds: http://ci.gravitydevelopment.net/job/AntiCheat/ Latest release download: http://api.bukget.org/2/bukkit/plugin/anticheat/latest/download @@ -44,7 +44,7 @@ AntiCheat builds on Java JDK 1.6 and uses [Maven 3](http://maven.apache.org/down To download the source code, first make sure [Git](http://git-scm.com/) is installed, then (from the command line) use ```git clone git@github.com:h31ix/AntiCheat.git``` -The source code will be downloaded into a new directory 'AntiCheat'. +The source code will be downloaded into a new directory 'AntiCheat'. Make any changes you desire and then, to compile AntiCheat, ensure you are inside the AntiCheat directory (cd AntiCheat) and use ```mvn clean install``` diff --git a/src/main/java/net/gravitydevelopment/anticheat/CommandHandler.java b/src/main/java/net/gravitydevelopment/anticheat/CommandHandler.java index ca725f1..90b7634 100644 --- a/src/main/java/net/gravitydevelopment/anticheat/CommandHandler.java +++ b/src/main/java/net/gravitydevelopment/anticheat/CommandHandler.java @@ -209,10 +209,10 @@ public class CommandHandler implements CommandExecutor { public void handleUpdate(CommandSender cs) { if (hasPermission(cs, Permission.SYSTEM_UPDATE)) { - cs.sendMessage("Running " + GREEN + "AntiCheat " + WHITE + "v" + GREEN + AntiCheat.getVersion()); + cs.sendMessage(GRAY + "Running AntiCheat v" + GREEN + AntiCheat.getVersion()); cs.sendMessage(MENU_END); if (!AntiCheat.isUpdated()) { - cs.sendMessage(GRAY + "There " + GREEN + "IS" + GRAY + " a newer version avaliable."); + cs.sendMessage(GRAY + "There " + GREEN + "IS" + GRAY + " a newer version available."); if (CONFIG.getConfig().autoUpdate.getValue()) { cs.sendMessage(GRAY + "It will be installed automatically for you on next launch."); } else { @@ -246,6 +246,13 @@ public class CommandHandler implements CommandExecutor { } else { cs.sendMessage(RED + "Not a valid page number: " + WHITE + args[2]); } + } else if (group.equalsIgnoreCase("all")) { + cs.sendMessage(GREEN + "Low: " + WHITE + USER_MANAGER.getUsersInGroup(null).size() + " players"); + for (Group g : CONFIG.getGroups().getGroups()) { + int numPlayers = USER_MANAGER.getUsersInGroup(g).size(); + cs.sendMessage(g.getColor() + g.getName() + WHITE + ": " + numPlayers + " players"); + } + cs.sendMessage("Use /anticheat report [group] for a list of players in each group."); } else { boolean sent = false; for (Group g : CONFIG.getGroups().getGroups()) { @@ -276,10 +283,11 @@ public class CommandHandler implements CommandExecutor { public void sendReport(CommandSender cs, Group group, int page) { List users = USER_MANAGER.getUsersInGroup(group); ChatColor color = group == null ? GREEN : group.getColor(); + String groupName = group == null ? "Low" : group.getName(); int pages = (int) Math.ceil(((float) users.size()) / 7); if (page <= pages && page > 0) { cs.sendMessage("--------------------[" + GREEN + "REPORT[" + page + "/" + pages + "]" + WHITE + "]---------------------"); - cs.sendMessage(GRAY + "Group: " + color + group); + cs.sendMessage(GRAY + "Group: " + color + groupName); for (int x = 0; x < 7; x++) { int index = ((page - 1) * 6) + (x + ((page - 1) * 1)); if (index < users.size()) { @@ -291,7 +299,7 @@ public class CommandHandler implements CommandExecutor { } else { if (pages == 0) { cs.sendMessage("--------------------[" + GREEN + "REPORT[1/1]" + WHITE + "]---------------------"); - cs.sendMessage(GRAY + "Group: " + color + group); + cs.sendMessage(GRAY + "Group: " + color + groupName); cs.sendMessage(GRAY + "There are no users in this group."); cs.sendMessage(MENU_END); } else { @@ -413,7 +421,7 @@ public class CommandHandler implements CommandExecutor { } else if (args[0].equalsIgnoreCase("spy")) { handleSpy(cs, args); } else if (args[0].equalsIgnoreCase("report")) { - if (args[1].equalsIgnoreCase("low") || args[1].equalsIgnoreCase("medium") || args[1].equalsIgnoreCase("high")) { + if (args[1].equalsIgnoreCase("low") || args[1].equalsIgnoreCase("medium") || args[1].equalsIgnoreCase("high") || args[1].equalsIgnoreCase("all")) { handleReport(cs, args); } else { handlePlayerReport(cs, args); diff --git a/src/main/java/net/gravitydevelopment/anticheat/config/ConfigurationFile.java b/src/main/java/net/gravitydevelopment/anticheat/config/ConfigurationFile.java index 9a763c7..6e12f7d 100644 --- a/src/main/java/net/gravitydevelopment/anticheat/config/ConfigurationFile.java +++ b/src/main/java/net/gravitydevelopment/anticheat/config/ConfigurationFile.java @@ -38,7 +38,6 @@ public class ConfigurationFile { private AntiCheat plugin; private boolean saveDefault; - private boolean didSaveDefault; protected boolean needsReload; @@ -69,7 +68,6 @@ public class ConfigurationFile { if (!rawFile.exists()) { if (saveDefault) { plugin.saveResource(fileName, true); - didSaveDefault = true; } else { if (!rawFile.getParentFile().exists()) { rawFile.getParentFile().mkdir(); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index c27ab41..a637b52 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -1,5 +1,5 @@ # AntiCheat configuration file -# Please report any bugs: http://dev.bukkit.org/server-mods/anticheat/ +# Please report any bugs: https://github.com/gravitylow/AntiCheat/issues xray: # Should AntiCheat use calculations to try and find xrayers? check-xray: true @@ -45,4 +45,4 @@ system: enterprise: false disable-in: - example-world -- example-world-2 \ No newline at end of file +- example-world-2 diff --git a/src/main/resources/enterprise.yml b/src/main/resources/enterprise.yml index a2562e1..cf552b1 100644 --- a/src/main/resources/enterprise.yml +++ b/src/main/resources/enterprise.yml @@ -1,5 +1,5 @@ # AntiCheat configuration file -# Please report any bugs: http://dev.bukkit.org/server-mods/anticheat/ +# Please report any bugs: https://github.com/gravitylow/AntiCheat/issues # Server-specific settings server: # An identifiable name for this server @@ -37,4 +37,4 @@ config: # Load groups configuration from the database? groups: true # Load rules configuration from the database? - rules: true \ No newline at end of file + rules: true diff --git a/src/main/resources/groups.yml b/src/main/resources/groups.yml index aa63e18..29d0e63 100644 --- a/src/main/resources/groups.yml +++ b/src/main/resources/groups.yml @@ -1,6 +1,6 @@ # AntiCheat configuration file -# Please report any bugs: http://dev.bukkit.org/server-mods/anticheat/ +# Please report any bugs: https://github.com/gravitylow/AntiCheat/issues groups: - 'Medium : 20 : YELLOW : WARN' - 'High : 50 : RED : KICK' - - 'Custom : -1 : GREEN : COMMAND[ban &player;say hello world]' \ No newline at end of file + - 'Custom : -1 : GREEN : COMMAND[ban &player;say hello world]' diff --git a/src/main/resources/lang.yml b/src/main/resources/lang.yml index 1055348..7927400 100644 --- a/src/main/resources/lang.yml +++ b/src/main/resources/lang.yml @@ -1,5 +1,5 @@ # AntiCheat language file -# Please report any bugs: http://dev.bukkit.org/server-mods/anticheat/ +# Please report any bugs: https://github.com/gravitylow/AntiCheat/issues alert: - '&player has just entered the &group hack group.' - '&player''s last failed check was: &check.' diff --git a/src/main/resources/magic.yml b/src/main/resources/magic.yml index 275f923..ff2e511 100644 --- a/src/main/resources/magic.yml +++ b/src/main/resources/magic.yml @@ -1,6 +1,6 @@ # AntiCheat configuration file # Please report any bugs: http://dev.bukkit.org/server-mods/anticheat/ -# Documentation for these values is available at http://gravitydevelopment.net/docs/anticheat/net/h31ix/anticheat/util/Magic.html +# Documentation for these values is available at http://gravitydevelopment.net/docs/anticheat/net/gravitydevelopment/anticheat/util/Magic.html ANIMATION_CHECK: 5 ANIMATION_MIN: 200 ANIMATION_TIMEMIN: 90 @@ -85,4 +85,4 @@ Y_MAXVIOLATIONS: 1 Y_MAXVIOTIME: 5000 Y_SPEED_MAX: 0.5 Y_TIME: 1000 -VERSION: 0.3 \ No newline at end of file +VERSION: 0.3 diff --git a/src/main/resources/rules.yml b/src/main/resources/rules.yml index 207fe57..ac0c79d 100644 --- a/src/main/resources/rules.yml +++ b/src/main/resources/rules.yml @@ -1,5 +1,5 @@ # AntiCheat configuration file -# Please report any bugs: http://dev.bukkit.org/server-mods/anticheat/ +# Please report any bugs: https://github.com/gravitylow/AntiCheat/issues rules: # if spider check is less than 0, set group to 20. otherwise, do nothing - - 'Check_SPIDER < 0 ? Player.KICK : null' \ No newline at end of file + - 'Check_SPIDER < 0 ? Player.KICK : null'