https://bugs.winehq.org/show_bug.cgi?id=46940
Bug ID: 46940 Summary: GTA 5 clients cannot connect to each other behind home router Product: Wine Version: 4.5 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: electrodexsnet@gmail.com Distribution: ---
When the game is running, it seems to be unable to do anything that requires the ability to host a direct connection. In most circumstances this is not noticeable as the game will fall back to using rockstar servers when direct is not available.
However, if you have multiple players behind the same home router, they will experience symptoms of this issue, as the game expects to be able to use p2p/direct connectivity between clients on a home network.
This includes:
* Inability to join an invite-only or friend-only session hosted by either
* Inability to join a public (or hosted by another player) session if either player is already in it; as soon as one connects, the other cannot join, and vice-versa. This can be worked around consistently by disabling UPnP on the home router. Workaround only works for joining public sessions.
* Inability to join a heist hosted by either (even when started from a public or 3rd-party hosted session)
These were tested and confirmed with 4 accounts at 4 computers at 2 locations. Tested with respective firewalls enabled/disabled. Players at different locations could connect to each other without issue; players at the same location could not.
This issue does not manifest if one of the computers is Windows [tested W10 build 1803]. It can join or be joined to local friend-only/private sessions as you'd expect.
====Steps used to produce logs (on Majaro Linux)====
(Did steps on 2 computers running separate instances of GTA 5)
sudo pacman -S --needed --noconfirm wine-staging wine-mono wine_gecko winetricks lib32-gtk3 lib32-mpg123 mpg123 yay WINEPREFIX=~/.wine_vulkan winetricks -q allfonts steam yay -S --noconfirm dxvk-bin WINEPREFIX=~/.wine_vulkan setup_dxvk install WINEDLLOVERRIDES=winedbg.exe=d WINEPREFIX=~/.wine_vulkan wine Steam.exe
Launch game in Story Mode, then launch a Friend-only Online session. Once both are at this point, try connecting either of them to the other.
GTA On-screen Messages: Alert: Getting GTA Online session details Alert: Unable to connect to game session.
========================
This affects both wine and wine-staging, but I could not get logs from vanilla wine as GTA 5 in recent versions does not get past the socialclub launcher.
This also affects Proton. I've limited the logs scope to just wine for this report, but you can find the related Proton reports here: https://github.com/ValveSoftware/Proton/issues/37#issuecomment-445510575 https://github.com/ValveSoftware/Proton/issues/37#issuecomment-478411346
https://bugs.winehq.org/show_bug.cgi?id=46940
--- Comment #1 from Lectrode electrodexsnet@gmail.com --- Created attachment 64061 --> https://bugs.winehq.org/attachment.cgi?id=64061 Logs from computer 1
https://bugs.winehq.org/show_bug.cgi?id=46940
--- Comment #2 from Lectrode electrodexsnet@gmail.com --- Created attachment 64062 --> https://bugs.winehq.org/attachment.cgi?id=64062 Logs from Computer 2
https://bugs.winehq.org/show_bug.cgi?id=46940
Lectrode electrodexsnet@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Hardware|x86 |x86-64
https://bugs.winehq.org/show_bug.cgi?id=46940
Lectrode electrodexsnet@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |electrodexsnet@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=46940
Brendan Shanks bshanks@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |bshanks@codeweavers.com
https://bugs.winehq.org/show_bug.cgi?id=46940
--- Comment #3 from Brendan Shanks bshanks@codeweavers.com --- Does Manjaro/Arch define the local hostname to be '127.0.1.1' in /etc/hosts? If so, can you try commenting out the line and then testing GTA V?
Debian/Ubuntu do this (see https://www.debian.org/doc/manuals/debian-reference/ch05.en.html#_the_hostna...), and I think it may be causing this issue.
GTA V calls getaddrinfo() with the local hostname (returned by gethostname()), and on my Ubuntu system this returns only '127.0.1.1'. GTA V shows this as the "local IP" in the Social Club overlay->Settings->Network, and I suspect it's trying to use it for network listening. With the '127.0.1.1' line commented out in /etc/hosts, GTA V at least shows the correct local IP.
https://bugs.winehq.org/show_bug.cgi?id=46940
--- Comment #4 from Lectrode electrodexsnet@gmail.com --- Thank you for looking into this. Interesting. Yes, Manjaro sets that (not sure about Arch). I will test this once I'm off work in a few hours and let you know if that makes a difference.
Btw, I had tested this issue again with both wine and wine-staging 4.16 before the new rockstar launcher, and this issue still existed. The latest Proton adds patches that get the new launcher working, so I'll test with that first.
If I need updated wine logs, I'll need to add the couple launcher patches and get that compiled.
https://bugs.winehq.org/show_bug.cgi?id=46940
--- Comment #5 from Lectrode electrodexsnet@gmail.com --- Thank you so much! That did indeed fix it! It took a reboot to take effect, but after that it worked as you'd expect. I can finally play with family members without switching to Windows. You have my eternal gratitude.
https://bugs.winehq.org/show_bug.cgi?id=46940
Andrew Eikum aeikum@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |aeikum@codeweavers.com
https://bugs.winehq.org/show_bug.cgi?id=46940
--- Comment #6 from Brendan Shanks bshanks@codeweavers.com --- A full description of the problem:
GTA V (and probably other Rockstar games) gets the local hostname using gethostname(), and then calls getaddrinfo() with the hostname to get the list of local IP addresses. It takes that address and uses it as a source address when listening for local network communications, it's also shown in-game as "Local IP" in the Social Club overlay->Settings->Network.
The Windows documentation for getaddrinfo() supports this usage: "If the pNodeName parameter points to a computer name, all permanent addresses for the computer that can be used as a source address are returned. On Windows Vista and later, these addresses would include all unicast IP addresses returned by the GetUnicastIpAddressTable or GetUnicastIpAddressEntry functions in which the SkipAsSource member is set to false in the MIB_UNICASTIPADDRESS_ROW structure."
Wine's getaddrinfo() calls through to the host getaddrinfo(), which works very similarly but does not document any guarantee like this.
Debian, Ubuntu, Arch, and likely other Linux distributions define the local hostname to be '127.0.1.1' in /etc/hosts, apparently as a workaround for GNOME (https://www.debian.org/doc/manuals/debian-reference/ch05.en.html#_the_hostna...). When getaddrinfo() is called for the local hostname, '127.0.1.1' is the only address returned.
With the '127.0.1.1' line commented out in /etc/hosts, Linux getaddrinfo() works as expected and returns all local IP addresses.
I haven't figured out any way to use Linux getaddrinfo() to return the local IP addresses (without modifying /etc/hosts). I suspect the solution here is for Wine's getaddrinfo() to detect when the local hostname is being supplied, and use an alternate function to get the local IPs (like GetAdaptersAddresses or GetUnicastIpAddressTable). It looks like this is how gethostbyname() works already.
https://bugs.winehq.org/show_bug.cgi?id=46940
--- Comment #7 from Brendan Shanks bshanks@codeweavers.com --- Have you tried this lately? I noticed that the social club settings in GTA V are now showing '127.0.0.1' as my private address, which might cause a problem for LAN games. This must have changed in a social club/game update, I haven't looked into what method it's using to get this address though (if it's still getaddrinfo)
https://bugs.winehq.org/show_bug.cgi?id=46940
--- Comment #8 from Lectrode electrodexsnet@gmail.com --- Yes, I tested this functionality a few days ago.
Just tested again with the latest Proton (5.0): -With the workaround (commenting out 127.0.1.1 in hosts file): still works as expected -Without the workaround: does not work
With the workaround in place, GTA 5 continues to detect the local IP as 127.0.0.1, which works. It's only when it detects it as 127.0.1.1 that it doesn't.
https://bugs.winehq.org/show_bug.cgi?id=46940
--- Comment #9 from Lectrode electrodexsnet@gmail.com --- (this was tested with a fresh compatdata)
https://bugs.winehq.org/show_bug.cgi?id=46940
Jactry Zeng jactry92@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jactry92@gmail.com