From c1fa7d76e01cfbf7683b2e1f8da31a1fafa7fdbe Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Sat, 31 Mar 2012 06:01:13 +0000 Subject: [PATCH] League ordering and extra league information. --- .../src/main/java/com/gempukku/lotro/db/LeagueDAO.java | 8 ++++---- .../java/com/gempukku/lotro/league/LeagueService.java | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/db/LeagueDAO.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/db/LeagueDAO.java index 640758584..344a4384a 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/db/LeagueDAO.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/db/LeagueDAO.java @@ -8,8 +8,8 @@ import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; -import java.util.HashSet; -import java.util.Set; +import java.util.ArrayList; +import java.util.List; public class LeagueDAO { private DbAccess _dbAccess; @@ -46,7 +46,7 @@ public class LeagueDAO { } } - public Set loadActiveLeagues(int currentTime) throws SQLException, IOException { + public List loadActiveLeagues(int currentTime) throws SQLException, IOException { Connection conn = _dbAccess.getDataSource().getConnection(); try { PreparedStatement statement = conn.prepareStatement("select id, name, type, class, parameters, start, end, status from league where start<=? and end>=? order by start desc"); @@ -55,7 +55,7 @@ public class LeagueDAO { statement.setInt(2, currentTime); ResultSet rs = statement.executeQuery(); try { - Set activeLeagues = new HashSet(); + List activeLeagues = new ArrayList(); while (rs.next()) { int id = rs.getInt(1); String name = rs.getString(2); diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/league/LeagueService.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/league/LeagueService.java index 8cf2cddd0..804f114de 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/league/LeagueService.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/league/LeagueService.java @@ -34,7 +34,7 @@ public class LeagueService { private Map> _leagueSerieStandings = new ConcurrentHashMap>(); private int _activeLeaguesLoadedDate; - private Set _activeLeagues; + private List _activeLeagues; public LeagueService(LeagueDAO leagueDao, LeaguePointsDAO leaguePointsDao, LeagueMatchDAO leagueMatchDao, CollectionsManager collectionsManager) { @@ -65,12 +65,12 @@ public class LeagueService { } } - public Set getActiveLeagues() { + public List getActiveLeagues() { if (DateUtils.getCurrentDate() == _activeLeaguesLoadedDate) - return Collections.unmodifiableSet(_activeLeagues); + return Collections.unmodifiableList(_activeLeagues); else { ensureLoadedCurrentLeagues(); - return Collections.unmodifiableSet(_activeLeagues); + return Collections.unmodifiableList(_activeLeagues); } }