We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b306d31 commit a22b9daCopy full SHA for a22b9da
1 file changed
osu.Server.Spectator/Hubs/Spectator/SpectatorHub.cs
@@ -11,6 +11,7 @@
11
using osu.Game.Beatmaps;
12
using osu.Game.Online.API.Requests.Responses;
13
using osu.Game.Database;
14
+using osu.Game.Online.Multiplayer;
15
using osu.Game.Online.Spectator;
16
using osu.Game.Rulesets.Scoring;
17
using osu.Game.Scoring;
@@ -201,6 +202,12 @@ private async Task processScore(SpectatorClientState item)
201
202
203
public async Task StartWatchingUser(int userId)
204
{
205
+ using (var db = databaseFactory.GetInstance())
206
+ {
207
+ if (await db.IsUserRestrictedAsync(Context.GetUserId()))
208
+ throw new InvalidStateException("Can't spectate a user when restricted.");
209
+ }
210
+
211
Log($"Watching {userId}");
212
213
try
0 commit comments