kiwec 1 mese fa
parent
commit
981797ba00

+ 1 - 1
src/App/Osu/Osu.cpp

@@ -65,7 +65,7 @@
 
 // release configuration
 ConVar auto_update("auto_update", true, FCVAR_NONE);
-ConVar osu_version("osu_version", 34.09f, FCVAR_NONE);
+ConVar osu_version("osu_version", 34.10f, FCVAR_NONE);
 
 #ifdef _DEBUG
 ConVar osu_debug("osu_debug", true, FCVAR_NONE);

+ 15 - 9
src/App/Osu/OsuChangelog.cpp

@@ -36,17 +36,23 @@ OsuChangelog::OsuChangelog(Osu *osu) : OsuScreenBackable(osu) {
     CHANGELOG latest;
     latest.title =
         UString::format("%.2f (%s, %s)", convar->getConVarByName("osu_version")->getFloat(), __DATE__, __TIME__);
-    latest.changes.push_back("- Added replay viewer");
-    latest.changes.push_back("- Added instant replay (press F1 while paused or after failing)");
-    latest.changes.push_back("- Added option to disable in-game scoreboard animations");
-    latest.changes.push_back("- Added start_first_main_menu_song_at_preview_point convar (it does what it says)");
-    latest.changes.push_back("- Added extra slot to in-game scoreboard");
-    latest.changes.push_back("- Fixed hitobjects being hittable after failing");
-    latest.changes.push_back("- Fixed login packet sending incorrect adapters list");
-    latest.changes.push_back("- Removed VR support");
-    latest.changes.push_back("- Updated protocol and database version to b20240411.1");
+    latest.changes.push_back("- Fixed replays not saving/submitting correctly");
+    latest.changes.push_back("- Fixed scores, collections and stars/pp cache not saving correctly");
     changelogs.push_back(latest);
 
+    CHANGELOG v34_09;
+    v34_09.title = "34.09 (2024-04-13)";
+    v34_09.changes.push_back("- Added replay viewer");
+    v34_09.changes.push_back("- Added instant replay (press F1 while paused or after failing)");
+    v34_09.changes.push_back("- Added option to disable in-game scoreboard animations");
+    v34_09.changes.push_back("- Added start_first_main_menu_song_at_preview_point convar (it does what it says)");
+    v34_09.changes.push_back("- Added extra slot to in-game scoreboard");
+    v34_09.changes.push_back("- Fixed hitobjects being hittable after failing");
+    v34_09.changes.push_back("- Fixed login packet sending incorrect adapters list");
+    v34_09.changes.push_back("- Removed VR support");
+    v34_09.changes.push_back("- Updated protocol and database version to b20240411.1");
+    changelogs.push_back(v34_09);
+
     CHANGELOG v34_08;
     v34_08.title = "34.08 (2024-03-30)";
     v34_08.changes.push_back("- Added animations for the in-game scoreboard");

+ 9 - 15
src/App/Osu/OsuDatabase.cpp

@@ -55,8 +55,6 @@ ConVar osu_database_stars_cache_enabled("osu_database_stars_cache_enabled", fals
 ConVar osu_scores_enabled("osu_scores_enabled", true, FCVAR_NONE);
 ConVar osu_scores_legacy_enabled("osu_scores_legacy_enabled", true, FCVAR_NONE, "load osu!'s scores.db");
 ConVar osu_scores_custom_enabled("osu_scores_custom_enabled", true, FCVAR_NONE, "load custom scores.db");
-ConVar osu_scores_custom_version("osu_scores_custom_version", 20210110, FCVAR_NONE,
-                                 "maximum supported custom scores.db version");
 ConVar osu_scores_save_immediately("osu_scores_save_immediately", true, FCVAR_NONE,
                                    "write scores.db as soon as a new score is added");
 ConVar osu_scores_sort_by_pp("osu_scores_sort_by_pp", true, FCVAR_NONE, "display pp in score browser instead of score");
@@ -108,7 +106,7 @@ bool save_db(Packet *db, std::string path) {
         return false;
     }
 
-    fwrite(&db->memory, db->pos, 1, dbfile);
+    fwrite(db->memory, db->pos, 1, dbfile);
     fclose(dbfile);
     return true;
 }
@@ -1792,12 +1790,11 @@ void OsuDatabase::loadScores() {
     m_scores.clear();
 
     // load custom scores
-    // NOTE: custom scores are loaded before legacy scores (because we want to be able to skip loading legacy scores
-    // which were already previously imported at some point)
+    // NOTE: custom scores are loaded before legacy scores because we want to be able to skip loading legacy scores
+    // which were already previously imported at some point
     int nb_mcosu_scores = 0;
     size_t customScoresFileSize = 0;
     if(osu_scores_custom_enabled.getBool()) {
-        const int maxSupportedCustomDbVersion = osu_scores_custom_version.getInt();
         const unsigned char hackIsImportedLegacyScoreFlag =
             0xA9;  // TODO: remove this once all builds on steam (even previous-version) have loading version cap logic
 
@@ -1805,11 +1802,11 @@ void OsuDatabase::loadScores() {
         if(db.size > 0) {
             customScoresFileSize = db.size;
 
-            const int dbVersion = read_int32(&db);
-            const int numBeatmaps = read_int32(&db);
-            debugLog("Custom scores: version = %i, numBeatmaps = %i\n", dbVersion, numBeatmaps);
+            const uint32_t dbVersion = read_int32(&db);
+            const uint32_t numBeatmaps = read_int32(&db);
+            debugLog("Custom scores: version = %u, numBeatmaps = %u\n", dbVersion, numBeatmaps);
 
-            if(dbVersion <= maxSupportedCustomDbVersion) {
+            if(dbVersion <= OsuScore::VERSION) {
                 for(int b = 0; b < numBeatmaps; b++) {
                     auto hash_str = read_stdstring(&db);
                     const int numScores = read_int32(&db);
@@ -2059,14 +2056,10 @@ void OsuDatabase::saveScores() {
     m_bDidScoresChangeForSave = false;
 
     if(m_scores.empty()) return;
-    const int dbVersion = osu_scores_custom_version.getInt();
     const unsigned char hackIsImportedLegacyScoreFlag =
         0xA9;  // TODO: remove this once all builds on steam (even previous-version) have loading version cap logic
 
     debugLog("Osu: Saving scores ...\n");
-
-    Packet db;
-
     const double startTime = engine->getTimeReal();
 
     // count number of beatmaps with valid scores
@@ -2081,7 +2074,8 @@ void OsuDatabase::saveScores() {
     }
 
     // write header
-    write_int32(&db, dbVersion);
+    Packet db;
+    write_int32(&db, OsuScore::VERSION);
     write_int32(&db, numBeatmaps);
 
     // write scores for each beatmap

+ 1 - 1
src/App/Osu/OsuMainMenu.cpp

@@ -309,7 +309,7 @@ OsuMainMenu::OsuMainMenu(Osu *osu) : OsuScreen(osu) {
     m_versionButton = new CBaseUIButton(0, 0, 0, 0, "", "");
     UString versionString = MCOSU_VERSION_TEXT;
     versionString.append(" ");
-    versionString.append(UString::format("%g", Osu::version->getFloat()));
+    versionString.append(UString::format("%.2f", Osu::version->getFloat()));
     m_versionButton->setText(versionString);
     m_versionButton->setDrawBackground(false);
     m_versionButton->setDrawFrame(false);

+ 1 - 1
src/App/Osu/OsuReplay.cpp

@@ -108,7 +108,7 @@ void OsuReplay::compress_frames(const std::vector<OsuReplay::Frame>& frames, uin
 
     std::string replay_string;
     for(auto frame : frames) {
-        auto frame_str = UString::format("%ld|%.4f|%.4f|%hhu,", frame.milliseconds_since_last_frame, frame.x, frame.y,
+        auto frame_str = UString::format("%lld|%.4f|%.4f|%hhu,", frame.milliseconds_since_last_frame, frame.x, frame.y,
                                          frame.key_flags);
         replay_string.append(frame_str.toUtf8(), frame_str.lengthUtf8());
     }

+ 1 - 1
src/App/Osu/OsuScore.h

@@ -18,7 +18,7 @@ class OsuHitObject;
 
 class OsuScore {
    public:
-    static constexpr const int VERSION = 20240412;
+    static const uint32_t VERSION = 20240412;
 
     enum class HIT {
         // score

+ 1 - 1
src/App/Osu/Score.h

@@ -22,7 +22,7 @@ struct Score {
     bool isImportedLegacyScore;  // used for identifying imported osu! scores (which were previously legacy scores,
                                  // so they don't have any
                                  // numSliderBreaks/unstableRate/hitErrorAvgMin/hitErrorAvgMax)
-    int version;
+    uint32_t version;
     uint64_t unixTimestamp;
 
     uint32_t player_id = 0;