Difference between revisions of "Thread:Talk:RoboRumble/Client java version/reply (46)"
Jump to navigation
Jump to search
m (Reply to Client java version) |
m |
||
Line 1: | Line 1: | ||
− | + | According to the code, it shouldn't be harmful. It's just to make sure the client has the JAR, and to prevent duplicates. | |
− | < | + | <syntaxhighlight lang="java"> |
− | + | // Check that competitors exist | |
− | + | String jar1 = items[0].replace(' ', '_') + ".jar"; | |
− | + | boolean exists1 = (new File(botsrepository + jar1)).exists() && namesAll.contains(items[0]); | |
− | + | String jar2 = items[1].replace(' ', '_') + ".jar"; | |
− | + | boolean exists2 = (new File(botsrepository + jar2)).exists() && namesAll.contains(items[1]); | |
− | + | ||
− | + | // Add battles to priority battles list | |
− | + | if (exists1 && exists2 && !priorityBattles.contains(record)) { | |
− | + | priorityBattles.add(record); | |
− | </ | + | } else { |
+ | System.out.println("Ignoring: " + record); | ||
+ | } | ||
+ | </syntaxhighlight> |
Latest revision as of 17:34, 6 September 2017
According to the code, it shouldn't be harmful. It's just to make sure the client has the JAR, and to prevent duplicates.
// Check that competitors exist
String jar1 = items[0].replace(' ', '_') + ".jar";
boolean exists1 = (new File(botsrepository + jar1)).exists() && namesAll.contains(items[0]);
String jar2 = items[1].replace(' ', '_') + ".jar";
boolean exists2 = (new File(botsrepository + jar2)).exists() && namesAll.contains(items[1]);
// Add battles to priority battles list
if (exists1 && exists2 && !priorityBattles.contains(record)) {
priorityBattles.add(record);
} else {
System.out.println("Ignoring: " + record);
}