Fixing sanctuary rule and game not starting if there is finished game with the player.
This commit is contained in:
@@ -32,7 +32,7 @@ public class SanctuaryRule {
|
||||
if (effectResult.getType() == EffectResult.Type.START_OF_TURN
|
||||
&& game.getModifiersQuerying().hasKeyword(game.getGameState(), game.getGameState().getCurrentSite(), Keyword.SANCTUARY)) {
|
||||
DefaultCostToEffectAction action = new DefaultCostToEffectAction(null, null, "Sanctuary healing");
|
||||
action.addEffect(new HealCompanion(game.getGameState().getCurrentPlayerId(), action, 0));
|
||||
action.addEffect(new HealCompanion(game.getGameState().getCurrentPlayerId(), action, 1));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -142,7 +142,7 @@ public class HallServer extends AbstractServer {
|
||||
visitor.visitTable(runningGame.getKey(), lotroGameMediator.getGameStatus(), lotroGameMediator.getPlayersPlaying());
|
||||
}
|
||||
|
||||
String playerTable = getPlayerTable(participantId);
|
||||
String playerTable = getNonFinishedPlayerTable(participantId);
|
||||
if (playerTable != null) {
|
||||
String gameId = _runningTables.get(playerTable);
|
||||
if (gameId != null) {
|
||||
@@ -153,7 +153,7 @@ public class HallServer extends AbstractServer {
|
||||
}
|
||||
}
|
||||
|
||||
public String getPlayerTable(String playerId) {
|
||||
private String getNonFinishedPlayerTable(String playerId) {
|
||||
for (Map.Entry<String, AwaitingTable> table : _awaitingTables.entrySet()) {
|
||||
if (table.getValue().hasPlayer(playerId))
|
||||
return table.getKey();
|
||||
@@ -162,7 +162,7 @@ public class HallServer extends AbstractServer {
|
||||
for (Map.Entry<String, String> runningTable : _runningTables.entrySet()) {
|
||||
String gameId = runningTable.getValue();
|
||||
LotroGameMediator lotroGameMediator = _lotroServer.getGameById(gameId);
|
||||
if (lotroGameMediator != null)
|
||||
if (lotroGameMediator != null && !lotroGameMediator.getGameStatus().equals("Finished"))
|
||||
if (lotroGameMediator.getPlayersPlaying().contains(playerId))
|
||||
return runningTable.getKey();
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ import java.util.Set;
|
||||
@Path("/")
|
||||
public class ServerResource {
|
||||
private static final Logger _logger = Logger.getLogger(ServerResource.class);
|
||||
private boolean _test = true;
|
||||
private boolean _test = false;
|
||||
|
||||
private HallServer _hallServer;
|
||||
private LotroServer _lotroServer;
|
||||
|
||||
@@ -8,7 +8,6 @@ Next priority:
|
||||
25. Remove all non-essencial alerts, instead add warnings to chat panel.
|
||||
13. Add dead/discard pile displays.
|
||||
14. Add hand/deck card count displays.
|
||||
19. Add filtering cards to deck-builder.
|
||||
16. Add an option to watch an ongoing game (spectator).
|
||||
24. The events that are played and cards affected should be shown to the players briefly using animations to make it
|
||||
aestheticly pleasing.
|
||||
@@ -48,3 +47,4 @@ with Filters.sameCard(...) filter.
|
||||
29. Player registration and login.
|
||||
32. Created tables do not disappear when the player closes the browser.
|
||||
33. When a player stops responding during preparation time of the game, the game is not properly finished.
|
||||
19. Add filtering cards to deck-builder.
|
||||
|
||||
Reference in New Issue
Block a user