return msg;
}
private GameMessage newGameMessage() {
GameSetupMessage gsm = new GameSetupMessage(game.getGameId(), game.getCustomRules(), game.getExpansions(), game.getCapabilityClasses());
GameMessage gm = new GameMessage(game.getGameId(), "", gameStarted ? GameState.RUNNING : GameState.OPEN, gsm);
List<SlotMessage> slotMsgs = new ArrayList<>();
for (ServerPlayerSlot slot : slots) {
if (slot != null) {
SlotMessage sm = newSlotMessage(slot);
slotMsgs.add(sm);
}
}
gm.setSlots(slotMsgs.toArray(new SlotMessage[slotMsgs.size()]));
if (snapshot != null) {
try {
gm.setSnapshot(snapshot.saveToString());
} catch (TransformerException | IOException e) {
logger.error(e.getMessage(), e);
}
}
return gm;