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

Show results in results screen based on leaderboard selected in song select #27861

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

Wleter
Copy link
Contributor

@Wleter Wleter commented Apr 14, 2024

Resolves #26331, resolves #9201.

Now SoloResultsScreen gets scores from LeaderboardScores in Player, similarly to SoloGameplayLeaderboard.

I'm not so sure about how I implemented PopulateScorePanelList in SoloResultsScreen. The idea was that, if the scores are already loaded, then hasLoaded prevents eventual changes that might happen later but still allow delayed fetching of scores (if they somehow didn't have time to load during gameplay and in song select?).
Maybe that can be improved/changed though.

Other thing that changed because of that is the SpectatorResultsScreen, similarly to the GameplayLeaderboard, doesn't show any other scores, because of lack of LeaderboardScores in SoloSpectatorPlayer

edit:
Tests seem to fail due to changing of testResults, even though on my local machine dotnet test gives 0 fails.
Are the tests performed parallelly and in normal situation it wouldn't occur, or just logic in SoloResultsScreen is not thread safe?

using osu.Game.Scoring;

namespace osu.Game.Screens.Ranking
{
public partial class SoloResultsScreen : ResultsScreen
{
private GetScoresRequest? getScoreRequest;
public readonly IBindableList<ScoreInfo> Scores = new BindableList<ScoreInfo>();
Copy link
Collaborator

Choose a reason for hiding this comment

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

So looking at the actual code, my primary question here would be - does this need to be bindable?

Once you enter results, the scores are not going to change until you exit back to song select. So is the complexity incurred from handling having this change worth it?

Additionally, there's also #27609 which is still an issue even with this bindable, the score retrieval still strongly depends on song select (which it shouldn't).

Dunno. All this is making me question whether further review of this diff is worth the time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The only difference is that if the results are delayed, then the results wouldn't show. One of the tests tested delayed fetching, so I didn't wanted to break that. This is highly unluckily and I wrote my concerns about it in my initial comment.

I also agree that the whole score retrival should be refactored. I can do that but you probably don't want me to. I decided to take scores in the same fashion as SoloGameplayLeaderboard, so the eventual refactoring might be easier.

Comment on lines -1229 to -1230
AllowRetry = true,
ShowUserStatistics = true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why are these removed from here? I would hope they could stay here. Otherwise this is going to take significant checking that every single derived implementation sets these correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I mean sure, but only EditorPlayer would not override this in the current form.

Comment on lines +91 to +110
protected override void Update()
{
base.Update();

if (lastFetchCompleted)
{
APIRequest nextPageRequest = null;

if (ScorePanelList.IsScrolledToStart)
nextPageRequest = FetchNextPage(-1, fetchScoresCallback);
else if (ScorePanelList.IsScrolledToEnd)
nextPageRequest = FetchNextPage(1, fetchScoresCallback);

if (nextPageRequest != null)
{
lastFetchCompleted = false;
api.Queue(nextPageRequest);
}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is happening here? Why is this in update? Why is it not being handled like every single score request flow in every other results screen implementation?

Copy link
Contributor Author

@Wleter Wleter Apr 16, 2024

Choose a reason for hiding this comment

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

I moved this from the previous implementation of ResultsScreen, it allowed fetching next pages of scores. However, it only really made sense for PlaylistResultsScreen, other implementations of FetchNextPage only returned null. Thus, I moved it.

Alternatively, I can make MultiPageResultsScreen, which implement this.

@bdach
Copy link
Collaborator

bdach commented Apr 24, 2024

I'm personally deprioritising further review of this as it was discussed during today's catch-up meeting that the future of the leaderboard on the results screen is not certain (it may even be that the results screen won't fetch other results at all anymore).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants