Only at least 5 minutes games are counted for statistics.

This commit is contained in:
marcins78@gmail.com
2011-12-07 22:28:00 +00:00
parent cbb7ccfca8
commit 5b5bcedfc7

View File

@@ -124,7 +124,9 @@ public class GameHistoryDAO {
try { try {
Connection connection = _dbAccess.getDataSource().getConnection(); Connection connection = _dbAccess.getDataSource().getConnection();
try { try {
PreparedStatement statement = connection.prepareStatement("select count(*) from game_history where end_date>=?"); // 5 minutes minimum game
long minTime = 1000 * 60 * 5;
PreparedStatement statement = connection.prepareStatement("select count(*) from game_history where end_date>=? and end_date-start_date>" + minTime);
try { try {
statement.setLong(1, System.currentTimeMillis() - ms); statement.setLong(1, System.currentTimeMillis() - ms);
ResultSet rs = statement.executeQuery(); ResultSet rs = statement.executeQuery();