Skip to content

Commit 2962754

Browse files
committed
Perform float calculation client side and add required parameters for validation.
1 parent 7da5f4a commit 2962754

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/DownloadManager.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ bool DownloadManager::ShouldUploadScores()
576576
inline void SetCURLPOSTScore(CURL*& curlHandle, curl_httppost*& form, curl_httppost*& lastPtr, HighScore*& hs)
577577
{
578578
SetCURLFormPostField(curlHandle, form, lastPtr, "scorekey", hs->GetScoreKey());
579-
SetCURLFormPostField(curlHandle, form, lastPtr, "ssr_norm", hs->GetSSRNormPercent());
579+
SetCURLFormPostField(curlHandle, form, lastPtr, "ssr_norm", to_string(static_cast<int>(hs->GetSSRNormPercent() * 1000.f)));
580580
SetCURLFormPostField(curlHandle, form, lastPtr, "max_combo", hs->GetMaxCombo());
581581
SetCURLFormPostField(curlHandle, form, lastPtr, "valid", static_cast<int>(hs->GetEtternaValid()));
582582
SetCURLFormPostField(curlHandle, form, lastPtr, "mods", hs->GetModifiers());
@@ -592,16 +592,16 @@ inline void SetCURLPOSTScore(CURL*& curlHandle, curl_httppost*& form, curl_httpp
592592
SetCURLFormPostField(curlHandle, form, lastPtr, "letgo", hs->GetHoldNoteScore(HNS_LetGo));
593593
SetCURLFormPostField(curlHandle, form, lastPtr, "ng", hs->GetHoldNoteScore(HNS_Missed));
594594
SetCURLFormPostField(curlHandle, form, lastPtr, "chartkey", hs->GetChartKey());
595-
SetCURLFormPostField(curlHandle, form, lastPtr, "rate", hs->GetMusicRate());
595+
SetCURLFormPostField(curlHandle, form, lastPtr, "rate", to_string(static_cast<int>(hs->GetMusicRate() * 1000.f)));
596596
auto chart = SONGMAN->GetStepsByChartkey(hs->GetChartKey());
597597
SetCURLFormPostField(curlHandle, form, lastPtr, "negsolo", chart->GetTimingData()->HasWarps() || chart->m_StepsType != StepsType_dance_single);
598598
SetCURLFormPostField(curlHandle, form, lastPtr, "nocc", static_cast<int>(!hs->GetChordCohesion()));
599599
SetCURLFormPostField(curlHandle, form, lastPtr, "calc_version", hs->GetSSRCalcVersion());
600600
SetCURLFormPostField(curlHandle, form, lastPtr, "topscore", hs->GetTopScore());
601-
SetCURLFormPostField(curlHandle, form, lastPtr, "uuid", hs->GetMachineGuid());
602601
SetCURLFormPostField(curlHandle, form, lastPtr, "hash", hs->GetValidationKey(ValidationKey_Brittle));
603-
SetCURLFormPostField(curlHandle, form, lastPtr, "wifePoints", hs->GetWifePoints());
604-
SetCURLFormPostField(curlHandle, form, lastPtr, "judgeScale", hs->GetJudgeScale());
602+
SetCURLFormPostField(curlHandle, form, lastPtr, "wife", to_string(static_cast<int>(hs->GetWifeScore() * 1000.f)));
603+
SetCURLFormPostField(curlHandle, form, lastPtr, "wifePoints", to_string(static_cast<int>(hs->GetWifePoints() * 1000.f)));
604+
SetCURLFormPostField(curlHandle, form, lastPtr, "judgeScale", to_string(static_cast<int>(hs->GetJudgeScale() * 1000.f)));
605605
SetCURLFormPostField(curlHandle, form, lastPtr, "machineGuid", hs->GetMachineGuid());
606606
SetCURLFormPostField(curlHandle, form, lastPtr, "grade", hs->GetGrade());
607607
SetCURLFormPostField(curlHandle, form, lastPtr, "wifeGrade", string(GradeToString(hs->GetWifeGrade()).c_str()));

0 commit comments

Comments
 (0)