ValveSoftware / Source-1-Games

Source 1 based games such as TF2 and Counter-Strike: Source
660 stars 76 forks source link

[L4D2] Broken matchmaking on local servers #4164

Open andregpaiva opened 2 years ago

andregpaiva commented 2 years ago

Creating a local dedicated server behind NAT doesn't allow other public players to discover or join the game via matchmaking

CASE: SRCDS over Windows, on a computer behind a NAT with an IP 192.168.0.1 For this example, let's consider public IP 255.255.255.255 and server port 27015, client port 27005

SCENARIO 1: Server is running with private IP 192.168.0.1 and public IP 255.255.255.255 on port 27015 When joining the server via console command connect 255.255.255.255:27015 The client can join normally Public players can't find neither join the server via matchmaking since the match wasn't created from a lobby and thus doesn't have a reservation token

SCENARIO 2: Server is running with private IP 192.168.0.1 and public IP 255.255.255.255 on port 27015 The client creates a lobby, and on the server option, either selecting the option to search for "Best dedicated servers" or "Steam Group Servers", on the former, by setting mm_dedicated_force_servers 192.168.0.1:27005|255.255.255.255:27015, and on the latter, by setting sv_steamgroup "xxxx" on server.cfg and selecting the server on the list

The client searches and try to join the server, but return an error, saying that there wasn't any server available The server console displays the message "Reservation request with bogus payload data from 192.168.0.1:27005"

This is happening because the game is trying to join the dedicated server via it's local LAN ip address instead of a public IP address

SCENARIO 3: Server is running with private IP 192.168.0.1 and public IP 192.168.0.1 on port 27015 by forcing it on +net_public_adr 192.168.0.1 srcds launch parameters The client creates a lobby, and on the server option, either selecting the option to search for "Best dedicated servers" or "Steam Group Servers", on the former, by setting mm_dedicated_force_servers 192.168.0.1:27005|255.255.255.255:27015, and on the latter, by setting sv_steamgroup "xxxx" on server.cfg and selecting the server on the list

The client joins the server normally Any other players on the lobby get dropped and can't join the game, since the game tries to join a local IP address on another machine

SCENARIO 4: Server is running with private IP 192.168.0.1 and public IP 255.255.255.255 on port 27015 Another user, unrelated to the mentioned client here, creates a lobby, and on the server option, either select the option to search for "Best dedicated servers" or "Steam Group Servers"

The client joins the server normally Any other players, even the client, can now join the server, as it was started by another user, and the game specified the Public IP address instead

As of right now it's impossible as far as i know to host a local dedicated server and allow public players to find via matchmaking, without waiting for someone to "start" the server and you joining later after the session was created with an public user lobby

To fix this issue: The game needs an update so the lobbies join servers via it's public IP addresses, not it's private IP.

Thanks

1157 commented 2 years ago

I have made the mistake of trying to host a dedicated server for l4d2 and it's one of the games that you can not host and play on same machine and the networking issue's you mentioned carry over,The only working way now is rent a server or just run a local listen server. It would be nice if they fixed this.

ThisNekoGuy commented 1 year ago

Not being able to host L4D2 games in-client is very frustrating; this is quite a jarring issue (and I have "Open NAT") I'd have imagined fixing something like this would be a higher priority than it is, given that it's been an issue for a long time (it's older than this bug report)

(I'm on Linux)