diff --git a/src/main/java/cc/fascinated/backend/service/ScoreSaberService.java b/src/main/java/cc/fascinated/backend/service/ScoreSaberService.java index 5353682..fbb6348 100644 --- a/src/main/java/cc/fascinated/backend/service/ScoreSaberService.java +++ b/src/main/java/cc/fascinated/backend/service/ScoreSaberService.java @@ -4,6 +4,7 @@ import cc.fascinated.backend.Main; import cc.fascinated.backend.common.DateUtils; import cc.fascinated.backend.common.Timer; import cc.fascinated.backend.common.WebRequest; +import cc.fascinated.backend.exception.impl.BadRequestException; import cc.fascinated.backend.exception.impl.RateLimitException; import cc.fascinated.backend.exception.impl.ResourceNotFoundException; import cc.fascinated.backend.model.account.Account; @@ -79,6 +80,12 @@ public class ScoreSaberService extends TextWebSocketHandler { log.info("Account with id '{}' not found.", id); throw new ResourceNotFoundException("Account with id '%s' not found.".formatted(id)); } + if (account.isBanned()) { + throw new BadRequestException("Account with id '%s' is banned.".formatted(id)); + } + if (account.isInactive()) { + throw new BadRequestException("Account with id '%s' is inactive.".formatted(id)); + } return account; }