It's possible to leave league table now.

This commit is contained in:
marcins78
2013-01-18 16:42:24 +00:00
parent 411086adc3
commit 1db82b8928
3 changed files with 6 additions and 6 deletions

View File

@@ -66,7 +66,7 @@ public class HallCommunicationChannel {
}
@Override
public void visitTable(String tableId, String gameId, boolean watchable, TableStatus status, String statusDescription, String formatName, String tournamentName, List<String> playerIds, String winner) {
public void visitTable(String tableId, String gameId, boolean watchable, TableStatus status, String statusDescription, String formatName, String tournamentName, List<String> playerIds, boolean playing, String winner) {
Map<String, String> props = new HashMap<String, String>();
props.put("gameId", gameId);
props.put("watchable", String.valueOf(watchable));
@@ -75,7 +75,7 @@ public class HallCommunicationChannel {
props.put("format", formatName);
props.put("tournament", tournamentName);
props.put("players", StringUtils.join(playerIds, ","));
props.put("playing", String.valueOf(playerIds.contains(player.getName())));
props.put("playing", String.valueOf(playing));
if (winner != null)
props.put("winner", winner);

View File

@@ -11,7 +11,7 @@ public interface HallInfoVisitor {
public void motd(String motd);
public void visitTable(String tableId, String gameId, boolean watchable, TableStatus status, String statusDescription, String formatName, String tournamentName, List<String> playerIds, String winner);
public void visitTable(String tableId, String gameId, boolean watchable, TableStatus status, String statusDescription, String formatName, String tournamentName, List<String> playerIds, boolean playing, String winner);
public void visitTournamentQueue(String tournamentQueueKey, int cost, String collectionName, String formatName, String tournamentQueueName, String tournamentPrizes,
String pairingDescription, String startCondition, int playerCount, boolean playerSignedUp, boolean joinable);

View File

@@ -496,7 +496,7 @@ public class HallServer extends AbstractServer {
players = Collections.<String>emptyList();
else
players = table.getPlayerNames();
visitor.visitTable(tableInformation.getKey(), null, false, HallInfoVisitor.TableStatus.WAITING, "Waiting", table.getLotroFormat().getName(), getTournamentName(table), players, null);
visitor.visitTable(tableInformation.getKey(), null, false, HallInfoVisitor.TableStatus.WAITING, "Waiting", table.getLotroFormat().getName(), getTournamentName(table), players, table.getPlayerNames().contains(player.getName()), null);
}
// Then non-finished
@@ -507,7 +507,7 @@ public class HallServer extends AbstractServer {
LotroGameMediator lotroGameMediator = _lotroServer.getGameById(runningTable.getGameId());
if (lotroGameMediator != null) {
if (!lotroGameMediator.isFinished())
visitor.visitTable(runningGame.getKey(), runningTable.getGameId(), player.getType().contains("a") || lotroGameMediator.isAllowSpectators(), HallInfoVisitor.TableStatus.PLAYING, lotroGameMediator.getGameStatus(), runningTable.getFormatName(), runningTable.getTournamentName(), lotroGameMediator.getPlayersPlaying(), lotroGameMediator.getWinner());
visitor.visitTable(runningGame.getKey(), runningTable.getGameId(), player.getType().contains("a") || lotroGameMediator.isAllowSpectators(), HallInfoVisitor.TableStatus.PLAYING, lotroGameMediator.getGameStatus(), runningTable.getFormatName(), runningTable.getTournamentName(), lotroGameMediator.getPlayersPlaying(), lotroGameMediator.getPlayersPlaying().contains(player.getName()), lotroGameMediator.getWinner());
else
finishedTables.put(runningGame.getKey(), runningTable);
if (lotroGameMediator != null && !lotroGameMediator.isFinished() && lotroGameMediator.getPlayersPlaying().contains(player.getName()))
@@ -520,7 +520,7 @@ public class HallServer extends AbstractServer {
final RunningTable runningTable = nonPlayingGame.getValue();
LotroGameMediator lotroGameMediator = _lotroServer.getGameById(runningTable.getGameId());
if (lotroGameMediator != null)
visitor.visitTable(nonPlayingGame.getKey(), runningTable.getGameId(), false, HallInfoVisitor.TableStatus.FINISHED, lotroGameMediator.getGameStatus(), runningTable.getFormatName(), runningTable.getTournamentName(), lotroGameMediator.getPlayersPlaying(), lotroGameMediator.getWinner());
visitor.visitTable(nonPlayingGame.getKey(), runningTable.getGameId(), false, HallInfoVisitor.TableStatus.FINISHED, lotroGameMediator.getGameStatus(), runningTable.getFormatName(), runningTable.getTournamentName(), lotroGameMediator.getPlayersPlaying(), lotroGameMediator.getPlayersPlaying().contains(player.getName()), lotroGameMediator.getWinner());
}
for (Map.Entry<String, TournamentQueue> tournamentQueueEntry : _tournamentQueues.entrySet()) {