Follow-up to #99.

- Many code style changes.
- Don't increment combo if missing the last slider circle.
- Added player name in ranking screen.
- Don't show null/default player names.
- Only import replays with .osr extension.
- Display loading status for importing replays.
- Moved MD5InputStreamWrapper to package "opsu.io".

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-06-29 19:22:38 -05:00
parent 7d08a7d391
commit d860a30aed
29 changed files with 513 additions and 426 deletions

View File

@@ -122,7 +122,7 @@ public class BeatmapDB {
"bpmMin INTEGER, bpmMax INTEGER, endTime INTEGER, " +
"audioFile TEXT, audioLeadIn INTEGER, previewTime INTEGER, countdown INTEGER, sampleSet TEXT, stackLeniency REAL, " +
"mode INTEGER, letterboxInBreaks BOOLEAN, widescreenStoryboard BOOLEAN, epilepsyWarning BOOLEAN, " +
"bg TEXT, sliderBorder TEXT, timingPoints TEXT, breaks TEXT, combo TEXT," +
"bg TEXT, sliderBorder TEXT, timingPoints TEXT, breaks TEXT, combo TEXT, " +
"md5hash TEXT" +
"); " +
"CREATE TABLE IF NOT EXISTS info (" +
@@ -483,7 +483,7 @@ public class BeatmapDB {
if (bg != null)
beatmap.bg = new File(dir, BeatmapParser.getDBString(bg));
beatmap.sliderBorderFromString(rs.getString(37));
beatmap.md5Hash = BeatmapParser.getDBString(rs.getString(41));
beatmap.md5Hash = rs.getString(41);
} catch (SQLException e) {
throw e;
} catch (Exception e) {

View File

@@ -97,12 +97,9 @@ public class ScoreDB {
// prepare sql statements
try {
//TODO timestamp as primary key should prevent importing the same replay multiple times
//but if for some magical reason two different replays has the same time stamp
//it will fail, such as copying replays from another drive? which will reset
//the last modified of the file.
insertStmt = connection.prepareStatement(
// TODO: There will be problems if multiple replays have the same
// timestamp (e.g. when imported) due to timestamp being the primary key.
"INSERT OR IGNORE INTO scores VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
);
selectMapStmt = connection.prepareStatement(
@@ -145,7 +142,7 @@ public class ScoreDB {
"combo INTEGER, " +
"perfect BOOLEAN, " +
"mods INTEGER, " +
"replay TEXT," +
"replay TEXT, " +
"playerName TEXT"+
");" +
"CREATE TABLE IF NOT EXISTS info (" +
@@ -294,7 +291,6 @@ public class ScoreDB {
stmt.setInt(17, data.mods);
stmt.setString(18, data.replayString);
stmt.setString(19, data.playerName);
}
/**