Update bStats-Metrics

This commit is contained in:
md678685 2018-12-06 17:49:08 +00:00
parent 6ecdc8d7fc
commit 6ee84510ea
3 changed files with 189 additions and 574 deletions

View File

@ -264,7 +264,7 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
addDefaultBackPermissionsToWorld(w);
metrics = new Metrics(this);
if (!metrics.isOptOut()) {
if (metrics.isEnabled()) {
getLogger().info("Starting Metrics. Opt-out using the global bStats config.");
} else {
getLogger().info("Metrics disabled per bStats config.");

View File

@ -64,8 +64,6 @@ public class Commandessentials extends EssentialsCommand {
run_moo(server, sender, commandLabel, args);
} else if (args[0].equalsIgnoreCase("reset")) {
run_reset(server, sender, commandLabel, args);
} else if (args[0].equalsIgnoreCase("opt-out")) {
run_optout(server, sender, commandLabel, args);
} else if (args[0].equalsIgnoreCase("cleanup")) {
run_cleanup(server, sender, commandLabel, args);
} else if (args[0].equalsIgnoreCase("uuidconvert")) {
@ -206,19 +204,6 @@ public class Commandessentials extends EssentialsCommand {
}
}
private void run_optout(final Server server, final CommandSource sender, final String command, final String args[]) {
final Metrics metrics = ess.getMetrics();
sender.sendMessage("Essentials collects simple metrics to highlight which features to concentrate work on in the future.");
if (metrics.isOptOut()) {
metrics.enable();
} else {
metrics.disable();
}
sender.sendMessage("Anonymous Metrics are now " + (metrics.isOptOut() ? "disabled" : "enabled") + " for EssentialsX until server restart.");
sender.sendMessage("To " + (metrics.isOptOut() ? "disable" : "enable") + " them for all plugins permanently, see the bStats config.");
}
private void run_cleanup(final Server server, final CommandSource sender, final String command, final String args[]) throws Exception {
if (args.length < 2 || !NumberUtil.isInt(args[1])) {
sender.sendMessage("This sub-command will delete users who havent logged in in the last <days> days.");
@ -394,7 +379,6 @@ public class Commandessentials extends EssentialsCommand {
//options.add("nya");
//options.add("moo");
options.add("reset");
options.add("opt-out");
options.add("cleanup");
//options.add("uuidconvert");
//options.add("uuidtest");
@ -412,8 +396,6 @@ public class Commandessentials extends EssentialsCommand {
if (args.length == 2) {
return getPlayers(server, sender);
}
} else if (args[0].equalsIgnoreCase("opt-out")) {
// No args
} else if (args[0].equalsIgnoreCase("cleanup")) {
if (args.length == 2) {
return COMMON_DURATIONS;

File diff suppressed because it is too large Load Diff