diff --git a/game-app/game-core/src/main/java/games/strategy/engine/framework/network/ui/SetMapClientAction.java b/game-app/game-core/src/main/java/games/strategy/engine/framework/network/ui/SetMapClientAction.java index e969940fe19..2c8583f3b53 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/framework/network/ui/SetMapClientAction.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/framework/network/ui/SetMapClientAction.java @@ -3,7 +3,6 @@ import com.google.common.base.Preconditions; import games.strategy.engine.framework.startup.mc.IServerStartupRemote; import java.awt.Component; -import java.util.Collection; import java.util.List; import java.util.stream.Collectors; import javax.swing.DefaultComboBoxModel; @@ -20,12 +19,11 @@ public class SetMapClientAction { private final IServerStartupRemote serverStartupRemote; public SetMapClientAction( - final Component parent, - final IServerStartupRemote serverStartupRemote, - final Collection games) { + final Component parent, final IServerStartupRemote serverStartupRemote) { this.parent = JOptionPane.getFrameForComponent(parent); this.serverStartupRemote = serverStartupRemote; - this.availableGames = games.stream().sorted().collect(Collectors.toList()); + this.availableGames = + serverStartupRemote.getAvailableGames().stream().sorted().collect(Collectors.toList()); } public void run() { diff --git a/game-app/game-core/src/main/java/games/strategy/engine/framework/startup/mc/ClientModel.java b/game-app/game-core/src/main/java/games/strategy/engine/framework/startup/mc/ClientModel.java index e86f79b35c8..5ca9b532ad5 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/framework/startup/mc/ClientModel.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/framework/startup/mc/ClientModel.java @@ -300,10 +300,6 @@ private IServerStartupRemote getServerStartup() { return (IServerStartupRemote) messengers.getRemote(ServerModel.SERVER_REMOTE_NAME); } - private Collection getAvailableServerGames() { - return getServerStartup().getAvailableGames(); - } - /** Resets stats and nulls out references, keeps chat alive. */ public void cancel() { gameSelectorModel.setGameData(gameDataOnStartup); @@ -465,8 +461,7 @@ public void setMap(final Component parent) { Preconditions.checkState(SwingUtilities.isEventDispatchThread(), "Should be run on EDT!"); ThreadRunner.runInNewThread( () -> { - final var action = - new SetMapClientAction(parent, getServerStartup(), getAvailableServerGames()); + final var action = new SetMapClientAction(parent, getServerStartup()); SwingUtilities.invokeLater(action::run); }); }