Skip to content

Commit

Permalink
fix: limit game id for submissions
Browse files Browse the repository at this point in the history
  • Loading branch information
GZTimeWalker committed Aug 31, 2024
1 parent c8e2c84 commit 549dbc9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/GZCTF/Repositories/GameRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ public async Task<ScoreboardModel> GenScoreboard(Game game, CancellationToken to
.IgnoreAutoIncludes()
.Include(s => s.User)
.Include(s => s.GameChallenge)
.Where(s => s.Status == AnswerResult.Accepted && s.GameChallenge.IsEnabled
.Where(s => s.Status == AnswerResult.Accepted
&& s.GameId == game.Id
&& s.GameChallenge.IsEnabled
&& s.SubmitTimeUtc < game.EndTimeUtc)
.GroupBy(s => new { s.ChallengeId, s.ParticipationId })
.Where(g => g.Any())
Expand Down Expand Up @@ -350,10 +352,7 @@ public async Task<ScoreboardModel> GenScoreboard(Game game, CancellationToken to

return new()
{
Challenges = challengesDict,
Items = items,
TimeLines = timelines,
BloodBonusValue = game.BloodBonus.Val
Challenges = challengesDict, Items = items, TimeLines = timelines, BloodBonusValue = game.BloodBonus.Val
};
}

Expand Down

0 comments on commit 549dbc9

Please sign in to comment.