- 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.

This commit is contained in:
marcins78@gmail.com
2012-05-25 15:28:03 +00:00
parent be75e26f99
commit 67138a0bc7
3 changed files with 13 additions and 7 deletions

View File

@@ -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 {

View File

@@ -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<String, RunningTable> 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;
}

View File

@@ -1,4 +1,8 @@
<pre style="font-size:80%">
<b>25 May 2012</b>
- 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.
<b>24 May 2012</b>
- "Ú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.