ValveSoftware / Source-1-Games

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

[L4D2] sv_password is not working #3416

Open dragokas opened 4 years ago

dragokas commented 4 years ago

Fresh server (Linux). No mods etc. It's impossible to set a password to restrict the access to the server.

When you set in server.cfg

sv_password "123"

server totally ignores it, and allow access for clients without a password at all. Answer from RCON:

sv_password
"sv_password" = "123" ( def. "" )
 notify
 - Server password for entry into multiplayer games

I noticed that the behavior is a little bit changed when we set:

sv_allow_lobby_connect_only "0"

In this case, the password window began to be displayed, but it is no matter what we enter there - empty password, incorrect or correct password, the result is always the same - the game client is getting stuck on this window forever:

image

Console output is:

] connect 192.168.202.163:27015
Connecting to public(192.168.202.163:27015) 
Sending UDP connect to public IP 192.168.202.163:27015
Server using '<none>' lobbies, requiring pw yes, lobby id 0
RememberIPAddressForLobby: lobby 0 from address 192.168.202.163:27015
BinkOpen( d:\steam2\steamapps\common\left 4 dead 2\left4dead2\media\l4d2_background04.bik )

And yes, I checked both, on a local dedicated server and on the real dedicated server. Results are the same.

dragokas commented 4 years ago

Temporarily walkaround from Silvershot: to use "sv_search_key" instead.

falo2k commented 3 years ago

Just tried to set up a community server myself and ran into this. Clean install, sv_password is completely ignored.

Could you elaborate on the workaround?

worMatty commented 3 years ago

sv_search_key stops any traffic coming from matchmaking, unless the lobby leader has set the same cvar in their client.

It doesn’t prevent direct connections to the server via IP, though. Nor does it prevent members of the associated Steam Group from connecting via the game UI either directly or by making a lobby and choosing the Steam Group Server when starting the match.

You can use it to reserve a server for yourself or your Steam Group, though I’m not sure what would happen if there were clients already on there who had connected directly, if a lobby was trying to use it.