Hi all, I am posting this here, to see if it might be useful to others with the same issue.

Basically my games go well, but after 10-30 minutes, it shows a screen that 1 player has disconnected. after 2 minutes they are kicked. It shows that the established connection has been cut between my pc and another pc.

This is most likely caused by ISP's using CGNAT.

You might say, try ICE-Adapter. It is basically a Application, that takes all FAF Game data, and uses a WebRTC p2p library, to connect to peers. This most likely will not fix my problem, as I have no trouble connecting to peers, but trouble with established connections getting cut.

So my solution is to force the FA Forever client to use a relay server, and force NO direct connections.

The ICE adapter will extremly likely fix your problem as it would detect the lost connection, attempt to reconnect and in case it doesnt work fall back to a relay candidate.

The solution you've presented here is indeed working, I have been privately telling this to people with constant connection problems aswell, there is only the small problem that it costs FAF money if a lot of people do that, so we might delete this thread.

The old (3rd) ICE adapter was written by muellni in c++, that's the ice-adapter repo. I don't understand that one either.

I have written a test server and client for debugging the adapter and after a few months of runnikg tests we finally got it working. Everything seems to be fine, it only slows down the game on slower connections. This is due to WebRTC enforcing SRTP (if I remember correctly) with DTLS 1.2 encryption. This get's an issue as FA is sending between 15-45 bytes per packet (on average) therefore with DTLS 1.2 (27 byte overhead) effectively doubling the required bandwidth.

I therefore rewrote the adaptee using a different library, in this case ice4j using Java. The adapter can be found in the FAForever/java-ice-adapter repository. Currently it looks extremly promising, there are just some problems with the python server/client.

There is also a java-ice-adapter branch in the java client using this adapter. Running two different connectivity solutions at the same time as been decided to be to complicated.

Both clients do already support ICE in a different build when connecting to a server supporting ice (e. g. test.faforever.com).

If you are interested in contributing to FAF please tell me, there are a lot of different sub projects in FAF, from reverse engineering over UID (C), all the java projects (java client (downlords client), java server, api), python client and server, python replay server to game coding (lua) and the website, discord bot, unit db and faf tools (all JS). Also the galactic war (web) frontend may need help soon.

Hi, thank you for pointing me to Ice-Adaptor Java Repo. I installed NetBeans, Gradle Plugin, Jdk, and built client-1.0-SNAPSHOT.jar.I made a run.bat with following content "E:\jdk\bin\java.exe -jar client-1.0-SNAPSHOT.jar" --help

It failed with:"Exception in thread "main" java.lang.NoClassDefFoundError: net/ScenarioOptionsMessage at client.TestClient.<clinit>(TestClient.java:31)"

However this means any game hosted will not be visible by the public, and only developers?

Maybe it would be possible to create a mod, named "ice4", which would include the faf-adaptor-proxy.exe, therefore making the game visible to public, as well as allowing public to connect, as they would automatically download mod files?

The client you tried to build is a simple test client that manages the ice adapter, emulates the games network behaviour, tests it and sends all logging data to the server. The server software used with this is the server project in the repo you cloned. It is just intended for testing the ICE adapter. It has nothing to do with FAF, it doesn't launch the game, it 's just for isolating and running automated tests on the ice adapter without users having to do anything or having to send logs/tell what they see.

If you want to play with the adapter you will have to run an actual FAF client that supports the ICE adapter (and includes an actual build of the java-ice-adapter repo -> ice-adapter project). Downlords client currently does that using the java-ice-adapter branch. There is also a build of 0.9.0-beta-RC8, but it's marked as a draft so not visible. I also don't know if everything is running on the java test server(downlord's server running the faf-java-server).

The FAF test server is currently running the python server with an ICE branch I think, but afaik the java-api is currently somewhat broken, so the java client (downlords client) won't be able to connect.

You should though be able to use the python client with an ice branch (the release you linked should work). It should connect to the test server, log in using an existing FAF user account and any pw.

It is not possible to run ICE and non ICE clients on the same server at the same time as it requires support from the server. (not just the ICE adapter, deactivating the old connectivity code which is necessary for running with ICE breaks old non ICE clients)There are some last issues to be investigated and we will be doing an public ICE test weekend on the production server soon. (switching the entire server to ICE only)

Well with original client i never had a connection loss to all players, with downlord his client in game already 2 times i lose conn to everyone while i am still in lobby and still can internet. This is weird. Not gone use the client anymore.

Thank you for the detailed description of the project and its codebase.Having had a look at the code, I can see how complicated it is, how interconnected it is, and why it is difficult to make changes.If anything I have a new appreciation of the time developers must have spent to make it happen.

I think the game disconnection issues are caused by packet loss. ie in TCP this would cause Re-transmission Packets. UDP does not have this, it just fails.Looking at my Packet Capture, I have constant re-transmission even on youtube, every few seconds. So I assume alot of other customers are having disconnects due to terrible ISP's and the internet transport providers.

I hope that the D0wnlords 0.9.0-beta-RC8 Test Client becomes common, so that the community can transition to new technology, and increased stability and increased customer base.

Sadly I am not able to contribute to development as I am not proficient in OO and Java Libraries.I am more used to MVC such as Angularjs. M=Simple 2d Arrays of data, C=a few lines of code that sync arrays with database server, V=Html files that bind to Models.