Skip to content
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

Introduce UserStatisticsProvider component and add support for respecting selected ruleset #27128

Merged
merged 28 commits into from
Nov 27, 2024
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
91fb59e
Introduce `LocalUserStatisticsProvider` component
frenzibyte Feb 11, 2024
3ab60b7
Remove `IAPIProvider.Statistics` in favour of the new component
frenzibyte Feb 11, 2024
633d854
Update `UserRankPanel` implementation to use new component
frenzibyte Feb 11, 2024
bc2b705
Fix `ImportTest.TestOsuGameBase` having null ruleset
frenzibyte Feb 11, 2024
11b3fa8
Fix `TestSceneUserPanel` tests failing
frenzibyte Feb 11, 2024
701fb56
Merge branch 'master' into user-statistics-provider
frenzibyte Oct 25, 2024
2fd4952
Fix post-merge errors
frenzibyte Oct 25, 2024
3a57b21
Move `LocalUserStatisticsProvider` to non-base game class and make de…
frenzibyte Oct 25, 2024
44dd813
Make `UserStatisticsWatcher` fully rely on `LocalUserStatisticsProvider`
frenzibyte Oct 25, 2024
fdeb8b9
Merge branch 'master' into user-statistics-provider
frenzibyte Oct 25, 2024
663b769
Update `DiscordRichPresence` to use new statistics provider component
frenzibyte Oct 25, 2024
979065c
Reorder code slightly
frenzibyte Oct 27, 2024
0760451
Merge branch 'master' into user-statistics-provider
peppy Nov 13, 2024
6c8a900
Merge branch 'master' into user-statistics-provider
frenzibyte Nov 17, 2024
4a62828
Decouple game-wide ruleset bindable and refactor `LocalUserStatistics…
frenzibyte Nov 17, 2024
28f8740
Make `DifficultyRecommender` rely on the statistics provider
frenzibyte Nov 17, 2024
07609b6
Fix `UserRankPanel` not updating on ruleset change
frenzibyte Nov 17, 2024
1847b67
Only update user rank panel display when ruleset matches
frenzibyte Nov 17, 2024
caf56af
Fix various test failures
frenzibyte Nov 18, 2024
b106833
Fix more test / component breakage
frenzibyte Nov 18, 2024
74daf85
Replace bindable with an event
frenzibyte Nov 18, 2024
0b52080
Handle logged out user
frenzibyte Nov 18, 2024
631bfad
Replace event subscription with callback in `UserStatisticsWatcher`
frenzibyte Nov 24, 2024
aa1358b
Enable NRT and fix code
frenzibyte Nov 24, 2024
53b3906
Fix failing test
frenzibyte Nov 24, 2024
0a3f3c3
Add guard against fetching statistics for non-legacy rulesets
bdach Nov 25, 2024
b76460f
Schedule the thing
frenzibyte Nov 26, 2024
42c68ba
Add inline comment
frenzibyte Nov 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Schedule the thing
Queuing up requests on change to `api.LocalUser` is bad because the API
state is updated after `LocalUser` is updated, therefore we have to
schhhhhedullllllllleeeeeeeeeeeeeeee.
  • Loading branch information
frenzibyte committed Nov 26, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit b76460f1003a269d2893d2466a71dd8e8a4a3201
4 changes: 2 additions & 2 deletions osu.Game/Online/LocalUserStatisticsProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected override void LoadComplete()
api.LocalUser.BindValueChanged(_ => initialiseStatistics(), true);
}

private void initialiseStatistics()
private void initialiseStatistics() => Schedule(() =>
{
statisticsCache.Clear();

Expand All @@ -59,7 +59,7 @@ private void initialiseStatistics()

foreach (var ruleset in rulesets.AvailableRulesets.Where(r => r.IsLegacyRuleset()))
RefetchStatistics(ruleset);
}
});

public void RefetchStatistics(RulesetInfo ruleset, Action<UserStatisticsUpdate>? callback = null)
{
Expand Down
Loading