ppy / osu

rhythm is just a *click* away!
https://osu.ppy.sh
MIT License
15k stars 2.21k forks source link

Discord rich presence should show current game mode rank #12898

Closed adryzz closed 2 years ago

adryzz commented 3 years ago

As of now, the discord rich presence shows current game mode, what the user is doing, and his rank image

The rank shown however, does not reflect the current game mode that is being played, but it shows only osu!std https://github.com/ppy/osu/blob/51e52fffd86347dbdb16c1420d1b3df13debfb1b/osu.Desktop/DiscordRichPresence.cs#L108

Lazer version: 2021.515.0

frenzibyte commented 3 years ago

Was taking a quick look at getting this one, but seems currently there's no way to get the local user statistics based on the current ruleset.

One quick way I can think of is making an IAPIProvider.LocalUserStatistics and update it based on ruleset changes by refetching via GetUserRequest() (with caching and debouncing), but would like to hear if that's fine to do, not sure myself.

LittleEndu commented 3 years ago

If such caching is implemented, note that there are other components (well, looks like just DifficultyRecommender) that would benefit from it as well.

smoogipoo commented 3 years ago

Is this the way such a thing is done? I thought we had another way to do it that was implemented recently via User.RulesetsStatistics.

frenzibyte commented 3 years ago

The User.RulesetStatistics thing is only on Users from UserCompact responses (i.e. GetUsersRequest), if osu!web can also make it exist in regular User responses (GetUserRequest/GetFriendRequest), that would be another good way to fix the OP issue.