mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 15:44:04 +09:00
Rework spectator components to use new user state
This commit is contained in:
@ -93,12 +93,8 @@ namespace osu.Game.Online.Spectator
|
||||
{
|
||||
Schedule(() =>
|
||||
{
|
||||
// UserBeganPlaying() is called by the server regardless of whether the local user is watching the remote user, and is called a further time when the remote user is watched.
|
||||
// This may be a temporary thing (see: https://github.com/ppy/osu-server-spectator/blob/2273778e02cfdb4a9c6a934f2a46a8459cb5d29c/osu.Server.Spectator/Hubs/SpectatorHub.cs#L28-L29).
|
||||
// We don't want the user states to update unless the player is being watched, otherwise calling BindUserBeganPlaying() can lead to double invocations.
|
||||
if (watchingUsers.Contains(userId))
|
||||
playingUserStates[userId] = state;
|
||||
|
||||
OnUserBeganPlaying?.Invoke(userId, state);
|
||||
});
|
||||
|
||||
@ -109,8 +105,8 @@ namespace osu.Game.Online.Spectator
|
||||
{
|
||||
Schedule(() =>
|
||||
{
|
||||
playingUserStates.Remove(userId);
|
||||
|
||||
if (watchingUsers.Contains(userId))
|
||||
playingUserStates[userId] = state;
|
||||
OnUserFinishedPlaying?.Invoke(userId, state);
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user