Added count for started tournaments.

This commit is contained in:
LevelX2 2013-06-29 22:27:58 +02:00
parent df07c5ba84
commit ccc107f7ef
2 changed files with 13 additions and 0 deletions

View file

@ -396,6 +396,7 @@ public class TableController {
User user = UserManager.getInstance().getUser(entry.getKey());
user.tournamentStarted(tournament.getId(), entry.getValue());
}
ServerMessagesUtil.getInstance().incTournamentsStarted();
}
}
catch (Exception ex) {

View file

@ -65,6 +65,7 @@ public class ServerMessagesUtil {
private static long startDate;
private static AtomicInteger gamesStarted = new AtomicInteger(0);
private static AtomicInteger tournamentsStarted = new AtomicInteger(0);
static {
pathToExternalMessages = System.getProperty("messagesPath");
@ -170,6 +171,8 @@ public class ServerMessagesUtil {
statistics.append(hours);
statistics.append(" hour(s), games played: ");
statistics.append(gamesStarted.get());
statistics.append(" tournaments started: ");
statistics.append(tournamentsStarted.get());
return statistics.toString();
}
@ -189,4 +192,13 @@ public class ServerMessagesUtil {
value = gamesStarted.get();
} while (!gamesStarted.compareAndSet(value, value + 1));
}
public void incTournamentsStarted() {
int value;
do {
value = tournamentsStarted.get();
} while (!tournamentsStarted.compareAndSet(value, value + 1));
}
}