Skip to content

Commit

Permalink
adjust screeening logic in requestchartleaderboards
Browse files Browse the repository at this point in the history
players should only register as having a score submitted at the end of the screening process when they are ensured an actual score
  • Loading branch information
MinaciousGrace committed Jul 17, 2018
1 parent 2394f91 commit 13d704c
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/DownloadManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -891,14 +891,7 @@ void DownloadManager::RequestChartLeaderBoard(string chartkey)
auto user = *(score.find("user"));
tmp.username = user.value("userName", "").c_str();
tmp.avatar = user.value("avatar", "").c_str();
tmp.userid = user.value("userId", 0);

// it seems prudent to maintain the eo functionality in this way and screen out multiple scores from the same user -mina
if (userswithscores.count(tmp.username) == 1)
continue;

userswithscores.emplace(tmp.username);

tmp.userid = user.value("userId", 0);
tmp.playerRating = static_cast<float>(user.value("playerRating", 0.0));
tmp.wife = static_cast<float>(score.value("wife", 0.0)/100.0);
tmp.modifiers = score.value("modifiers", "").c_str();
Expand Down Expand Up @@ -944,6 +937,14 @@ void DownloadManager::RequestChartLeaderBoard(string chartkey)
// screen out old 11111 flags (my greatest mistake) and it's probably a safe bet to throw out below 25% scores -mina
if (tmp.wife > 1.f || tmp.wife < 0.25f || !tmp.valid)
continue;

// it seems prudent to maintain the eo functionality in this way and screen out multiple scores from the same user
// even more prudent would be to put this last where it belongs, we don't want to screen out scores for players who wouldn't
// have had them registered in the first place -mina
if (userswithscores.count(tmp.username) == 1)
continue;

userswithscores.emplace(tmp.username);
vec.emplace_back(tmp);
}
}
Expand Down

0 comments on commit 13d704c

Please sign in to comment.