Open ostrosablin opened 2 years ago
This key-value pair (fs_manifest) seems to be related to QuakeJS (Emscripten support related). If I understand correctly, it contains list of maps and resources that QuakeJS web clients need to download to be able to join game. That's why it's subvalues are separated by newline + space.
It's defined here in upstream ioquake code
I've also corrected display_json.c (function json_escape) to properly escape newlines because otherwise JSON would be invalid and useless for further processing.
Some servers return fs_manifest key-value pair, which has it's value split by newline, followed by a space. qstat breaks on such servers (at least, it can't fetch the rules and players, because it treats newline as beginning of player data, an unexpected data causes qstat to break with error).
One such example is server run by my colleague, at 52.59.239.15:57131
Raw data from socket:
Example of qstat run:
Following patch implements special handling for fs_manifest key, that ignores newline as a separator, while keeping all other parsing intact, so it fixes qstat to handle this server correctly, while it shouldn't break anything else.