diff --git a/src/main/java/com/faforever/client/fa/relay/ice/IceAdapterImpl.java b/src/main/java/com/faforever/client/fa/relay/ice/IceAdapterImpl.java index 95d56dfcf8..7269f14357 100644 --- a/src/main/java/com/faforever/client/fa/relay/ice/IceAdapterImpl.java +++ b/src/main/java/com/faforever/client/fa/relay/ice/IceAdapterImpl.java @@ -35,7 +35,6 @@ import java.io.IOException; import java.lang.reflect.Method; import java.lang.reflect.Proxy; -import java.net.ServerSocket; import java.nio.file.Path; import java.util.ArrayList; import java.util.Collection; @@ -131,15 +130,8 @@ public CompletableFuture start(int gameId) { return CompletableFuture.supplyAsync(() -> { Path workDirectory = Path.of(System.getProperty("nativeDir", "lib")).toAbsolutePath(); - int adapterPort; - int gpgPort; - try (ServerSocket adapterTestSocket = new ServerSocket(0); - ServerSocket gpgTestSocket = new ServerSocket(0)) { - adapterPort = adapterTestSocket.getLocalPort(); - gpgPort = gpgTestSocket.getLocalPort(); - } catch (IOException exception) { - throw new CompletionException("Unable to find open port for ICE and GPG", exception); - } + int adapterPort = 15666; + int gpgPort = 17666; List cmd = buildCommand(workDirectory, adapterPort, gpgPort, gameId); try { @@ -227,7 +219,7 @@ List buildCommand(Path workDirectory, int adapterPort, int gpgPort, int List standardIceOptions = List.of( "-cp", classpath, - "com.faforever.iceadapter.IceAdapter", + "com.faforever.ice.KiaApplication", "--id", String.valueOf(currentPlayer.getId()), "--game-id", String.valueOf(gameId), "--login", currentPlayer.getUsername(),