Misc. bugfixes

This commit is contained in:
Matteo Signer
2016-04-04 10:59:50 +02:00
parent 4b76d2c3cf
commit d7c980e0a4
3 changed files with 17 additions and 3 deletions

View File

@@ -304,6 +304,16 @@ public class ScoreDB {
* @return all scores for the beatmap, or null if any error occurred
*/
public static ScoreData[] getMapScores(Beatmap beatmap) {
return getMapScores(beatmap, null);
}
/**
* Retrieves the game scores for a beatmap while excluding a score.
* @param beatmap the beatmap
* @param exclude the filename of the score to exclude
* @return all scores for the beatmap except for exclude, or null if any error occurred
*/
public static ScoreData[] getMapScores(Beatmap beatmap, String exclude) {
if (connection == null)
return null;
@@ -317,7 +327,11 @@ public class ScoreDB {
ResultSet rs = selectMapStmt.executeQuery();
while (rs.next()) {
ScoreData s = new ScoreData(rs);
list.add(s);
if (s.replayString != null && s.replayString.equals(exclude)) {
// dont return this score
} else {
list.add(s);
}
}
rs.close();
} catch (SQLException e) {
@@ -326,7 +340,6 @@ public class ScoreDB {
}
return getSortedArray(list);
}
/**
* Retrieves the game scores for a beatmap set.
* @param beatmap the beatmap