FAForever / client

FAF Python Client
GNU General Public License v3.0
75 stars 88 forks source link

Unable to connect multiple LAN players #758

Open faf-nsw opened 7 years ago

faf-nsw commented 7 years ago

Problem: Four or more Internet connected Local Area Network (LAN) players behind a router (thus having the same IP address) are unable to reliably play together using the FAF client.

Two problems

  1. FAF client chat, the fourth player gets “Fix session limit exceeded” limitation of a maximum 3 players from one IP prevents LAN party playing FAF. This part of the problem is also noted here: Problem noted by another person in 2012: https://forums.faforever.com/viewtopic.php?f=26&t=2138
  2. Unable to reliably get everyone into the game. Typically the fourth player is able to see the game, connect in, see the game lobby screen, then a second later is kicked out with “disconnected by host”. In the 12 hours of trying to play, we only had a 2-3 games where were all able to play together.

Why important: This was a big impact to me because I arranged for my family and friends to get together to play. We all met at my Dad’s place, we bought copies of FA so new people could join. Then it was a big letdown due to multiple problems trying to connect into a game. I’m interested in this fix and would be willing to fund the community further to encourage the fix, thanks playername: defdefiant

Suggested Analysis 1) Could we adjust the IRC limit to a higher number such as 8 or 12? 2) Would the game logs provide more info? Occurred between 2017-06-17@2100 GMT through to 2018-06-18@1000 GMT with players: coreenterprise, earthless1324, fay, and silverspark.

Details

Thank you, playername: defdefiant forever.log.txt game.log.txt

Wesmania commented 7 years ago

It would be very helpful if you posted your faforever.log and game.log, especially if your account was one of those that failed to connect. Other than that I suppose we can grep the server logs for these games. I don't think IRC has any effect on connecting the players within the lobby.

We're actually working on a proxy based on webRTC that could improve that and was tested, but people are busy with IRL stuff a bit now and it'd take some careful community testing to confirm it 100% works. In the meantime we can investigate this and see if there's a simple fix.

micheljung commented 7 years ago

The reason why players in the same LAN may not be able to connect to each other is because FAF currently only tells you to connect to the public IP address of other players. So if your port forwarding is configured correctly or you have UPnP enabled, everyone is told to connect to the public IP Address of the other players. Now some router magic kicks in and what you end up with is a package that is sent from your router's internal IP address instead of its external IP address, and now your game receives a packet from an IP address it doesn't know, so it can't ever establish a connection.

I once fixed this with a hack in my client, but while it used to work, for some reason it stopped working IIRC. https://github.com/FAForever/downlords-faf-client/blob/feature/%23524-reinstate-connectivity-code/src/main/java/com/faforever/client/relay/LocalRelayServerImpl.java#L209

Wesmania commented 7 years ago

I believe the client / server have some simple TURN / STUN stuff implemented, doesn't it? I don't exactly know the implementation details.

duk3luk3 commented 7 years ago

Thank you for your report, unfortunately we can't help you right now.

Please refer to the connection page on the wiki and the Tech Support Forum for connection issues.

FAF currently does not support multiple players behind a NAT firewall (i.e. most home LANs).

This will change in the near future with the rollout of the new ICE connection scheme. Feel free to test that on our test server, instructions for that are here: https://www.faforever.com/2017/05/testers-needed-for-connectivity-improvements

Please use the tech support forum for troubleshooting and the ice-adapter github for issue reports.

I'll be keeping your comment about the irc connection limit in mind.

faf-nsw commented 7 years ago

Added logs to original message.