You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: osu.Game/Beatmaps/BeatmapUpdaterMetadataLookup.cs
+10-19Lines changed: 10 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,6 @@
5
5
usingSystem.Collections.Generic;
6
6
usingSystem.Diagnostics;
7
7
usingSystem.Linq;
8
-
usingosu.Framework.Logging;
9
8
usingosu.Framework.Platform;
10
9
usingosu.Game.Online.API;
11
10
@@ -44,10 +43,19 @@ public void Update(BeatmapSetInfo beatmapSet, bool preferOnlineFetch)
44
43
45
44
foreach(varbeatmapInfoinbeatmapSet.Beatmaps)
46
45
{
46
+
// note that these lookups DO NOT ACTUALLY FULLY GUARANTEE that the beatmap is what it claims it is,
47
+
// i.e. the correctness of this lookup should be treated as APPROXIMATE AT WORST.
48
+
// this is because the beatmap filename is used as a fallback in some scenarios where the MD5 of the beatmap may mismatch.
49
+
// this is considered to be an acceptable casualty so that things can continue to work as expected for users in some rare scenarios
50
+
// (stale beatmap files in beatmap packs, beatmap mirror desyncs).
51
+
// however, all this means that other places such as score submission ARE EXPECTED TO VERIFY THE MD5 OF THE BEATMAP AGAINST THE ONLINE ONE EXPLICITLY AGAIN.
52
+
//
53
+
// additionally note that the online ID stored to the map is EXPLICITLY NOT USED because some users in a silly attempt to "fix" things for themselves on stable
54
+
// would reuse online IDs of already submitted beatmaps, which means that information is pretty much expected to be bogus in a nonzero number of beatmapsets.
Logger.Log($"Discarding metadata lookup result due to mismatching online ID (expected: {beatmapInfo.OnlineID} actual: {result.BeatmapID})",LoggingTarget.Database);
Logger.Log($"Discarding metadata lookup result due to mismatching hash (expected: {beatmapInfo.MD5Hash} actual: {result.MD5Hash})",LoggingTarget.Database);
97
-
returntrue;
98
-
}
99
-
100
-
returnfalse;
101
-
}
102
-
103
94
/// <summary>
104
95
/// Attempts to retrieve the <see cref="OnlineBeatmapMetadata"/> for the given <paramref name="beatmapInfo"/>.
0 commit comments