-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Use actual mod-adjusted map difficulty settings in the SongBar
#35763
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
Conversation
This is being queried by the https://github.com/ppy/osu/blob/master/osu.Game.Rulesets.Mania/ManiaRuleset.cs#L442 but since we don't actually draw column count anywhere nor are we supposed to be running converts in tournaments it should be safe to populate it with nothing.
|
Could probably download the |
|
Yea maybe, but that would require adding an .osu cache and predownload handling so I'd rather do it as a separate PR |
| string IBeatmapInfo.MD5Hash => throw new NotImplementedException(); | ||
|
|
||
| IRulesetInfo IBeatmapInfo.Ruleset => throw new NotImplementedException(); | ||
| IRulesetInfo IBeatmapInfo.Ruleset => new RulesetInfo(); |
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 is this change for? I really don't like the look of it.
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.
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.
Can
osu/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs
Lines 143 to 185 in 6bb84e4
| public class APIRuleset : IRulesetInfo | |
| { | |
| public int OnlineID { get; set; } = -1; | |
| public string Name => $@"{nameof(APIRuleset)} (ID: {OnlineID})"; | |
| public string ShortName | |
| { | |
| get | |
| { | |
| // TODO: this should really not exist. | |
| switch (OnlineID) | |
| { | |
| case 0: return "osu"; | |
| case 1: return "taiko"; | |
| case 2: return "fruits"; | |
| case 3: return "mania"; | |
| default: throw new ArgumentOutOfRangeException(); | |
| } | |
| } | |
| } | |
| public string InstantiationInfo => string.Empty; | |
| public Ruleset CreateInstance() => throw new NotImplementedException(); | |
| public bool Equals(IRulesetInfo? other) => other is APIRuleset r && this.MatchesOnlineID(r); | |
| public int CompareTo(IRulesetInfo? other) | |
| { | |
| if (!(other is APIRuleset ruleset)) | |
| throw new ArgumentException($@"Object is not of type {nameof(APIRuleset)}.", nameof(other)); | |
| return OnlineID.CompareTo(ruleset.OnlineID); | |
| } | |
| // ReSharper disable once NonReadonlyMemberInGetHashCode | |
| public override int GetHashCode() => OnlineID; | |
| } |
APIBeatmap in ctor) instead at least?
I really don't like these sorts of model hacks because they have a tendency to produce nasty buggage later. At least I'd like to have things in vaguely the correct wheelhouse rather just a blank model instance...
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.
If you're fine with it not being populated with anything and just always being OnlineID = -1 - sure
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 don't get why though, surely you could just
diff --git a/osu.Game.Tournament/Models/TournamentBeatmap.cs b/osu.Game.Tournament/Models/TournamentBeatmap.cs
index a7ba5b7db1..59003bc739 100644
--- a/osu.Game.Tournament/Models/TournamentBeatmap.cs
+++ b/osu.Game.Tournament/Models/TournamentBeatmap.cs
@@ -47,6 +47,7 @@ public TournamentBeatmap(APIBeatmap beatmap)
Covers = beatmap.BeatmapSet?.Covers ?? new BeatmapSetOnlineCovers();
EndTimeObjectCount = beatmap.EndTimeObjectCount;
TotalObjectCount = beatmap.TotalObjectCount;
+ Ruleset = beatmap.Ruleset;
}
public bool Equals(IBeatmapInfo? other) => other is TournamentBeatmap b && this.MatchesOnlineID(b);
no? What am I missing here?
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.
Beatmap gets created from IPC, I'm pretty sure it wouldn't have ruleset unless stable starts sending one
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.
That's not how any of that works. The "IPC" does an API request to look the beatmap up.
osu/osu.Game.Tournament/IPC/FileBasedIPC.cs
Lines 79 to 107 in cf9c812
| int beatmapId = int.Parse(sr.ReadLine().AsNonNull()); | |
| int mods = int.Parse(sr.ReadLine().AsNonNull()); | |
| if (lastBeatmapId != beatmapId) | |
| { | |
| beatmapLookupRequest?.Cancel(); | |
| lastBeatmapId = beatmapId; | |
| var existing = ladder.CurrentMatch.Value?.Round.Value?.Beatmaps.FirstOrDefault(b => b.ID == beatmapId); | |
| if (existing != null) | |
| Beatmap.Value = existing.Beatmap; | |
| else | |
| { | |
| beatmapLookupRequest = new GetBeatmapRequest(new APIBeatmap { OnlineID = beatmapId }); | |
| beatmapLookupRequest.Success += b => | |
| { | |
| if (lastBeatmapId == beatmapId) | |
| Beatmap.Value = new TournamentBeatmap(b); | |
| }; | |
| beatmapLookupRequest.Failure += _ => | |
| { | |
| if (lastBeatmapId == beatmapId) | |
| Beatmap.Value = null; | |
| }; | |
| API.Queue(beatmapLookupRequest); | |
| } | |
| } |
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.
That's...quite a structure. Should be simple then, I'll fix it now
This is dodgy as hell but `ShortName` is completely derived from `OnlineID` anyway so there should be no valid reason to ever attempt to serialise it anyway.

This also changes the bpm format to be consistent with the rest of the game. I would love for the SR display to show real values too, but that requires loading a full beatmap and the tournament client only has access to the metadata.
NM:

HR:

DT:

Mania NM:

Mania HR:
