System.out.println("Iteration number " + iterations);
// Download data from Internet if downloads is YES and it has not been download for two hours
if (downloads.equals("YES")) {
BotsDownload download = new BotsDownload(parameters);
if (runonly.equals("SERVER")) {
// Download rating files and update ratings downloaded
System.out.println("Downloading rating files ...");
ratingsdownloaded = download.downloadRatings();
}
if ((System.currentTimeMillis() - lastdownload) > 2 * 3600 * 1000) {
System.out.println("Downloading participants list ...");
participantsdownloaded = download.downloadParticipantsList();
System.out.println("Downloading missing bots ...");
download.downloadMissingBots();
download.updateCodeSize();
// Send the order to the server to remove old participants from the ratings file
if (ratingsdownloaded && participantsdownloaded) {
System.out.println("Removing old participants from server ...");
// Send unwanted participants to the server
download.notifyServerForOldParticipants();
}
lastdownload = System.currentTimeMillis();
}
}