ValveSoftware / Source-1-Games

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

[TF2] Change default value of net_chan_limit_msec #5231

Open aarmastah opened 11 months ago

aarmastah commented 11 months ago

I run a community server for Team Fortress 2 that was recently the target of bad actors when a friend and I were streaming. Said bad actors were causing the server to "lag out" and clients were frequently freezing and getting stuck with the "WARNING: Connection Problem" message. After we discovered the command _net_chan_limitmsec was disabled by default, setting it from its default value of 0 to the value used in Casual Mode, 33, caused the bad actors to immediately get kicked from the server and we didn't see any similar issues for the rest of the stream.

I'm honestly quite shocked that 33 isn't the default; I had no idea this feature was disabled by default and it completely saved us from a disaster of a show. It's been in use in Casual for what looks like a year now, so why not update it from the default of 0 to 33?

sapphonie commented 11 months ago

net_chan_limit_msec is, as far as I know, by default disabled because third party server mods (such as SourceMod) will frequently hold the main thread (kind of, this is an oversimplification, typically SM won't actually hold the main thread for that long, but net_chan_limit_msec's logic is a bit convoluted from what I've reverse engineered of it) when doing large operations (such as typing chat commands, or doing other such admin stuff) for longer than 50ms (which was the Valve default, did it change to 33ms now?), which would kick people for no reason.

A "sane" default for community servers might be around 128ms (which is what I default it to in StAC), but some plugins can stutter the main thread for even longer - I've seen even 128ms be too low, and had to bump it up to 192ms for someone. It's not possible for Valve to know what plugins you are running on your server, and it's on you to tweak the value to what you need when legit players stop getting kicked.