From 21d4393abbea29d5ebd7b55103ef893dd05790d3 Mon Sep 17 00:00:00 2001 From: "born a rick, raised a morty, died a jerry" Date: Fri, 30 Nov 2018 04:24:01 -0500 Subject: [PATCH] make newly uploaded replays awesome --- src/DownloadManager.cpp | 11 +++++++++-- src/ScreenSelectMusic.cpp | 11 ++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/DownloadManager.cpp b/src/DownloadManager.cpp index 4930f7a8cc..f518f9e697 100644 --- a/src/DownloadManager.cpp +++ b/src/DownloadManager.cpp @@ -1410,6 +1410,7 @@ DownloadManager::RequestReplayData(string scoreid, vector timestamps; vector offsets; vector tracks; + vector rows; vector types; auto j = json::parse(req.result); @@ -1423,12 +1424,17 @@ DownloadManager::RequestReplayData(string scoreid, timestamps.emplace_back(note[0].get()); offsets.emplace_back(note[1].get() / 1000.f); - - if (note.size() > 2) { + if (note.size() == 3) { // pre-0.6 with noterows + rows.emplace_back(note[2].get()); + } + if (note.size() > 3) { // 0.6 without noterows tracks.emplace_back(note[2].get()); types.emplace_back( static_cast(note[3].get())); } + if (note.size() == 5) { // 0.6 with noterows + rows.emplace_back(note[4].get()); + } } auto& lbd = DLMAN->chartLeaderboards[chartkey]; auto it = find_if( @@ -1440,6 +1446,7 @@ DownloadManager::RequestReplayData(string scoreid, it->hs.SetOffsetVector(offsets); it->hs.SetTrackVector(tracks); it->hs.SetTapNoteTypeVector(types); + it->hs.SetNoteRowVector(rows); if (tracks.empty()) it->hs.SetReplayType(1); diff --git a/src/ScreenSelectMusic.cpp b/src/ScreenSelectMusic.cpp index 61117015cd..a106a26c96 100644 --- a/src/ScreenSelectMusic.cpp +++ b/src/ScreenSelectMusic.cpp @@ -1705,8 +1705,11 @@ class LunaScreenSelectMusic : public Luna // from the existing, if the score was cc off then we need to fill in // extra rows for each tap in the chord -mina auto timestamps = hs->GetCopyOfSetOnlineReplayTimestampVector(); + auto noterows = hs->GetNoteRowVector(); auto REEEEEEEEEEEEEE = hs->GetOffsetVector(); - if (!timestamps.empty()) { + if (!timestamps.empty() && + noterows.empty()) { // if we have noterows from newer uploads, just + // use them -mina GAMESTATE->SetProcessedTimingData( GAMESTATE->m_pCurSteps[PLAYER_1]->GetTimingData()); auto* td = GAMESTATE->m_pCurSteps[PLAYER_1]->GetTimingData(); @@ -1740,9 +1743,11 @@ class LunaScreenSelectMusic : public Luna GAMESTATE->SetProcessedTimingData(nullptr); // hs->SetNoteRowVector(ihatemylife); hs->SetNoteRowVector(noterows); + } - // Since we keep misses on EO as 180ms, we need to convert them - // back. + // Since we keep misses on EO as 180ms, we need to convert them + // back. + if (!timestamps.empty()) { auto offsets = hs->GetCopyOfOffsetVector(); for (auto& offset : offsets) { if (fabs(offset) >= .18f)