XQF / xqf

XQF game server browser
http://xqf.github.io
GNU General Public License v2.0
37 stars 12 forks source link

alternate game id in master server list / never trust qstat for game id #207

Closed illwieckz closed 6 years ago

illwieckz commented 6 years ago

allow to set an alternate game id in master server list

some games are known to support multiple protocols, when you fetch a web list of server, it's good to be able to enforce which alternative protocol must be used to query the servers from this specific list

this functionality is currently only supported in hard coded list of masters, the GUI does not allow to set the alternative query protocol when adding a master server by hand or a server by hand, by the way user config files can be edited to reflect that.

you can set an alternate this way (using a pipe as separator):

ADD AMS|GPS http://www.qtracker.com/server_list_details.php?game=armyoperations qtracker.com

server fetched by this master server will be queried using the gamespy GPS protocol instead of the AMS one, but they will be considered as AMS games.

it prevents some games to answer strings like:

what broken query tool do you use?

because basically some version grok an old protocol but other versions only grok the gamespy one: if the server is listed in a gamespy master server, always query it using the gamespy server protocol

never trust qstat for game id

qstat returns the qstat_str, not the game id for example we use -cods for COD:UO that will return CODS instead of CODUOS and XQF will mark the server for the wrong game, never trust qstat, always trust XQF.

it also avoids the need to create useless entries in qstat.cfg just to tell XQF to query the right game relying on qstat output: never rely on it, XQF knows what is good.

update master server list

update master server list to use these features

illwieckz commented 6 years ago

@zturtleman I'll appreciate a review on this.

Basically it adds a server_query_type field in some struct, it's stored in files this way if exists:

<type>|<server_query_type><comma><option><space><something>

This server_query_type is set to UNKNOWN_SERVER if there is no alternate one, and in this case the type is just stored in files like before:

<type><comma><option><space><something>

I was not able to reuse the comma as a separator because some code already looks for "the option after the first comma” and I can't change this to “the option after the second comma” since the alternate type is optional.

zturtleman commented 6 years ago

I'm not familiar with those games or the gamespy protocol but it seems like a reasonable way to store the override protocol.

illwieckz commented 6 years ago

thanks!

illwieckz commented 6 years ago

the qtracker master server is both query-able using gamespy master server protocol or http, but qstat does not fully handle the gamespy protocol (only the one without key challenge), I'll probably attempt to improve that in the future and I'm thinking about that since years but the http list does the job as expected once XQF knows how to query the games, and it was faster to add this. :p

Also, it can be useful in some other corner case.

The "always trust xqf" trick can fix a lot of bugs when multiple games reuse the same qstat switch. I'm curious this bizarre behaviour of querying server using the game id told by qstat was there since so long. It was also meaning that querying the server from a master server list or querying the server from an XQF previoulsy-stored list would not use the same protocol in some case! :o