ValveSoftware / Source-1-Games

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

[L4D2] Command 'retry' does not work correctly #2762

Open 2010kohtep opened 5 years ago

2010kohtep commented 5 years ago

The retry command is intended to reconnect to the server on which the player was last. However, this command does not work correctly if the player connects to the server via 'Play Online', bypassing the use of the console command connect (however, after another retry, the error will occur anyway). As a result, when trying to reconnect with retry, the player will get the error Bad server address public("server_address").

Interestingly, after each retry the number of quotes increases. This gave me some direction in the search for errors.

The reason for the incorrect work of the retry command is that the CL_Retry function incorrectly forms an address for reconnection. If we look at the image, we will see the problem.

image

The va function is a formatting function that allows you to conveniently format a string without thinking about creating your own buffers for the result. However, the rule of formatting "%s" is incorrect, since it creates the very same quotes that break the reconnection.

Replacing this formatting rule with the %s one solved the problem and the retry command was fixed.

2010kohtep commented 5 years ago

In addition. Based on Source Engine 2007 source codes, I can assume that CL_Connect_f uses args.ArgS(); code to get the list of addresses. The CCommand::ArgS is a method that returns an unmodified string of command arguments. This confirms the need for the fix described earlier, since the CUtlString class used by the CL_Connect_f function does not need quotation marks, since it does not consider the : character to be a separator, unlike from the CCommand::Tokenize tokenizer, for example.

Apryed commented 4 years ago

A year later and the problem persist. We is this going to be fixed?

Or how can us, players, fix it by ourselfs?

2010kohtep commented 4 years ago

@Apryed , you can probably try to report the issue to the developer team directly, if you have contacts of them. Maybe they have a Left 4 Dead discord channel or something like that.