Fixes a bug that allowed for selecting the same mod twice in multiplayer
if the playlist entry has non-default settings for a required mod.
This happens due to a strict equality mod check in the mod set
compatibility check function, which only considers mods duplicates if
their settings are exactly the same. Replacing with a more lenient
`Type` check fixes this.
Adds a regression test for this behavior
Fixes https://github.com/ppy/osu/issues/37625.
---------
Co-authored-by: Bartłomiej Dach <dach.bartlomiej@gmail.com>
Exposed to be running by 48434dd683 which
caused test failures.
You'd think that the `IsDeployedBuild` check would catch it but it
doesn't. `IsDeployedBuild` is `AssemblyVersion.Major > 0`, and the
assembly version is taken from the entry assembly. In tests the entry
assembly is either resharper or nunit.
It's been a while.
Notes:
- `SharpCompress` usages changed a bit. Manually adjusted these, mostly
just renames or adjusted parameters.
- nUnit 3 -> 4 migrated using
https://gist.github.com/peppy/07994386d793a117350cb5f24b156585. there's
a mode in this script to update to the newer `Assert.That` syntax but it
requires fixes and couldn't really be bothered.
- DeepEqual nuked as the only usage was on a disabled test. The reason
it's disabled has been merged upstream, but it's failing for other
(realm) reasons which I don't think is worthwhile to investigate for
now.
- This bumps Moq. I think the author is back in a sensible headspace and
the new version has the stupid shit removed, so probably okay? Nice to
be on a level playing field with packages for once in a long time.
- Automapper is silly, but we've discussed this elsewhere.
- `TestRealmKeyBindingStore` failures are a wildcard, but fixed by using
a more standardised testing method. Dunno why, don't care.
---------
Co-authored-by: Bartłomiej Dach <dach.bartlomiej@gmail.com>
This is the counterpart to
https://github.com/ppy/osu-server-spectator/pull/413. The goal is to
log the value which is seemingly failing to work correctly client-side
as well.
The reason for doing that is two-fold:
- To eliminate possibility of freakazoid issues wherein some computers
miscalculate the version hash somehow
- To eliminate possibility of the version hash somehow getting lost in
transit (e.g. present client-side but no longer present server-side).
Resolves https://github.com/ppy/osu/discussions/36107.
The replay linked in the aforementioned discussion happens to contain
the magic sequence for ZIP headers in the binary stream (50 4b 05 06)
which led to it getting classified as a ZIP with no entries and
completely bogus everything in the header at
https://github.com/ppy/osu/blob/c8b18acd4dd1d98170a069240b6666cea3d5da07/osu.Game/Database/ImportTask.cs#L51-L56
and then finally dying of
2025-12-23 07:26:45 [error]: [?????] Model creation of replay-osu_2040232_4828629841.osr failed.
2025-12-23 07:26:45 [error]: System.InvalidOperationException: Sequence contains no matching element
2025-12-23 07:26:45 [error]: at System.Linq.ThrowHelper.ThrowNoMatchException()
2025-12-23 07:26:45 [error]: at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
2025-12-23 07:26:45 [error]: at osu.Game.Scoring.ScoreImporter.CreateModel(ArchiveReader archive, ImportParameters parameters)
2025-12-23 07:26:45 [error]: at osu.Game.Database.RealmArchiveModelImporter`1.importFromArchive(ArchiveReader archive, ImportParameters parameters, CancellationToken cancellationToken)
at
https://github.com/ppy/osu/blob/554961036e23615b35eb6b66b341b10924664c4d/osu.Game/Scoring/ScoreImporter.cs#L46
More or less covers the first page of client sentry issues sorted by
volume, all of which is pretty much useless for anything because it's
client-specific-failure noise.
Rounding semi-regularly confuses users who aim for star rating pass / FC
medals and then feel they have been cheated out of a medal because they
passed an "X-star beatmap", but the actual star rating of the beatmap is
slightly under X.
The latest instance of this can be found at
https://osu.ppy.sh/community/forums/topics/2091333?n=2. The relevant
beatmap there is https://osu.ppy.sh/beatmapsets/2162554#osu/4746232,
whose raw star rating is 6.9976070253117344.
The other direction would be to fix the star rating medals instead, but
I think this is more reasonable given we already do similar things to
accuracy displays.