From 67138a0bc7ac14171696498a787eb4acab38d35f Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Fri, 25 May 2012 15:28:03 +0000 Subject: [PATCH] - If a game is cancelled due to an error or players agreeing to cancel it, it is treated as finished, and players can start a new game. --- .../com/gempukku/lotro/game/LotroGameMediator.java | 4 ++++ .../java/com/gempukku/lotro/hall/HallServer.java | 12 +++++------- .../src/main/webapp/includes/changeLog.html | 4 ++++ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/LotroGameMediator.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/LotroGameMediator.java index 7684b0eda..fb7a5baba 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/LotroGameMediator.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/LotroGameMediator.java @@ -109,6 +109,10 @@ public class LotroGameMediator { return "Playing"; } + public boolean isFinished() { + return _lotroGame.isFinished(); + } + public String produceCardInfo(Player player, int cardId) { _readLock.lock(); try { diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/hall/HallServer.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/hall/HallServer.java index 59da819b2..9e357b196 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/hall/HallServer.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/hall/HallServer.java @@ -193,9 +193,8 @@ public class HallServer extends AbstractServer { final RunningTable runningTable = runningGame.getValue(); LotroGameMediator lotroGameMediator = _lotroServer.getGameById(runningTable.getGameId()); if (lotroGameMediator != null) { - String gameStatus = lotroGameMediator.getGameStatus(); - if (!gameStatus.equals("Finished")) - visitor.visitTable(runningGame.getKey(), runningTable.getGameId(), lotroGameMediator.isNoSpectators(), gameStatus, runningTable.getFormatName(), runningTable.getTournamentName(), lotroGameMediator.getPlayersPlaying(), lotroGameMediator.getWinner()); + if (!lotroGameMediator.isFinished()) + visitor.visitTable(runningGame.getKey(), runningTable.getGameId(), lotroGameMediator.isNoSpectators(), lotroGameMediator.getGameStatus(), runningTable.getFormatName(), runningTable.getTournamentName(), lotroGameMediator.getPlayersPlaying(), lotroGameMediator.getWinner()); else finishedTables.put(runningGame.getKey(), runningTable); } @@ -345,9 +344,8 @@ public class HallServer extends AbstractServer { for (Map.Entry runningTable : _runningTables.entrySet()) { String gameId = runningTable.getValue().getGameId(); LotroGameMediator lotroGameMediator = _lotroServer.getGameById(gameId); - if (lotroGameMediator != null && !lotroGameMediator.getGameStatus().equals("Finished")) - if (lotroGameMediator.getPlayersPlaying().contains(playerId)) - return gameId; + if (lotroGameMediator != null && !lotroGameMediator.isFinished() && lotroGameMediator.getPlayersPlaying().contains(playerId)) + return gameId; } return null; @@ -361,7 +359,7 @@ public class HallServer extends AbstractServer { for (RunningTable runningTable : _runningTables.values()) { String gameId = runningTable.getGameId(); LotroGameMediator lotroGameMediator = _lotroServer.getGameById(gameId); - if (lotroGameMediator != null && !lotroGameMediator.getGameStatus().equals("Finished") && lotroGameMediator.getPlayersPlaying().contains(playerId)) + if (lotroGameMediator != null && !lotroGameMediator.isFinished() && lotroGameMediator.getPlayersPlaying().contains(playerId)) return true; } diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/changeLog.html b/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/changeLog.html index 67b002bc5..243c115b8 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/changeLog.html +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/changeLog.html @@ -1,4 +1,8 @@
+25 May 2012
+- If a game is cancelled due to an error or players agreeing to cancel it, it is treated as finished, and players can
+start a new game.
+
 24 May 2012
 - "Úlairë Otsëa, Black-Mantled Wraith" now gives the option of choice to the FP player, rather than Shadow player.
 - Added King's block starters to merchant.