Closed illwieckz closed 7 years ago
Note: this PR can be merged before others.
Overall for new code blocks please use trailing brace style e.g.
if (condition1 || condition2) {
...
} else {
...
}
Is it really needed since all that will be revamped? I don't like to mix different style in the same block (like a function block), and all this stuff will be rewritten.
However, even if all these feedbacks are annoying, thank you very much for your meticulous review, for sure you read my code considerately. :wink:
If it was all consistent with the existing style I would agree but atm its quite a mixed bag, so at the very least it should be self consistent :)
yeah, that part is one of the worst part (not only style) I ever read in qstat :scream: (one of the other very ugly qstat part is the template code :no_mouth: ), the kind of stuff you'll never accept these days, hopefully. :laughing:
Any intention to address the outstanding comments?
code rebased, revamped and uncrustified
Things done in this PR (see first comment for details):
Things not done in this PR:
Only unsecure gamespy protocol is supported by qstat, qstat was never able to grok it (that's why XQF used gslist
in the past for that task for example) so this part was left untouched, adding support for the secure protocol must be another PR (see gsmsalg.h
for a reference implementation).
Hi, the current gamespy master server query have many issues.
\ip\nnn.nnn.nnn.nnn:nnnnn
, and the one with the binary format (a simple array of bytes, like the internal qstat master packet list).For example, currently the following query works (text format, many servers, so more than 2 packets):
Currently the following query does not work (text format but not enough servers so only 2 packets, only one server list packer):
Currently the following query does not work (binary format):
So, this PR fixes these two issues and rewrite some part to get a cleaner and safer code:
This code was successfully tested against these use cases:
And some other combinations.