From 2962754abbb60223d17a1a815e05d76866f49c84 Mon Sep 17 00:00:00 2001 From: theropfather Date: Wed, 18 Jul 2018 23:04:02 +0100 Subject: [PATCH] Perform float calculation client side and add required parameters for validation. --- src/DownloadManager.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/DownloadManager.cpp b/src/DownloadManager.cpp index 6b8dc66dce..e9d092f5fb 100644 --- a/src/DownloadManager.cpp +++ b/src/DownloadManager.cpp @@ -576,7 +576,7 @@ bool DownloadManager::ShouldUploadScores() inline void SetCURLPOSTScore(CURL*& curlHandle, curl_httppost*& form, curl_httppost*& lastPtr, HighScore*& hs) { SetCURLFormPostField(curlHandle, form, lastPtr, "scorekey", hs->GetScoreKey()); - SetCURLFormPostField(curlHandle, form, lastPtr, "ssr_norm", hs->GetSSRNormPercent()); + SetCURLFormPostField(curlHandle, form, lastPtr, "ssr_norm", to_string(static_cast(hs->GetSSRNormPercent() * 1000.f))); SetCURLFormPostField(curlHandle, form, lastPtr, "max_combo", hs->GetMaxCombo()); SetCURLFormPostField(curlHandle, form, lastPtr, "valid", static_cast(hs->GetEtternaValid())); SetCURLFormPostField(curlHandle, form, lastPtr, "mods", hs->GetModifiers()); @@ -592,16 +592,16 @@ inline void SetCURLPOSTScore(CURL*& curlHandle, curl_httppost*& form, curl_httpp SetCURLFormPostField(curlHandle, form, lastPtr, "letgo", hs->GetHoldNoteScore(HNS_LetGo)); SetCURLFormPostField(curlHandle, form, lastPtr, "ng", hs->GetHoldNoteScore(HNS_Missed)); SetCURLFormPostField(curlHandle, form, lastPtr, "chartkey", hs->GetChartKey()); - SetCURLFormPostField(curlHandle, form, lastPtr, "rate", hs->GetMusicRate()); + SetCURLFormPostField(curlHandle, form, lastPtr, "rate", to_string(static_cast(hs->GetMusicRate() * 1000.f))); auto chart = SONGMAN->GetStepsByChartkey(hs->GetChartKey()); SetCURLFormPostField(curlHandle, form, lastPtr, "negsolo", chart->GetTimingData()->HasWarps() || chart->m_StepsType != StepsType_dance_single); SetCURLFormPostField(curlHandle, form, lastPtr, "nocc", static_cast(!hs->GetChordCohesion())); SetCURLFormPostField(curlHandle, form, lastPtr, "calc_version", hs->GetSSRCalcVersion()); SetCURLFormPostField(curlHandle, form, lastPtr, "topscore", hs->GetTopScore()); - SetCURLFormPostField(curlHandle, form, lastPtr, "uuid", hs->GetMachineGuid()); SetCURLFormPostField(curlHandle, form, lastPtr, "hash", hs->GetValidationKey(ValidationKey_Brittle)); - SetCURLFormPostField(curlHandle, form, lastPtr, "wifePoints", hs->GetWifePoints()); - SetCURLFormPostField(curlHandle, form, lastPtr, "judgeScale", hs->GetJudgeScale()); + SetCURLFormPostField(curlHandle, form, lastPtr, "wife", to_string(static_cast(hs->GetWifeScore() * 1000.f))); + SetCURLFormPostField(curlHandle, form, lastPtr, "wifePoints", to_string(static_cast(hs->GetWifePoints() * 1000.f))); + SetCURLFormPostField(curlHandle, form, lastPtr, "judgeScale", to_string(static_cast(hs->GetJudgeScale() * 1000.f))); SetCURLFormPostField(curlHandle, form, lastPtr, "machineGuid", hs->GetMachineGuid()); SetCURLFormPostField(curlHandle, form, lastPtr, "grade", hs->GetGrade()); SetCURLFormPostField(curlHandle, form, lastPtr, "wifeGrade", string(GradeToString(hs->GetWifeGrade()).c_str()));