Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add capability to verify maximum statistics of scores #306

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

bdach
Copy link
Collaborator

@bdach bdach commented Nov 29, 2024

Intended usage is to fix ppy/osu-web#11697, after ppy/osu#30917 is merged, deployed as part of osu-difficulty-calculator, and legacy scoring attributes are recomputed.

Explanation of the failure mode here that links maximum_statistics with the linked issue is in the OP of the issue.

I've tested this full-stack on my local osu-web instance, but probably best to exercise care.

if (!checkDictionary(importedScore.id, "maximum_statistics", importedScore.ScoreData.MaximumStatistics, referenceScore.MaximumStatistics))
{
Interlocked.Increment(ref fail);
sqlBuffer.Append($"UPDATE `scores` SET `data` = JSON_SET(`data`, '$.maximum_statistics', CAST('{JsonConvert.SerializeObject(referenceScore.MaximumStatistics)}' AS JSON)) WHERE `id` = {importedScore.id};");
Copy link
Collaborator Author

@bdach bdach Nov 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quoting of the maximum statistics is a bit dodgy here but not super sure how to make it any better... It sorta relies on the json serialisation never outputting a quote which is a bit scary.

@smoogipoo smoogipoo requested a review from peppy December 3, 2024 08:51
@peppy peppy merged commit 14197fb into ppy:master Dec 6, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Max combo is not marked correctly in green on some taiko beatmaps
3 participants