Add a special handling for fs_manifest key-value pair#117
Open
ostrosablin wants to merge 2 commits intorocketsciencegg:mainfrom
Open
Add a special handling for fs_manifest key-value pair#117ostrosablin wants to merge 2 commits intorocketsciencegg:mainfrom
ostrosablin wants to merge 2 commits intorocketsciencegg:mainfrom
Conversation
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). Following patch makes special handling for fs_manifest key, that doesn't treat newline as a separator, while keeping all other parsing intact. Signed-off-by: Vitaly Ostrosablin <tmp6154@yandex.ru>
Author
|
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 |
Related to commit 4f70920, allowing multiline rule values from server cause JSON output mode to produce illegal JSON with unescaped newlines. This commit enables json_escape function to properly escape such values, translating newlines to \n. Signed-off-by: Vitaly Ostrosablin <tmp6154@yandex.ru>
Author
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.