From 4d2501895c21d6f8241aa2a84f1c6fed1262e49b Mon Sep 17 00:00:00 2001 From: Ben Stein <115497763+sei-bstein@users.noreply.github.com> Date: Fri, 26 Jan 2024 20:55:16 -0500 Subject: [PATCH] v3.13.3 (#361) * Fix a bug with the flag that allows games to be shown on the homepage while in practice mode. * Minor cleanup * Don't allow the challenge sync service to clean up challenges for sessions which have no player end time. --- .../Features/Challenge/Services/ChallengeSyncService.cs | 2 +- .../Features/Game/External/Requests/GetExternalTeamData.cs | 1 - .../Features/Game/External/Requests/PreDeployGameResources.cs | 1 - src/Gameboard.Api/Features/Game/GameStart/GameStartService.cs | 3 --- 4 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Gameboard.Api/Features/Challenge/Services/ChallengeSyncService.cs b/src/Gameboard.Api/Features/Challenge/Services/ChallengeSyncService.cs index c0d7c883..15e66b7a 100644 --- a/src/Gameboard.Api/Features/Challenge/Services/ChallengeSyncService.cs +++ b/src/Gameboard.Api/Features/Challenge/Services/ChallengeSyncService.cs @@ -83,7 +83,7 @@ public async Task SyncExpired(CancellationToken cancellationToken) // Just load them all, then sync one by one. var challenges = await _store .WithNoTracking() - .Where(c => c.Player.SessionEnd < now && (c.LastSyncTime < c.Player.SessionEnd || c.EndTime == DateTimeOffset.MinValue)) + .Where(c => c.Player.SessionEnd != DateTimeOffset.MinValue && c.Player.SessionEnd < now && (c.LastSyncTime < c.Player.SessionEnd || c.EndTime == DateTimeOffset.MinValue)) .ToArrayAsync(cancellationToken); var playerIds = challenges.Select(c => c.PlayerId).Distinct().ToArray(); diff --git a/src/Gameboard.Api/Features/Game/External/Requests/GetExternalTeamData.cs b/src/Gameboard.Api/Features/Game/External/Requests/GetExternalTeamData.cs index 766d4610..3ffe3876 100644 --- a/src/Gameboard.Api/Features/Game/External/Requests/GetExternalTeamData.cs +++ b/src/Gameboard.Api/Features/Game/External/Requests/GetExternalTeamData.cs @@ -1,4 +1,3 @@ -using System; using System.Linq; using System.Threading; using System.Threading.Tasks; diff --git a/src/Gameboard.Api/Features/Game/External/Requests/PreDeployGameResources.cs b/src/Gameboard.Api/Features/Game/External/Requests/PreDeployGameResources.cs index 8d8f54a4..a841edf9 100644 --- a/src/Gameboard.Api/Features/Game/External/Requests/PreDeployGameResources.cs +++ b/src/Gameboard.Api/Features/Game/External/Requests/PreDeployGameResources.cs @@ -3,7 +3,6 @@ using System.Threading.Tasks; using Gameboard.Api.Common.Services; using Gameboard.Api.Features.Games.Start; -using Gameboard.Api.Structure; using Gameboard.Api.Structure.MediatR; using Gameboard.Api.Structure.MediatR.Authorizers; using Gameboard.Api.Structure.MediatR.Validators; diff --git a/src/Gameboard.Api/Features/Game/GameStart/GameStartService.cs b/src/Gameboard.Api/Features/Game/GameStart/GameStartService.cs index ba112a4c..a4eae5ac 100644 --- a/src/Gameboard.Api/Features/Game/GameStart/GameStartService.cs +++ b/src/Gameboard.Api/Features/Game/GameStart/GameStartService.cs @@ -23,7 +23,6 @@ public interface IGameStartService internal class GameStartService : IGameStartService { private readonly IActingUserService _actingUserService; - // private readonly IExternalSyncGameStartService _externalSyncGameStartService; private readonly IGameModeServiceFactory _gameModeServiceFactory; private readonly ILockService _lockService; private readonly ILogger _logger; @@ -35,7 +34,6 @@ internal class GameStartService : IGameStartService public GameStartService ( IActingUserService actingUserService, - // IExternalSyncGameStartService externalSyncGameStartService, IGameModeServiceFactory gameModeServiceFactory, ILockService lockService, ILogger logger, @@ -46,7 +44,6 @@ ITeamService teamService ) { _actingUserService = actingUserService; - // _externalSyncGameStartService = externalSyncGameStartService; _gameModeServiceFactory = gameModeServiceFactory; _lockService = lockService; _logger = logger;