Skip to content

Commit

Permalink
replayupdater fixes maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Dec 1, 2018
1 parent e67ecf1 commit 9fd9726
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/DownloadManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1150,12 +1150,13 @@ DownloadManager::UpdateOnlineScoreReplayData(string& sk,

auto hs = SCOREMAN->GetScoresByKey().at(sk);
CURL* curlHandle = initCURLHandle(true);
string url = serverURL.Get() + "/updatereplaydata/" + sk;
string url = serverURL.Get() + "/updatereplaydata/";
curl_httppost* form = nullptr;
curl_httppost* lastPtr = nullptr;
SetCURLFormPostField(
curlHandle, form, lastPtr, "scorekey", hs->GetScoreKey());
string toSend = "[";
hs->LoadReplayData();
auto& rows = hs->GetNoteRowVector();
for (auto& row : rows) {
toSend += to_string(row) + ",";
Expand Down Expand Up @@ -1889,8 +1890,11 @@ DownloadManager::OnLogin()
DLMAN->RefreshCountryCodes();
FOREACH_ENUM(Skillset, ss)
DLMAN->RefreshTop25(ss);
if (DLMAN->ShouldUploadScores())
if (DLMAN->ShouldUploadScores()) {
DLMAN->UploadScores();
DLMAN->UpdateOnlineScoreReplayData();
}
DLMAN->UpdateOnlineScoreReplayData();
if (GAMESTATE->m_pCurSteps[PLAYER_1] != nullptr)
DLMAN->RequestChartLeaderBoard(
GAMESTATE->m_pCurSteps[PLAYER_1]->GetChartKey());
Expand Down Expand Up @@ -1980,8 +1984,7 @@ DownloadManager::UpdateOnlineScoreReplayData()
for (auto& vec : scores) {
for (auto& scorePtr : vec) {
auto ts = scorePtr->GetTopScore();
if ((ts == 1 || ts == 2) &&
!scorePtr->IsUploadedToServer(serverURL.Get())) {
if ((ts == 1 || ts == 2) ){
if (scorePtr->HasReplayData())
toUpload.emplace_back(scorePtr);
}
Expand Down

0 comments on commit 9fd9726

Please sign in to comment.