From 0236d75e6d7e3d90ffc829c707feca075f1f140a Mon Sep 17 00:00:00 2001 From: Andrio Celos Date: Thu, 29 Dec 2022 19:19:02 +1100 Subject: [PATCH] Fix inactive games not being reactivated when a move is made --- TableturfBattleServer/Program.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TableturfBattleServer/Program.cs b/TableturfBattleServer/Program.cs index df06fc9..b75ce03 100644 --- a/TableturfBattleServer/Program.cs +++ b/TableturfBattleServer/Program.cs @@ -68,7 +68,6 @@ internal class Program { Console.WriteLine("Locking server for update."); } } - } } @@ -166,7 +165,7 @@ internal class Program { return; } lock (games) { - if (!games.TryGetValue(gameID, out var game) && !inactiveGames.TryGetValue(gameID, out game)) { + if (!TryGetGame(gameID, out var game)) { SetErrorResponse(e.Response, new(HttpStatusCode.NotFound, "GameNotFound", "Game not found.")); return; } @@ -547,6 +546,7 @@ internal class Program { inactiveGames.Remove(gameID); games[gameID] = game; game.AbandonedSince = DateTime.UtcNow; + Console.WriteLine($"{games.Count} games active; {inactiveGames.Count} inactive"); return true; } return false;