Commit d4fc669
committed
Fix stable scores importing with a
Closes #33435.
The root cause of the issue is that the user's database contained a
whole lot of scores with `LegacyOnlineID` of 0, which would trip up
https://github.com/ppy/osu/blob/97e6187f0d7c3dbee896596a623e34627135bf0e/osu.Game/Extensions/ModelExtensions.cs#L128-L129
as that method would thus consider scores that are not the same as the
same because of the zero, which later trips up
https://github.com/ppy/osu/blob/97e6187f0d7c3dbee896596a623e34627135bf0e/osu.Game/Screens/Ranking/SoloResultsScreen.cs#L79
which ends up inserting `Score` into the list several times, which
causes the crash.
You might remember that I tried to fix this once before in
#24794. What I did not realise, however,
is that stable *can still produce replays* that have an online ID of
zero in them, because zero *is just `default(long)`*:
https://github.com/peppy/osu-stable-reference/blob/7205341bb70000a87fa1bd54e7642772e2af85d7/osu!/GameplayElements/Scoring/Score.cs#L123
https://github.com/peppy/osu-stable-reference/blob/7205341bb70000a87fa1bd54e7642772e2af85d7/osu!/GameplayElements/Scoring/Score.cs#L350
The alternative way of fixing this would be just to change
`MatchesOnlineID` to reject zeroes, but I think this is a saner overall
direction.LegacyOnlineID of 01 parent 909440a commit d4fc669
File tree
2 files changed
+11
-1
lines changed- osu.Game
- Database
- Scoring/Legacy
2 files changed
+11
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
101 | 102 | | |
102 | | - | |
| 103 | + | |
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| |||
1255 | 1256 | | |
1256 | 1257 | | |
1257 | 1258 | | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
1258 | 1265 | | |
1259 | 1266 | | |
1260 | 1267 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
113 | 116 | | |
114 | 117 | | |
115 | 118 | | |
| |||
0 commit comments