Fixed space returning every result and commented stuff

Analysis attempt commented
Fixed search displaying everything with -p argument.
This commit is contained in:
Rsl1122 2016-12-15 21:48:41 +02:00
parent 5756c21e5b
commit 9375797ca8
3 changed files with 27 additions and 28 deletions

View File

@ -71,9 +71,9 @@ public class SearchCommand extends SubCommand {
//header
sender.sendMessage(textColor + "-- [" + operatorColor + "PLAN - Search results: took " + DataFormatUtils.formatTimeAmountSinceDate(refreshDate, new Date()) + textColor + "] --");
sender.sendMessage(operatorColor + "Results for: " + Arrays.toString(args));
for (String playerName : dataLists.keySet()) {
sender.sendMessage(textColor + "Results for: " + playerName);
sender.sendMessage(textColor + "Matching player: " + playerName);
for (String[] dataString : dataLists.get(playerName)) {
sender.sendMessage("" + operatorColor + dataString[0].charAt(4) + dataString[0].toLowerCase().substring(5) + ": " + textColor + dataString[1]);
}

View File

@ -63,27 +63,27 @@ public class Analysis {
timeKeys.addAll(Arrays.asList(timeValues));
// Attempt to determine if undefined data is usable
List<String> unusedKeys = new ArrayList<>();
unusedKeys.addAll(playerDataLists.keySet());
unusedKeys.removeAll(numberKeys);
unusedKeys.removeAll(boolKeys);
unusedKeys.removeAll(timeKeys);
unusedKeys.removeAll(ignoreKeys);
for (String key : unusedKeys) {
try {
Double.parseDouble(playerDataLists.get(key).get(0));
numberKeys.add(key);
continue;
} catch (Exception e) {
}
try {
Boolean.parseBoolean(playerDataLists.get(key).get(0));
boolKeys.add(key);
} catch (Exception e) {
}
}
// List<String> unusedKeys = new ArrayList<>();
// unusedKeys.addAll(playerDataLists.keySet());
// unusedKeys.removeAll(numberKeys);
// unusedKeys.removeAll(boolKeys);
// unusedKeys.removeAll(timeKeys);
// unusedKeys.removeAll(ignoreKeys);
// for (String key : unusedKeys) {
// try {
// Double.parseDouble(playerDataLists.get(key).get(0));
// numberKeys.add(key);
// continue;
// } catch (Exception e) {
//
// }
// try {
// Boolean.parseBoolean(playerDataLists.get(key).get(0));
// boolKeys.add(key);
// } catch (Exception e) {
//
// }
// }
HashMap<String, String> averagesAndPercents = new HashMap<>();
int errors = 0;

View File

@ -168,11 +168,6 @@ public class DataFormatUtils {
String[] returnArray = new String[args.length];
argloop:
for (int i = 0; i < args.length; i++) {
if (args[i].equals("-p")) {
args[0] = "";
returnArray[0] = "";
returnArray[i] = "";
}
for (String s : aac) {
if (args[i].toLowerCase().contains(s)) {
returnArray[i] = "AAC";
@ -204,6 +199,10 @@ public class DataFormatUtils {
}
}
returnArray[i] = args[i];
if (args[i].equals("-p")) {
returnArray[0] = args[0]+"_(Playername)";
returnArray[i] = "---";
}
}
return returnArray;
}