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
+30 -23

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
/target/
/.*
*.iml
*.properties
+5 -5
View File
@@ -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 [email protected]: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```
@@ -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<User> 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);
@@ -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();
+2 -2
View File
@@ -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
- example-world-2
+2 -2
View File
@@ -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
rules: true
+2 -2
View File
@@ -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]'
- 'Custom : -1 : GREEN : COMMAND[ban &player;say hello world]'
+1 -1
View File
@@ -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.'
+2 -2
View File
@@ -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
VERSION: 0.3
+2 -2
View File
@@ -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'
- 'Check_SPIDER < 0 ? Player.KICK : null'