mirror of https://github.com/ppy/osu
Remove watched users on stop watching
This commit is contained in:
parent
21fc0ba43b
commit
ad11818868
|
@ -230,7 +230,7 @@ public virtual void WatchUser(int userId)
|
|||
connection.SendAsync(nameof(ISpectatorServer.StartWatchingUser), userId);
|
||||
}
|
||||
|
||||
public void StopWatchingUser(int userId)
|
||||
public virtual void StopWatchingUser(int userId)
|
||||
{
|
||||
lock (userLock)
|
||||
{
|
||||
|
|
|
@ -38,7 +38,8 @@ public void EndPlay(int userId, int beatmapId)
|
|||
RulesetID = 0,
|
||||
});
|
||||
|
||||
userSentStateDictionary[userId] = false;
|
||||
userBeatmapDictionary.Remove(userId);
|
||||
userSentStateDictionary.Remove(userId);
|
||||
}
|
||||
|
||||
public void SendFrames(int userId, int index, int count)
|
||||
|
@ -66,10 +67,15 @@ public override void WatchUser(int userId)
|
|||
sendState(userId, userBeatmapDictionary[userId]);
|
||||
|
||||
base.WatchUser(userId);
|
||||
|
||||
watchingUsers.Add(userId);
|
||||
}
|
||||
|
||||
public override void StopWatchingUser(int userId)
|
||||
{
|
||||
base.StopWatchingUser(userId);
|
||||
watchingUsers.Remove(userId);
|
||||
}
|
||||
|
||||
private void sendState(int userId, int beatmapId)
|
||||
{
|
||||
((ISpectatorClient)this).UserBeganPlaying(userId, new SpectatorState
|
||||
|
|
Loading…
Reference in New Issue