a2s protocol soft crashes when the server modlist is too long #12108
Labels
Bug
Something isn't working
Code
Programming task
Networking
Issue related to multiplayer or networking
Disclaimers
What happened?
When the modlist is too long, the a2s protocol stops working.
In consequence, anything that depends on it does not function. Namely: server discovery (the server no longer appears in the multiplayer server lobby and a direct connection is needed); and custom discord bots used in server monitoring.
The solution is as easy as limiting the number of the
contentpackageN
s or the size of the string within eachcontentpackageN
in therules
dictionary of the a2s protocol handler.Note that this bug probably existed since the handler's creation, and only as of the recent rework of the content package reporting has it become visible due to the added verbosity.
Note as well that this might be relevant to all the other values of the
rules
dictionary (see:message
- that is the lobby description), but I have not tested it.Reproduction steps
You can further prove this by using an a2s connection to the query port (default 27016), for example with python3 and the python-a2s library: if the petition is about
a2s.info
ora2s.players
then the information is received. When the petition is abouta2s.rules
then the answer is dropped because the resulting packet is too big (exceeding 65536).Bug prevalence
Happens regularly
Version
v1.0.13.2
-
No response
Which operating system did you encounter this bug on?
Windows
Relevant error messages and crash reports
No response
The text was updated successfully, but these errors were encountered: