This feature addresses the change of IP addresses due to
temporary failure of internet connections.
for example a mandatory disconnect after max 24 hours is
common in some parts of the world.
the issue then of course is that the various instances of
FA.exe try to communicate with the obsolete IP address in
vain.
how it works so far:
when you join a game, the FAForever client launches
FA.exe which then exchanges UDP packets with faforever.com
using a GPGnet protocol. Via this protocol FA.exe receives
information about the other peers in the game and then
starts exchanging UDP packets directly with the peers via
a different GPGnet protocol that is used during the game ("lobbyCom").
when the IP address of a peer changes, there is no mechanism
by which all others can stay up to date and the connection
is lost.
the solution is not complicated:
the player whose IP changed has to send updates to all peers
to inform them of the new address.
To facilitate this, all lobbyCom connections are proxied through
the FAForever client. That is, FA.exe talks to localhost:port
and the lobby sends the datagram to the real peers. The same
method is used for the current proxy with the difference that
the lobby does not send datagrams to the peers directly, but
to the central proxy server. To clarify: the central proxy
isnt involved in this feature. (to see what i am talking about,
search for "ConnectToProxy" in src/fa/relayserver.py)
First the lobby has to detect that the address has changed.
2 things have to be true: no data arrives from either the
peers or the server in a reasonable time.
In that case a new connection is made to the server via TCP
(falobby protocol). Optionally the server can confirm that
the IP address has changed indeed.
When the server is reachable again the lobby sends UDP
datagrams to all peers. those datagrams are received by
the remote lobbies, but are not forwarded to FA.exe.
And they do not conform to the lobbyCom protocol.
Since they come from a yet unknown sender IP, the lobby
can distinguish them from lobbyCom traffic.
The remote lobbies then retrieve the updated IP address
and exchange of lobbyCom messages can continue.
Bonus: since FA.exe only ever talks to localhost, IPv6 would
not be a problem.
changing IP address makes up 99% of disconnects for me,
the other 1% being BSOD or tripping over the power cable,
so i expect that it will address a significant portion
of problems.
EDIT: actually the distribution of all failure causes is approx
90% Ip change, 9% simulation freeze, 1% rest.
comments?