Replay JSON Summary Version 2

- Added last site reached for both players
- Added game timing info + player used time
- Restructured the last niggling bits of game creation that were inconsistent for hidden vs private
- Moved hidden table definition to a parameter on game settings creation, which moved the hard-coded Glacial hiddenness all the way up to the Handler level
This commit is contained in:
Christian 'ketura' McCarty
2023-06-21 01:53:14 -05:00
parent 7e80e216bb
commit 4b9bf9651b
14 changed files with 112 additions and 110 deletions

2
.gitignore vendored
View File

@@ -20,3 +20,5 @@ logs/*
remote-sync
replay
!replay/.placeholder
logs/nohup.out
gemp-lotr/docker/docker-compose.yml

View File

@@ -11,10 +11,7 @@ import com.gempukku.lotro.db.vo.League;
import com.gempukku.lotro.draft.DraftChannelVisitor;
import com.gempukku.lotro.game.*;
import com.gempukku.lotro.game.formats.LotroFormatLibrary;
import com.gempukku.lotro.hall.HallChannelVisitor;
import com.gempukku.lotro.hall.HallCommunicationChannel;
import com.gempukku.lotro.hall.HallException;
import com.gempukku.lotro.hall.HallServer;
import com.gempukku.lotro.hall.*;
import com.gempukku.lotro.league.LeagueSerieData;
import com.gempukku.lotro.league.LeagueService;
import com.gempukku.lotro.logic.GameUtils;
@@ -144,6 +141,9 @@ public class HallRequestHandler extends LotroServerRequestHandler implements Uri
boolean isPrivate = (isPrivateVal != null ? Boolean.valueOf(isPrivateVal) : false);
String isInviteOnlyVal = getFormParameterSafely(postDecoder, "isInviteOnly");
boolean isInviteOnly = (isInviteOnlyVal != null ? Boolean.valueOf(isInviteOnlyVal) : false);
//To prevent annoyance, super long glacial games are hidden from everyone except
// the participants and admins.
boolean isHidden = timer.toLowerCase().equals(GameTimer.GLACIAL_TIMER.name());
Player resourceOwner = getResourceOwnerSafely(request, participantId);
@@ -175,7 +175,7 @@ public class HallRequestHandler extends LotroServerRequestHandler implements Uri
try {
_hallServer.createNewTable(format, resourceOwner, deckName, timer, desc, isInviteOnly, isPrivate);
_hallServer.createNewTable(format, resourceOwner, deckName, timer, desc, isInviteOnly, isPrivate, isHidden);
responseWriter.writeXmlResponse(null);
}
catch (HallException e) {
@@ -183,7 +183,7 @@ public class HallRequestHandler extends LotroServerRequestHandler implements Uri
{
//try again assuming it's a new player with one of the default library decks selected
Player librarian = _playerDao.getPlayer("Librarian");
_hallServer.spoofNewTable(format, resourceOwner, librarian, deckName, timer, "(New Player) " + desc, isInviteOnly, isPrivate);
_hallServer.spoofNewTable(format, resourceOwner, librarian, deckName, timer, "(New Player) " + desc, isInviteOnly, isPrivate, isHidden);
responseWriter.writeXmlResponse(null);
return;
}

View File

@@ -9,6 +9,7 @@ public class DBDefs {
public static class GameHistory {
public int id;
public String gameId;
public String winner;
public int winnerId;
@@ -31,6 +32,15 @@ public class DBDefs {
public String tournament;
public int winner_site;
public int loser_site;
public String game_length_type;
public int max_game_time;
public int game_timeout;
public int winner_clock_remaining;
public int loser_clock_remaining;
public int replay_version = -1;
}

View File

@@ -24,7 +24,7 @@ public class DbGameHistoryDAO implements GameHistoryDAO {
_dbAccess = dbAccess;
}
public void addGameHistory(String winner, int winnerId, String loser, int loserId, String winReason, String loseReason, String winRecordingId, String loseRecordingId,
public int addGameHistory(String winner, int winnerId, String loser, int loserId, String winReason, String loseReason, String winRecordingId, String loseRecordingId,
String formatName, String tournament, String winnerDeckName, String loserDeckName, ZonedDateTime startDate, ZonedDateTime endDate, int replayVersion) {
try {
Sql2o db = new Sql2o(_dbAccess.getDataSource());
@@ -54,8 +54,11 @@ public class DbGameHistoryDAO implements GameHistoryDAO {
.addParameter("end_date", endDate.format(_dateTimeFormat))
.addParameter("version", replayVersion);
query.executeUpdate();
int id = query.executeUpdate()
.getKey(Integer.class);
conn.commit();
return id;
}
} catch (Exception ex) {
throw new RuntimeException("Unable to insert game history", ex);

View File

@@ -7,7 +7,7 @@ import java.time.ZonedDateTime;
import java.util.List;
public interface GameHistoryDAO {
public void addGameHistory(String winner, int winnerId, String loser, int loserId, String winReason, String loseReason, String winRecordingId, String loseRecordingId, String formatName, String tournament, String winnerDeckName, String loserDeckName, ZonedDateTime startDate, ZonedDateTime endDate, int version);
public int addGameHistory(String winner, int winnerId, String loser, int loserId, String winReason, String loseReason, String winRecordingId, String loseRecordingId, String formatName, String tournament, String winnerDeckName, String loserDeckName, ZonedDateTime startDate, ZonedDateTime endDate, int version);
public DBDefs.GameHistory getGameHistory(String recordID);
public boolean doesReplayIDExist(String id);
public List<DBDefs.GameHistory> getGameHistoryForPlayer(Player player, int start, int count);

View File

@@ -17,19 +17,21 @@ public class GameHistoryService {
_gameHistoryDAO = gameHistoryDAO;
}
public void addGameHistory(DBDefs.GameHistory gh) {
addGameHistory(gh.winner, gh.winnerId, gh.loser, gh.loserId, gh.win_reason, gh.lose_reason, gh.win_recording_id, gh.lose_recording_id,
public int addGameHistory(DBDefs.GameHistory gh) {
return addGameHistory(gh.winner, gh.winnerId, gh.loser, gh.loserId, gh.win_reason, gh.lose_reason, gh.win_recording_id, gh.lose_recording_id,
gh.format_name, gh.tournament, gh.winner_deck_name, gh.loser_deck_name, gh.start_date, gh.end_date, gh.replay_version);
}
public void addGameHistory(String winner, int winnerId, String loser, int loserId, String winReason, String loseReason, String winRecordingId, String loseRecordingId, String formatName, String tournament, String winnerDeckName, String loserDeckName, ZonedDateTime startDate, ZonedDateTime endDate, int version) {
_gameHistoryDAO.addGameHistory(winner, winnerId, loser, loserId, winReason, loseReason, winRecordingId, loseRecordingId, formatName, tournament, winnerDeckName, loserDeckName, startDate, endDate, version);
public int addGameHistory(String winner, int winnerId, String loser, int loserId, String winReason, String loseReason, String winRecordingId, String loseRecordingId, String formatName, String tournament, String winnerDeckName, String loserDeckName, ZonedDateTime startDate, ZonedDateTime endDate, int version) {
int id = _gameHistoryDAO.addGameHistory(winner, winnerId, loser, loserId, winReason, loseReason, winRecordingId, loseRecordingId, formatName, tournament, winnerDeckName, loserDeckName, startDate, endDate, version);
Integer winnerCount = _playerGameCount.get(winner);
Integer loserCount = _playerGameCount.get(loser);
if (winnerCount != null)
_playerGameCount.put(winner, winnerCount + 1);
if (loserCount != null)
_playerGameCount.put(loser, loserCount + 1);
return id;
}
public boolean doesReplayIDExist(String id) {

View File

@@ -57,7 +57,11 @@ public class GameRecorder {
return (winnerName, winReason, loserName, loseReason) -> {
final ZonedDateTime endDate = ZonedDateTime.now(ZoneOffset.UTC);
var time = lotroGame.getTimeSettings();
var clocks = lotroGame.getPlayerClocks();
var gameInfo = new DBDefs.GameHistory() {{
gameId = lotroGame.getGameId();
winner = winnerName;
winnerId = _playerDAO.getPlayer(winnerName).getId();
loser = loserName;
@@ -79,12 +83,21 @@ public class GameRecorder {
tournament = tournamentName;
//Update this version as needed
winner_site = lotroGame.getGame().getGameState().getPlayerPosition(winner);
loser_site = lotroGame.getGame().getGameState().getPlayerPosition(winner);
game_length_type = time.name();
max_game_time = time.maxSecondsPerPlayer();
game_timeout = time.maxSecondsPerDecision();
winner_clock_remaining = clocks.getOrDefault(winnerName, -1);
loser_clock_remaining = clocks.getOrDefault(loserName, -1);
//Update this version as needed; note that this is the REPLAY FORMAT, not the JSON summary
replay_version = 1;
}};
var playerRecordingId = saveRecordedChannels(recordingChannels, gameInfo, decks);
_gameHistoryService.addGameHistory(gameInfo);
gameInfo.id = _gameHistoryService.addGameHistory(gameInfo);
if(format.isPlaytest())
{
@@ -110,9 +123,9 @@ public class GameRecorder {
private File getRecordingFileVersion1(String playerId, String gameId, ZonedDateTime startDate) {
var gameReplayFolder = new File(AppConfig.getProperty("application.root"), "replay");
//This dumbass formatting output is because anything that otherwise intersects with the
//This dumbass formatting output is because anything that otherwise interacts with the
// year subfield appears to trigger a JVM segfault in the guts of the java ecosystem.
// Super-dumb. Don't touch.
// Super-dumb. Don't touch these two lines.
var year = startDate.format(DateTimeFormatter.ofPattern("yyyy"));
var month = startDate.format(DateTimeFormatter.ofPattern("MM"));

View File

@@ -8,6 +8,7 @@ import com.gempukku.lotro.communication.GameStateListener;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.state.GameCommunicationChannel;
import com.gempukku.lotro.game.state.GameEvent;
import com.gempukku.lotro.hall.GameTimer;
import com.gempukku.lotro.logic.GameUtils;
import com.gempukku.lotro.logic.decisions.AwaitingDecision;
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
@@ -32,8 +33,8 @@ public class LotroGameMediator {
private final Map<String, LotroDeck> _playerDecks = new HashMap<>();
private final String _gameId;
private final int _maxSecondsForGamePerPlayer;
private final int _maxSecondsPerDecision;
private GameTimer _timeSettings;
private final boolean _allowSpectators;
private final boolean _cancellable;
private final boolean _showInGameHall;
@@ -44,11 +45,10 @@ public class LotroGameMediator {
private int _channelNextIndex = 0;
private volatile boolean _destroyed;
public LotroGameMediator(String gameId, LotroFormat lotroFormat, LotroGameParticipant[] participants, LotroCardBlueprintLibrary library, int maxSecondsForGamePerPlayer,
int maxSecondsPerDecision, boolean allowSpectators, boolean cancellable, boolean showInGameHall) {
public LotroGameMediator(String gameId, LotroFormat lotroFormat, LotroGameParticipant[] participants, LotroCardBlueprintLibrary library,
GameTimer gameTimer, boolean allowSpectators, boolean cancellable, boolean showInGameHall) {
_gameId = gameId;
_maxSecondsForGamePerPlayer = maxSecondsForGamePerPlayer;
_maxSecondsPerDecision = maxSecondsPerDecision;
_timeSettings = gameTimer;
_allowSpectators = allowSpectators;
_cancellable = cancellable;
this._showInGameHall = showInGameHall;
@@ -83,6 +83,8 @@ public class LotroGameMediator {
return _gameId;
}
public DefaultLotroGame getGame() { return _lotroGame; }
public boolean isAllowSpectators() {
return _allowSpectators;
}
@@ -257,7 +259,7 @@ public class LotroGameMediator {
// Channel is stale (user no longer connected to game, to save memory, we remove the channel
// User can always reconnect and establish a new channel
GameCommunicationChannel channel = playerChannels.getValue();
if (currentTime > channel.getLastAccessed() + _maxSecondsPerDecision*1000) {
if (currentTime > channel.getLastAccessed() + _timeSettings.maxSecondsPerDecision() * 1000L) {
_lotroGame.removeGameStateListener(channel);
_communicationChannels.remove(playerId);
}
@@ -267,7 +269,7 @@ public class LotroGameMediator {
for (Map.Entry<String, Long> playerDecision : new HashMap<>(_decisionQuerySentTimes).entrySet()) {
String playerId = playerDecision.getKey();
long decisionSent = playerDecision.getValue();
if (currentTime > decisionSent + _maxSecondsPerDecision*1000) {
if (currentTime > decisionSent + _timeSettings.maxSecondsPerDecision() * 1000L) {
addTimeSpentOnDecisionToUserClock(playerId);
_lotroGame.playerLost(playerId, "Player decision timed-out");
}
@@ -275,7 +277,7 @@ public class LotroGameMediator {
for (Map.Entry<String, Integer> playerClock : _playerClocks.entrySet()) {
String player = playerClock.getKey();
if (_maxSecondsForGamePerPlayer - playerClock.getValue() - getCurrentUserPendingTime(player) < 0) {
if (_timeSettings.maxSecondsPerPlayer() - playerClock.getValue() - getCurrentUserPendingTime(player) < 0) {
addTimeSpentOnDecisionToUserClock(player);
_lotroGame.playerLost(player, "Player run out of time");
}
@@ -385,7 +387,7 @@ public class LotroGameMediator {
Map<String, Integer> secondsLeft = new HashMap<>();
for (Map.Entry<String, Integer> playerClock : _playerClocks.entrySet()) {
String playerClockName = playerClock.getKey();
secondsLeft.put(playerClockName, _maxSecondsForGamePerPlayer - playerClock.getValue() - getCurrentUserPendingTime(playerClockName));
secondsLeft.put(playerClockName, _timeSettings.maxSecondsPerPlayer() - playerClock.getValue() - getCurrentUserPendingTime(playerClockName));
}
visitor.visitClock(secondsLeft);
} finally {
@@ -416,7 +418,7 @@ public class LotroGameMediator {
Map<String, Integer> secondsLeft = new HashMap<>();
for (Map.Entry<String, Integer> playerClock : _playerClocks.entrySet()) {
String playerId = playerClock.getKey();
secondsLeft.put(playerId, _maxSecondsForGamePerPlayer - playerClock.getValue() - getCurrentUserPendingTime(playerId));
secondsLeft.put(playerId, _timeSettings.maxSecondsPerPlayer() - playerClock.getValue() - getCurrentUserPendingTime(playerId));
}
visitor.visitClock(secondsLeft);
} finally {
@@ -440,7 +442,7 @@ public class LotroGameMediator {
}
}
private int getCurrentUserPendingTime(String participantId) {
public int getCurrentUserPendingTime(String participantId) {
if (!_decisionQuerySentTimes.containsKey(participantId))
return 0;
long queryTime = _decisionQuerySentTimes.get(participantId);
@@ -448,6 +450,12 @@ public class LotroGameMediator {
return (int) ((currentTime - queryTime) / 1000);
}
public GameTimer getTimeSettings() {
return _timeSettings;
}
public Map<String, Integer> getPlayerClocks() { return Collections.unmodifiableMap(_playerClocks); }
public String getPlayerPositions() {
StringBuilder stringBuilder = new StringBuilder();
for (String player : _playersPlaying) {

View File

@@ -100,18 +100,18 @@ public class LotroServer extends AbstractServer {
_chatServer.createChatRoom(getChatRoomName(gameId), false, 30, false, null);
// Allow spectators for leagues, but not tournaments
// Also: yes, yes, we're very proud that you found a way to assign this boolean in one line.
// The point of the code setting it like this is to make each case painfully explicit.
boolean spectate = true;
if(gameSettings.getLeague() != null) {
spectate = true;
}
else if(gameSettings.isCompetitive()) {
spectate = false;
}
if(gameSettings.isPrivateGame()) {
else if(gameSettings.isCompetitive() || gameSettings.isPrivateGame() || gameSettings.isHiddenGame()) {
spectate = false;
}
LotroGameMediator lotroGameMediator = new LotroGameMediator(gameId, gameSettings.getLotroFormat(), participants, _lotroCardBlueprintLibrary,
gameSettings.getMaxSecondsPerPlayer(), gameSettings.getMaxSecondsPerDecision(),
gameSettings.getTimeSettings(),
spectate, !gameSettings.isCompetitive(), gameSettings.isHiddenGame());
lotroGameMediator.addGameResultListener(
new GameResultListener() {

View File

@@ -23,7 +23,9 @@ public class ReplayMetadata {
public List<String> StartingFellowship = new ArrayList<>();
}
public Integer MetadataVersion = 1;
//Version 1: First tracked version; original version was completely different
//Version 2: Adding the highest achieved sites by player, game IDs, and game timer length information
public Integer MetadataVersion = 2;
public DBDefs.GameHistory GameReplayInfo;

View File

@@ -13,15 +13,13 @@ public class GameSettings {
private final boolean competitive;
private final boolean privateGame;
private final boolean hiddenGame;
private final String timerName;
private final int maxSecondsPerPlayer;
private final int maxSecondsPerDecision;
private final GameTimer timeSettings;
private final String userDescription;
private final boolean isInviteOnly;
public GameSettings(CollectionType collectionType, LotroFormat lotroFormat, League league, LeagueSerieData leagueSerie,
boolean competitive, boolean privateGame, boolean hiddenGame, String timerName, int maxSecondsPerPlayer, int maxSecondsPerDecision,
String description, boolean isInviteOnly) {
boolean competitive, boolean privateGame, boolean isInviteOnly, boolean hiddenGame,
GameTimer timer, String description) {
this.collectionType = collectionType;
this.lotroFormat = lotroFormat;
this.league = league;
@@ -29,9 +27,7 @@ public class GameSettings {
this.competitive = competitive;
this.privateGame = privateGame;
this.hiddenGame = hiddenGame;
this.timerName = timerName;
this.maxSecondsPerPlayer = maxSecondsPerPlayer;
this.maxSecondsPerDecision = maxSecondsPerDecision;
this.timeSettings = timer;
this.userDescription = description;
this.isInviteOnly = isInviteOnly;
}
@@ -64,17 +60,7 @@ public class GameSettings {
return hiddenGame;
}
public int getMaxSecondsPerPlayer() {
return maxSecondsPerPlayer;
}
public int getMaxSecondsPerDecision() {
return maxSecondsPerDecision;
}
public String getTimerName() {
return timerName;
}
public GameTimer getTimeSettings() { return timeSettings; }
public String getUserDescription() { return userDescription; }

View File

@@ -1,31 +1,26 @@
package com.gempukku.lotro.hall;
public class GameTimer {
private final boolean longGame;
private final String name;
private final int maxSecondsPerPlayer;
private final int maxSecondsPerDecision;
public record GameTimer(boolean longGame, String name, int maxSecondsPerPlayer, int maxSecondsPerDecision) {
public GameTimer(boolean longGame, String name, int maxSecondsPerPlayer, int maxSecondsPerDecision) {
this.longGame = longGame;
this.name = name;
this.maxSecondsPerPlayer = maxSecondsPerPlayer;
this.maxSecondsPerDecision = maxSecondsPerDecision;
}
public static final GameTimer DEFAULT_TIMER = new GameTimer(false, "Default", 60 * 80, 60 * 5);
public static final GameTimer BLITZ_TIMER = new GameTimer(false, "Blitz!", 60 * 30, 60 * 5);
public static final GameTimer SLOW_TIMER = new GameTimer(false, "Slow", 60 * 120, 60 * 10);
public static final GameTimer GLACIAL_TIMER = new GameTimer(true, "Glacial", 60 * 60 * 24 * 3, 60 * 60 * 24);
// 5 minutes timeout, 40 minutes per game per player
public static final GameTimer COMPETITIVE_TIMER = new GameTimer(false, "Competitive", 60 * 40, 60 * 5);
public static final GameTimer TOURNAMENT_TIMER = new GameTimer(false, "Tournament", 60 * 40, 60 * 5);
public boolean isLongGame() {
return longGame;
}
public String getName() {
return name;
}
public int getMaxSecondsPerPlayer() {
return maxSecondsPerPlayer;
}
public int getMaxSecondsPerDecision() {
return maxSecondsPerDecision;
public static GameTimer ResolveTimer(String timer) {
if (timer != null) {
switch (timer.toLowerCase()) {
case "blitz":
return GameTimer.BLITZ_TIMER;
case "slow":
return GameTimer.SLOW_TIMER;
case "glacial":
return GameTimer.GLACIAL_TIMER;
}
}
return GameTimer.DEFAULT_TIMER;
}
}

View File

@@ -30,12 +30,7 @@ import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
public class HallServer extends AbstractServer {
private static final GameTimer DEFAULT_TIMER = new GameTimer(false, "Default", 60 * 80, 60 * 5);
private static final GameTimer BLITZ_TIMER = new GameTimer(false, "Blitz!", 60 * 30, 60 * 5);
private static final GameTimer SLOW_TIMER = new GameTimer(false, "Slow", 60 * 120, 60 * 10);
private static final GameTimer GLACIAL_TIMER = new GameTimer(true, "Glacial", 60 * 60 * 24 * 3, 60 * 60 * 24);
// 5 minutes timeout, 40 minutes per game per player
private static final GameTimer COMPETITIVE_TIMER = new GameTimer(false, "Competitive", 60 * 40, 60 * 5);
private static final int _playerTableInactivityPeriod = 1000 * 20 ; // 20 seconds
@@ -344,11 +339,11 @@ public class HallServer extends AbstractServer {
/**
* @return If table created, otherwise <code>false</code> (if the user already is sitting at a table or playing).
*/
public void createNewTable(String type, Player player, String deckName, String timer, String description, boolean isInviteOnly, boolean isPrivate) throws HallException {
public void createNewTable(String type, Player player, String deckName, String timer, String description, boolean isInviteOnly, boolean isPrivate, boolean isHidden) throws HallException {
if (_shutdown)
throw new HallException("Server is in shutdown mode. Server will be restarted after all running games are finished.");
GameSettings gameSettings = createGameSettings(type, timer, description, isInviteOnly, isPrivate);
GameSettings gameSettings = createGameSettings(type, timer, description, isInviteOnly, isPrivate, isHidden);
LotroDeck lotroDeck = validateUserAndDeck(gameSettings.getLotroFormat(), player, deckName, gameSettings.getCollectionType());
@@ -364,11 +359,11 @@ public class HallServer extends AbstractServer {
}
}
public void spoofNewTable(String type, Player player, Player librarian, String deckName, String timer, String description, boolean isInviteOnly, boolean isPrivate) throws HallException {
public void spoofNewTable(String type, Player player, Player librarian, String deckName, String timer, String description, boolean isInviteOnly, boolean isPrivate, boolean isHidden) throws HallException {
if (_shutdown)
throw new HallException("Server is in shutdown mode. Server will be restarted after all running games are finished.");
GameSettings gameSettings = createGameSettings(type, timer, description, isInviteOnly, isPrivate);
GameSettings gameSettings = createGameSettings(type, timer, description, isInviteOnly, isPrivate, isHidden);
LotroDeck lotroDeck = validateUserAndDeck(gameSettings.getLotroFormat(), librarian, deckName, gameSettings.getCollectionType());
@@ -384,12 +379,12 @@ public class HallServer extends AbstractServer {
}
}
private GameSettings createGameSettings(String type, String timer, String description, boolean isInviteOnly, boolean isPrivate) throws HallException {
private GameSettings createGameSettings(String type, String timer, String description, boolean isInviteOnly, boolean isPrivate, boolean isHidden) throws HallException {
League league = null;
LeagueSerieData leagueSerie = null;
CollectionType collectionType = _defaultCollectionType;
LotroFormat format = _formatLibrary.getHallFormats().get(type);
GameTimer gameTimer = resolveTimer(timer);
GameTimer gameTimer = GameTimer.ResolveTimer(timer);
if (format == null) {
// Maybe it's a league format?
@@ -414,7 +409,7 @@ public class HallServer extends AbstractServer {
format = leagueSerie.getFormat();
collectionType = leagueSerie.getCollectionType();
gameTimer = COMPETITIVE_TIMER;
gameTimer = GameTimer.COMPETITIVE_TIMER;
}
}
// It's not a normal format and also not a league one
@@ -422,21 +417,7 @@ public class HallServer extends AbstractServer {
throw new HallException("This format is not supported: " + type);
return new GameSettings(collectionType, format, league, leagueSerie,
league != null, isPrivate, gameTimer.isLongGame(), gameTimer.getName(), gameTimer.getMaxSecondsPerPlayer(), gameTimer.getMaxSecondsPerDecision(), description, isInviteOnly);
}
private GameTimer resolveTimer(String timer) {
if (timer != null) {
switch (timer) {
case "blitz":
return BLITZ_TIMER;
case "slow":
return SLOW_TIMER;
case "glacial":
return GLACIAL_TIMER;
}
}
return DEFAULT_TIMER;
league != null, isPrivate, isInviteOnly, isHidden, gameTimer, description);
}
public boolean joinQueue(String queueId, Player player, String deckName) throws HallException, SQLException, IOException {
@@ -751,7 +732,7 @@ public class HallServer extends AbstractServer {
if (league != null)
return league.getName() + " - " + table.getGameSettings().getLeagueSerie().getName();
else
return "Casual - " + table.getGameSettings().getTimerName();
return "Casual - " + table.getGameSettings().getTimeSettings().name();
}
private void createGameFromTable(GameTable gameTable) {
@@ -885,7 +866,7 @@ public class HallServer extends AbstractServer {
private HallTournamentCallback(Tournament tournament) {
_tournament = tournament;
tournamentGameSettings = new GameSettings(null, _formatLibrary.getFormat(_tournament.getFormat()),
null, null, true, false, false, "Tournament", 60 * 40, 60 * 5, null, false);
null, null, true, false, false, false, GameTimer.TOURNAMENT_TIMER, null);
}
@Override

View File

@@ -251,6 +251,6 @@ public class TableHolder {
if (league != null)
return league.getName() + " - " + table.getGameSettings().getLeagueSerie().getName();
else
return "Casual - " + table.getGameSettings().getTimerName();
return "Casual - " + table.getGameSettings().getTimeSettings().name();
}
}