-
Notifications
You must be signed in to change notification settings - Fork 382
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
Allow plays with touch device mod to be submitted in multiplayer regardless of required/allowed mods #10704
Conversation
da4dd69
to
76d1ef2
Compare
database/mods.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes were one-off manually generated from ppy/osu#25348 and an un-PRed osu-tools branch (ppy/osu-tools@master...bdach:osu-tools:mods-command-new-flag). I did it this way because there wasn't clear consensus on discord whether this should be a hardcode or a flag, so I basically picked one I liked better to force the issue. I'll PR the osu-tools change if this gets accepted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the plan here? get this PR merged first or wait for the tools etc to be updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose the web change should be merged and deployed before game-side for 100% correctness. I'll PR the tools branch now but it is not urgent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just need to remember to not have the changes here gone by unrelated release, I guess 🤔
app/Libraries/Mods.php
Outdated
@@ -112,6 +112,19 @@ public function assertValidForMultiplayer(int $rulesetId, array $ids, bool $isRe | |||
} | |||
} | |||
|
|||
public function excludeModsAlwaysValidForSubmission(int $rulesetId, array $ids): array | |||
{ | |||
$this->validateSelection($rulesetId, $ids); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can assume the array is already valid at this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"monkey see, monkey do, monkey no understand" moment. Will remove.
app/Libraries/Mods.php
Outdated
return collect($ids) | ||
->filter(function ($id) use ($rulesetMods) { | ||
return !$rulesetMods[$id]['AlwaysValidForSubmission']; | ||
}) | ||
->all(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to use collect
here. A plain array_values(array_filter(
works.
Also fn ($id) => $...
is simpler and doesn't need use (...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"idiot that doesn't write php tries to write php" moment. Will apply in a sec.
database/mods.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the plan here? get this PR merged first or wait for the tools etc to be updated?
Companion piece to ppy/osu#25348
Opening as draft as I'm not sure the direction will stick.
The general problem is thus: we want to distinguish scores with the touch device mod. For now, regardless of whether we want to specify that mod as required or allowed in a playlist room, the mod must be accepted at submission time even if the Touch Device mod is not required or allowed. So it gets it own special flag
AlwaysValidForSubmission
to avoid hardcoding the acronym, and that gets checked and excluded at score completion time to ensure that submission can go through.