P1: Challenger-Zugehörigkeit zum Spiel validieren; P2: MAUI-Workload im CI installieren
All checks were successful
Build / build (pull_request) Successful in 6m10s
All checks were successful
Build / build (pull_request) Successful in 6m10s
- GameService.CreateChallengeAsync prüft jetzt, dass challengingPlayerId zum gameId gehört - Zwei neue Tests für Cross-Game-/Fremdspieler-Challenges - CI: dotnet workload install maui vor dem Restore, damit MAUI auf frischen Runnern baut
This commit is contained in:
@@ -176,6 +176,11 @@ public class GameService : IGameService
|
||||
.Where(gr => gr.GameId == gameId && gr.Status == RoundStatus.Active)
|
||||
.FirstOrDefaultAsync() ?? throw new InvalidOperationException("No active round found");
|
||||
|
||||
var challengerBelongsToGame = await context.Players
|
||||
.AnyAsync(p => p.Id == challengingPlayerId && p.GameId == gameId);
|
||||
if (!challengerBelongsToGame)
|
||||
throw new UnauthorizedAccessException("Challenger does not belong to this game");
|
||||
|
||||
var targetCard = await context.PlayerCards
|
||||
.FirstOrDefaultAsync(pc => pc.Id == targetCardId) ?? throw new InvalidOperationException("Target card not found");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user