diff --git a/ice-adapter/src/main/java/com/faforever/iceadapter/ice/PeerIceModule.java b/ice-adapter/src/main/java/com/faforever/iceadapter/ice/PeerIceModule.java index 7d45e76..db1dd13 100644 --- a/ice-adapter/src/main/java/com/faforever/iceadapter/ice/PeerIceModule.java +++ b/ice-adapter/src/main/java/com/faforever/iceadapter/ice/PeerIceModule.java @@ -165,21 +165,8 @@ private List getViableIceServers() { return allIceServers; } - List fafIceServers = allIceServers.stream() - .filter(server -> server.getTurnAddresses().stream() - .anyMatch(transportAddress -> transportAddress.getHostString().contains("faforever.com"))) - .toList(); - // Try official servers first - List viableIceServers = fafIceServers.stream() - .filter(IceServer::hasAcceptableLatency) - .collect(Collectors.toList()); - if (!viableIceServers.isEmpty()) { - log.info("Using official ice servers: {}", viableIceServers.stream().map(it -> "[" + it.getTurnAddresses().stream().map(TransportAddress::toString).collect(Collectors.joining(", ")) + "]").collect(Collectors.joining(", "))); - return viableIceServers; - } - // Try servers with acceptable latency - viableIceServers = allIceServers.stream() + List viableIceServers = allIceServers.stream() .filter(IceServer::hasAcceptableLatency) .collect(Collectors.toList()); if (!viableIceServers.isEmpty()) { @@ -187,20 +174,6 @@ private List getViableIceServers() { return viableIceServers; } - // Try the closest server - Optional closestIceServer = allIceServers.stream() - .filter(server -> server.getRoundTripTime().join().isPresent()) - .min(Comparator.comparing(server -> server.getRoundTripTime().join().getAsDouble())); - if (closestIceServer.isPresent()) { - log.info("Using closest ice server: {}", closestIceServer.get().getTurnAddresses().stream().map(TransportAddress::toString).collect(Collectors.joining(", "))); - viableIceServers.add(closestIceServer.get()); - } - - if (!viableIceServers.isEmpty()) { - log.info("Using all reachable ice servers: {}", viableIceServers.stream().map(it -> "[" + it.getTurnAddresses().stream().map(TransportAddress::toString).collect(Collectors.joining(", ")) + "]").collect(Collectors.joining(", "))); - return viableIceServers; - } - log.info("Using all ice servers: {}", allIceServers.stream().map(it -> "[" + it.getTurnAddresses().stream().map(TransportAddress::toString).collect(Collectors.joining(", ")) + "]").collect(Collectors.joining(", "))); return allIceServers; }