Skip to content

Commit

Permalink
Remove preference of "official servers"
Browse files Browse the repository at this point in the history
All servers the client passes to the ICE adapter are to be used.
Especially with Xirsys added to the pool.
  • Loading branch information
Brutus5000 committed Nov 17, 2023
1 parent 2fbfe30 commit 7829ced
Showing 1 changed file with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,21 +165,8 @@ private List<IceServer> getViableIceServers() {
return allIceServers;
}

List<IceServer> fafIceServers = allIceServers.stream()
.filter(server -> server.getTurnAddresses().stream()
.anyMatch(transportAddress -> transportAddress.getHostString().contains("faforever.com")))
.toList();
// Try official servers first
List<IceServer> 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<IceServer> viableIceServers = allIceServers.stream()
.filter(IceServer::hasAcceptableLatency)
.collect(Collectors.toList());
if (!viableIceServers.isEmpty()) {
Expand Down

0 comments on commit 7829ced

Please sign in to comment.