More small changes, add /anticheat report all

This commit is contained in:
gravitylow committed 2013-10-17 17:16:30 -04:00
1 parent 2bf11e8587
commit 45daa7656d
10 files changed
+22 -15

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
/target/ /target/
/.* /.*
*.iml *.iml
*.properties
+2 -2
View File
@@ -28,9 +28,9 @@ All opened tickets that are bug reports require a debug log that includes logs o
Resources 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 Latest release download: http://api.bukget.org/2/bukkit/plugin/anticheat/latest/download
@@ -209,10 +209,10 @@ public class CommandHandler implements CommandExecutor {
public void handleUpdate(CommandSender cs) { public void handleUpdate(CommandSender cs) {
if (hasPermission(cs, Permission.SYSTEM_UPDATE)) { 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); cs.sendMessage(MENU_END);
if (!AntiCheat.isUpdated()) { 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()) { if (CONFIG.getConfig().autoUpdate.getValue()) {
cs.sendMessage(GRAY + "It will be installed automatically for you on next launch."); cs.sendMessage(GRAY + "It will be installed automatically for you on next launch.");
} else { } else {
@@ -246,6 +246,13 @@ public class CommandHandler implements CommandExecutor {
} else { } else {
cs.sendMessage(RED + "Not a valid page number: " + WHITE + args[2]); 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 { } else {
boolean sent = false; boolean sent = false;
for (Group g : CONFIG.getGroups().getGroups()) { for (Group g : CONFIG.getGroups().getGroups()) {
@@ -276,10 +283,11 @@ public class CommandHandler implements CommandExecutor {
public void sendReport(CommandSender cs, Group group, int page) { public void sendReport(CommandSender cs, Group group, int page) {
List<User> users = USER_MANAGER.getUsersInGroup(group); List<User> users = USER_MANAGER.getUsersInGroup(group);
ChatColor color = group == null ? GREEN : group.getColor(); ChatColor color = group == null ? GREEN : group.getColor();
String groupName = group == null ? "Low" : group.getName();
int pages = (int) Math.ceil(((float) users.size()) / 7); int pages = (int) Math.ceil(((float) users.size()) / 7);
if (page <= pages && page > 0) { if (page <= pages && page > 0) {
cs.sendMessage("--------------------[" + GREEN + "REPORT[" + page + "/" + pages + "]" + WHITE + "]---------------------"); 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++) { for (int x = 0; x < 7; x++) {
int index = ((page - 1) * 6) + (x + ((page - 1) * 1)); int index = ((page - 1) * 6) + (x + ((page - 1) * 1));
if (index < users.size()) { if (index < users.size()) {
@@ -291,7 +299,7 @@ public class CommandHandler implements CommandExecutor {
} else { } else {
if (pages == 0) { if (pages == 0) {
cs.sendMessage("--------------------[" + GREEN + "REPORT[1/1]" + WHITE + "]---------------------"); 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(GRAY + "There are no users in this group.");
cs.sendMessage(MENU_END); cs.sendMessage(MENU_END);
} else { } else {
@@ -413,7 +421,7 @@ public class CommandHandler implements CommandExecutor {
} else if (args[0].equalsIgnoreCase("spy")) { } else if (args[0].equalsIgnoreCase("spy")) {
handleSpy(cs, args); handleSpy(cs, args);
} else if (args[0].equalsIgnoreCase("report")) { } 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); handleReport(cs, args);
} else { } else {
handlePlayerReport(cs, args); handlePlayerReport(cs, args);
@@ -38,7 +38,6 @@ public class ConfigurationFile {
private AntiCheat plugin; private AntiCheat plugin;
private boolean saveDefault; private boolean saveDefault;
private boolean didSaveDefault;
protected boolean needsReload; protected boolean needsReload;
@@ -69,7 +68,6 @@ public class ConfigurationFile {
if (!rawFile.exists()) { if (!rawFile.exists()) {
if (saveDefault) { if (saveDefault) {
plugin.saveResource(fileName, true); plugin.saveResource(fileName, true);
didSaveDefault = true;
} else { } else {
if (!rawFile.getParentFile().exists()) { if (!rawFile.getParentFile().exists()) {
rawFile.getParentFile().mkdir(); rawFile.getParentFile().mkdir();
+1 -1
View File
@@ -1,5 +1,5 @@
# AntiCheat configuration file # 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: xray:
# Should AntiCheat use calculations to try and find xrayers? # Should AntiCheat use calculations to try and find xrayers?
check-xray: true check-xray: true
+1 -1
View File
@@ -1,5 +1,5 @@
# AntiCheat configuration file # 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-specific settings
server: server:
# An identifiable name for this server # An identifiable name for this server
+1 -1
View File
@@ -1,5 +1,5 @@
# AntiCheat configuration file # 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: groups:
- 'Medium : 20 : YELLOW : WARN' - 'Medium : 20 : YELLOW : WARN'
- 'High : 50 : RED : KICK' - 'High : 50 : RED : KICK'
+1 -1
View File
@@ -1,5 +1,5 @@
# AntiCheat language file # 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: alert:
- '&player has just entered the &group hack group.' - '&player has just entered the &group hack group.'
- '&player''s last failed check was: &check.' - '&player''s last failed check was: &check.'
+1 -1
View File
@@ -1,6 +1,6 @@
# AntiCheat configuration file # AntiCheat configuration file
# Please report any bugs: http://dev.bukkit.org/server-mods/anticheat/ # 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_CHECK: 5
ANIMATION_MIN: 200 ANIMATION_MIN: 200
ANIMATION_TIMEMIN: 90 ANIMATION_TIMEMIN: 90
+1 -1
View File
@@ -1,5 +1,5 @@
# AntiCheat configuration file # 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: rules:
# if spider check is less than 0, set group to 20. otherwise, do nothing # if spider check is less than 0, set group to 20. otherwise, do nothing
- 'Check_SPIDER < 0 ? Player.KICK : null' - 'Check_SPIDER < 0 ? Player.KICK : null'