Skip to content

Commit

Permalink
Attempt to fix uploaded score flagging
Browse files Browse the repository at this point in the history
  • Loading branch information
nico-abram committed Jul 23, 2018
1 parent d6742c2 commit f3a568b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/DownloadManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -684,14 +684,18 @@ void DownloadManager::UploadScore(HighScore* hs)
auto errors = j["errors"];
bool delay = false;
for (auto error : errors) {
if (error["status"] == 22) {
int status = error["status"];
if (status == 22) {
delay = true;
DLMAN->StartSession(DLMAN->sessionUser, DLMAN->sessionPass, [hs](bool logged) {
if (logged) {
DLMAN->UploadScore(hs);
}
});
}
else if (status == 404 || status == 405 || status == 406) {
hs->AddUploadedServer(serverURL.Get());
}
}
if (!delay && j["data"]["type"] == "ssrResults") {
hs->AddUploadedServer(serverURL.Get());
Expand Down Expand Up @@ -747,14 +751,18 @@ void DownloadManager::UploadScoreWithReplayData(HighScore* hs)
try {
auto errors = j["errors"];
for (auto error : errors) {
if (error["status"] == 22) {
int status = error["status"];
if (status == 22) {
delay = true;
DLMAN->StartSession(DLMAN->sessionUser, DLMAN->sessionPass, [hs](bool logged) {
if (logged) {
DLMAN->UploadScoreWithReplayData(hs);
DLMAN->UploadScore(hs);
}
});
}
else if (status == 404 || status == 405 || status == 406) {
hs->AddUploadedServer(serverURL.Get());
}
}
}
catch (exception e) {}
Expand Down

0 comments on commit f3a568b

Please sign in to comment.