Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@smoogipoo
Copy link
Contributor

@smoogipoo smoogipoo commented Oct 22, 2025

IsLocallyAvailable returns true if the beatmap set exists even if the beatmap we'll use was modified. The new BeatmapInfo overload added in this PR uses the same condition as in other places to test for beatmap availability:

var localBeatmap = beatmapManager.QueryBeatmap($@"{nameof(BeatmapInfo.OnlineID)} == $0 AND {nameof(BeatmapInfo.MD5Hash)} == {nameof(BeatmapInfo.OnlineMD5Hash)}", gameplayBeatmap.OnlineID);

var localBeatmap = beatmapManager.QueryBeatmap($@"{nameof(BeatmapInfo.OnlineID)} == $0 AND {nameof(BeatmapInfo.MD5Hash)} == {nameof(BeatmapInfo.OnlineMD5Hash)}", gameplayBeatmapId);

var beatmap = beatmaps.QueryBeatmap($@"{nameof(BeatmapInfo.OnlineID)} == $0 AND {nameof(BeatmapInfo.MD5Hash)} == {nameof(BeatmapInfo.OnlineMD5Hash)}", item.Beatmap.OnlineID);

IQueryable<BeatmapInfo> queryBeatmap() =>
realm.Realm.All<BeatmapInfo>().Filter("OnlineID == $0 && MD5Hash == $1 && BeatmapSet.DeletePending == false", beatmap.OnlineID, beatmap.MD5Hash);

For the time being, this PR only updates quick play to use this new method. Before going further and updating other usages, I'd first like confirmation that this is the correct way of going about things.

Copy link
Collaborator

@bdach bdach left a comment

Choose a reason for hiding this comment

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

For client-side non-critical beatmap availability checks this is indeed as good as it gets. The real bulwark is server-side checks on submission anyway.

bdach
bdach previously approved these changes Oct 23, 2025
peppy
peppy previously approved these changes Oct 24, 2025
@peppy peppy self-requested a review October 24, 2025 05:27
@peppy peppy dismissed stale reviews from bdach and themself via d062c99 October 24, 2025 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants