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

Fix multi-spectator potentially getting stuck for passed players (hotfix) #19597

Merged

Conversation

frenzibyte
Copy link
Member

On a multi-spectator session, both SpectatorScreen and MultiplayerGameplayLeaderboard are watching the users via SpectatorClient.WatchUser, and once the match ends, the leaderboard may get signalled first from the server that the users have transitioned to the Results state, causing the leaderboard to stop watching said users.

Once that happens, SpectatorScreen will be signalled to abruptly invoke EndGameplay with the current state (Playing), which will grey out the players as if they have actually quitted, and therefore not proceed to the results screen.

This aims to be a hotfix for the issue, as the underlying problem requires a bit of rethought on the general flow of watching users (see discord).

Removing user triggers `playingUsers.Remove`, but doing so before
updating the state leads to `EndGameplay` being called with `State ==
Playing` rather than `Quit`.
@peppy
Copy link
Member

peppy commented Aug 6, 2022

Thanks for this, using in a hotfix release (built from this branch) as a temporary solution.

@peppy peppy requested a review from smoogipoo August 9, 2022 05:46
Copy link
Contributor

@smoogipoo smoogipoo left a comment

Choose a reason for hiding this comment

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

I think this is fine for the time being, but we really need to have "usages" here so that StopWatchingUser() is only called when no component is watching the user.

@smoogipoo smoogipoo merged commit 41af03d into ppy:master Aug 9, 2022
@frenzibyte frenzibyte deleted the hotfix-multi-spectator-results-screen branch August 24, 2022 04:04
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.

Spectating multiplayer match until finish sometimes doesn't transition to results screen
3 participants