mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Remove watched users on stop watching
This commit is contained in:
@ -230,7 +230,7 @@ namespace osu.Game.Online.Spectator
|
|||||||
connection.SendAsync(nameof(ISpectatorServer.StartWatchingUser), userId);
|
connection.SendAsync(nameof(ISpectatorServer.StartWatchingUser), userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void StopWatchingUser(int userId)
|
public virtual void StopWatchingUser(int userId)
|
||||||
{
|
{
|
||||||
lock (userLock)
|
lock (userLock)
|
||||||
{
|
{
|
||||||
|
@ -38,7 +38,8 @@ namespace osu.Game.Tests.Visual.Spectator
|
|||||||
RulesetID = 0,
|
RulesetID = 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
userSentStateDictionary[userId] = false;
|
userBeatmapDictionary.Remove(userId);
|
||||||
|
userSentStateDictionary.Remove(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendFrames(int userId, int index, int count)
|
public void SendFrames(int userId, int index, int count)
|
||||||
@ -66,10 +67,15 @@ namespace osu.Game.Tests.Visual.Spectator
|
|||||||
sendState(userId, userBeatmapDictionary[userId]);
|
sendState(userId, userBeatmapDictionary[userId]);
|
||||||
|
|
||||||
base.WatchUser(userId);
|
base.WatchUser(userId);
|
||||||
|
|
||||||
watchingUsers.Add(userId);
|
watchingUsers.Add(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void StopWatchingUser(int userId)
|
||||||
|
{
|
||||||
|
base.StopWatchingUser(userId);
|
||||||
|
watchingUsers.Remove(userId);
|
||||||
|
}
|
||||||
|
|
||||||
private void sendState(int userId, int beatmapId)
|
private void sendState(int userId, int beatmapId)
|
||||||
{
|
{
|
||||||
((ISpectatorClient)this).UserBeganPlaying(userId, new SpectatorState
|
((ISpectatorClient)this).UserBeganPlaying(userId, new SpectatorState
|
||||||
|
Reference in New Issue
Block a user