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 @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>(); Map<String, String> props = new HashMap<String, String>();
props.put("gameId", gameId); props.put("gameId", gameId);
props.put("watchable", String.valueOf(watchable)); props.put("watchable", String.valueOf(watchable));
@@ -75,7 +75,7 @@ public class HallCommunicationChannel {
props.put("format", formatName); props.put("format", formatName);
props.put("tournament", tournamentName); props.put("tournament", tournamentName);
props.put("players", StringUtils.join(playerIds, ",")); props.put("players", StringUtils.join(playerIds, ","));
props.put("playing", String.valueOf(playerIds.contains(player.getName()))); props.put("playing", String.valueOf(playing));
if (winner != null) if (winner != null)
props.put("winner", winner); props.put("winner", winner);

View File

@@ -11,7 +11,7 @@ public interface HallInfoVisitor {
public void motd(String motd); 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, 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); 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(); players = Collections.<String>emptyList();
else else
players = table.getPlayerNames(); 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 // Then non-finished
@@ -507,7 +507,7 @@ public class HallServer extends AbstractServer {
LotroGameMediator lotroGameMediator = _lotroServer.getGameById(runningTable.getGameId()); LotroGameMediator lotroGameMediator = _lotroServer.getGameById(runningTable.getGameId());
if (lotroGameMediator != null) { if (lotroGameMediator != null) {
if (!lotroGameMediator.isFinished()) 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 else
finishedTables.put(runningGame.getKey(), runningTable); finishedTables.put(runningGame.getKey(), runningTable);
if (lotroGameMediator != null && !lotroGameMediator.isFinished() && lotroGameMediator.getPlayersPlaying().contains(player.getName())) if (lotroGameMediator != null && !lotroGameMediator.isFinished() && lotroGameMediator.getPlayersPlaying().contains(player.getName()))
@@ -520,7 +520,7 @@ public class HallServer extends AbstractServer {
final RunningTable runningTable = nonPlayingGame.getValue(); final RunningTable runningTable = nonPlayingGame.getValue();
LotroGameMediator lotroGameMediator = _lotroServer.getGameById(runningTable.getGameId()); LotroGameMediator lotroGameMediator = _lotroServer.getGameById(runningTable.getGameId());
if (lotroGameMediator != null) 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()) { for (Map.Entry<String, TournamentQueue> tournamentQueueEntry : _tournamentQueues.entrySet()) {