mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Added count for started tournaments.
This commit is contained in:
parent
df07c5ba84
commit
ccc107f7ef
2 changed files with 13 additions and 0 deletions
|
@ -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) {
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue