From 757d4319235ab5f4ca33a85c72c25a49bdbb877c Mon Sep 17 00:00:00 2001 From: "born a rick, raised a morty, died a jerry" Date: Thu, 29 Nov 2018 07:56:50 -0500 Subject: [PATCH 1/2] the gnat and the bat had a flat chat with a rat on a mat --- Themes/_fallback/BGAnimations/ScreenChatOverlay overlay.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Themes/_fallback/BGAnimations/ScreenChatOverlay overlay.lua b/Themes/_fallback/BGAnimations/ScreenChatOverlay overlay.lua index e07c90f001..8eeda3f3eb 100644 --- a/Themes/_fallback/BGAnimations/ScreenChatOverlay overlay.lua +++ b/Themes/_fallback/BGAnimations/ScreenChatOverlay overlay.lua @@ -2,7 +2,7 @@ local lastx, lasty = 0, 0 local width, height = SCREEN_WIDTH, SCREEN_HEIGHT * 0.035 local maxlines = 5 local lineNumber = 5 -local inputLineNumber = 1 +local inputLineNumber = 2 local tabHeight = 1 local maxTabs = 10 local x, y = 0, SCREEN_HEIGHT - height * (lineNumber + inputLineNumber + tabHeight) From bab7a020313822b78a89eda4dc3e470b404ad160 Mon Sep 17 00:00:00 2001 From: "born a rick, raised a morty, died a jerry" Date: Thu, 29 Nov 2018 07:57:51 -0500 Subject: [PATCH 2/2] du du du du du baby fart --- .../BGAnimations/superscoreboard.lua | 14 ++-- src/DownloadManager.cpp | 79 +++++++++++-------- 2 files changed, 52 insertions(+), 41 deletions(-) diff --git a/Themes/Til Death/BGAnimations/superscoreboard.lua b/Themes/Til Death/BGAnimations/superscoreboard.lua index d73ea5fde5..ca384f47fc 100644 --- a/Themes/Til Death/BGAnimations/superscoreboard.lua +++ b/Themes/Til Death/BGAnimations/superscoreboard.lua @@ -461,15 +461,11 @@ local function makeScoreDisplay(i) end end, DisplayCommand = function(self) - DLMAN:RequestOnlineScoreReplayData(hs, - function(replay) - if #replay > 0 then - self:settext("Watch") - else - self:settext("") - end - end - ) + if DLMAN:Fart(GAMESTATE:GetCurrentSteps(PLAYER_1):GetChartKey(), ind + i) then + self:settext("Watch") + else + self:settext("") + end end, HighlightCommand = function(self) highlightIfOver(self) diff --git a/src/DownloadManager.cpp b/src/DownloadManager.cpp index df6834e448..fbaba985b8 100644 --- a/src/DownloadManager.cpp +++ b/src/DownloadManager.cpp @@ -1422,9 +1422,12 @@ DownloadManager::RequestReplayData(string scoreid, timestamps.emplace_back(note[0].get()); offsets.emplace_back(note[1].get() / 1000.f); - tracks.emplace_back(note[2].get()); - types.emplace_back( - static_cast(note[3].get())); + + if (note.size() > 2) { + tracks.emplace_back(note[2].get()); + types.emplace_back( + static_cast(note[3].get())); + } } auto& lbd = DLMAN->chartLeaderboards[chartkey]; auto it = find_if( @@ -1436,6 +1439,11 @@ DownloadManager::RequestReplayData(string scoreid, it->hs.SetOffsetVector(offsets); it->hs.SetTrackVector(tracks); it->hs.SetTapNoteTypeVector(types); + + if (tracks.empty()) + it->hs.SetReplayType(1); + else + it->hs.SetReplayType(2); } auto L = LUA->Get(); callback.PushSelf(L); @@ -1866,38 +1874,39 @@ DownloadManager::StartSession(string user, HTTPRequests.push_back(req); } -void uploadSequentially(deque toUpload) -{ - auto it = toUpload.begin(); - if (it != toUpload.end()) { - toUpload.pop_front(); - auto& hs = (*it); - DLMAN->UploadScoreWithReplayDataFromDisk( - hs->GetScoreKey(), [hs, toUpload]() { - hs->AddUploadedServer(serverURL.Get()); - uploadSequentially(toUpload); - }); - } - return; +void +uploadSequentially(deque toUpload) +{ + auto it = toUpload.begin(); + if (it != toUpload.end()) { + toUpload.pop_front(); + auto& hs = (*it); + DLMAN->UploadScoreWithReplayDataFromDisk( + hs->GetScoreKey(), [hs, toUpload]() { + hs->AddUploadedServer(serverURL.Get()); + uploadSequentially(toUpload); + }); + } + return; } bool DownloadManager::UploadScores() { - if (!LoggedIn()) - return false; - auto scores = SCOREMAN->GetAllPBPtrs(); - deque toUpload; - for (auto& vec : scores) { - for (auto& scorePtr : vec) { - auto ts = scorePtr->GetTopScore(); - if ((ts == 1 || ts == 2) && - !scorePtr->IsUploadedToServer(serverURL.Get())) { - toUpload.emplace_back(scorePtr); - } - } - } - uploadSequentially(toUpload); - return true; + if (!LoggedIn()) + return false; + auto scores = SCOREMAN->GetAllPBPtrs(); + deque toUpload; + for (auto& vec : scores) { + for (auto& scorePtr : vec) { + auto ts = scorePtr->GetTopScore(); + if ((ts == 1 || ts == 2) && + !scorePtr->IsUploadedToServer(serverURL.Get())) { + toUpload.emplace_back(scorePtr); + } + } + } + uploadSequentially(toUpload); + return true; } int @@ -2420,9 +2429,14 @@ class LunaDownloadManager : public Luna static int SendReplayDataForOldScore(T* p, lua_State* L) { DLMAN->UploadScoreWithReplayDataFromDisk(SArg(1)); + return 0; + } + static int Fart(T* p, lua_State* L) + { + lua_pushboolean( + L, DLMAN->chartLeaderboards[SArg(1)][IArg(2) - 1].hasReplay); return 1; } - LunaDownloadManager() { ADD_METHOD(GetCountryCodes); @@ -2456,6 +2470,7 @@ class LunaDownloadManager : public Luna ADD_METHOD(ToggleTopScoresOnlyFilter); ADD_METHOD(GetTopScoresOnlyFilter); ADD_METHOD(SendReplayDataForOldScore); + ADD_METHOD(Fart); ADD_METHOD(Logout); } };