Skip to content

Commit

Permalink
Merge pull request #19597 from frenzibyte/hotfix-multi-spectator-resu…
Browse files Browse the repository at this point in the history
…lts-screen

Fix multi-spectator potentially getting stuck for passed players (hotfix)
  • Loading branch information
smoogipoo authored Aug 9, 2022
2 parents efc4a12 + 789e8b4 commit 41af03d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,8 @@ private void end(int userId)
{
var user = playingUsers.Single(u => u.UserID == userId);

OnlinePlayDependencies.MultiplayerClient.RemoveUser(user.User.AsNonNull());
SpectatorClient.SendEndPlay(userId);
OnlinePlayDependencies.MultiplayerClient.RemoveUser(user.User.AsNonNull());

playingUsers.Remove(user);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ protected override void EndGameplay(int userId, SpectatorState state)
if (state.State == SpectatedUserState.Passed || state.State == SpectatedUserState.Failed)
return;

// we could also potentially receive EndGameplay with "Playing" state, at which point we can only early-return and hope it's a passing player.
// todo: this shouldn't exist, but it's here as a hotfix for an issue with multi-spectator screen not proceeding to results screen.
// see: https://github.com/ppy/osu/issues/19593
if (state.State == SpectatedUserState.Playing)
return;

RemoveUser(userId);

var instance = instances.Single(i => i.UserId == userId);
Expand Down

0 comments on commit 41af03d

Please sign in to comment.