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

Always preserve multiplayer scores regardless of pass/fail #11118

Merged
merged 4 commits into from
Mar 26, 2024

Conversation

bdach
Copy link
Contributor

@bdach bdach commented Mar 25, 2024

Related: ppy/osu-queue-score-statistics#141, #10946

We want to preserve failed scores if they come from multiplayer so that the results of the multiplayer room can be accessed in the indeterminate future. Currently this would not happen if a multiplayer score was a fail.

Comment on lines 33 to 35
// multiplayer scores are always preserved.
$score->preserve = true;
$score->saveOrExplode();
Copy link
Contributor Author

@bdach bdach Mar 25, 2024

Choose a reason for hiding this comment

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

This probably looks funny/awkward but there was an intention behind doing things that way. In most cases, scores are created by passing raw json params to Score::extractParams() and then passing that to Score::createFromJsonOrExplode(). But I didn't want to add a parameter to control preserve to extractParams() (which I would have had to do to avoid this silliness), because I don't want to allow an arbitrary api consumer to set preserve directly in the first place if that makes sense?

If I'm overthinking this do let me know and I'll shuffle across, but yeah that was the intention.

Copy link
Collaborator

Choose a reason for hiding this comment

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

seems fine but I think it can also be done with createFromJsonOrExplode([...$params, 'preserve' => true])

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that works, good call. Applied, thanks 👍

@nanaya nanaya enabled auto-merge March 26, 2024 02:07
@nanaya nanaya merged commit baef0d8 into ppy:master Mar 26, 2024
3 checks passed
@bdach bdach deleted the preserve-failed-multi-scores branch March 26, 2024 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

2 participants