Unity-Technologies/qstat

No player list for Goldsource (Half-Life)

pizzahut2 opened this issue · 3 comments

Player list only works for Source engine servers (HL2, CS:S, DoD:S, TF2 etc), but not for Goldsource (HL, CS, DoD, TFC etc). Retrieving general info and/or rules work fine for both. Goldsource is basically like "a2s", but I guess the player list is slightly different.

Couple of TFC servers to try:
HLDS v8308 37.122.208.248:27015 Royston Vasey (bhop on except dustbowl like maps)
HLDS v8196 66.151.244.170:27015 -[EVIL]- Battlezone-X
HLDS v7882 87.98.217.86:27030 Royston Vasey - Dust4Ever [FF On] - Powered by [APG]
HLDS v7559 37.122.208.248:27017 feckin-mad.co.uk - [FM] Fun Server
HLDS v5787 172.93.101.194:27015 Drippy's 2fort (antibhop,no bots)

Btw rcon would be useful, too.

Actually I don't see a reason why with qstat the player list only works for Source servers. I made a PHP script for A2S_PLAYER and it worked for both (Goldsource and Source). 🤷

https://rv.apg-clan.org/dlds/server_queries/bz_players_php.txt

Didn't bother parsing split (and optionally compressed) packets since with Goldsource the limit is 32 players anyway, which fits into a single packet. For Source engine I think the limit is 64 players so might be two packets if a lot of players are on the server.

Looks like this works with the latest version:

qstat -a2s 37.122.208.248:27015 -P -json
[
        {
                "protocol": "a2s",
                "address": "37.122.208.248:27015",
                "status": "online",
                "hostname": "37.122.208.248:27015",
                "name": "Royston Vasey",
                "gametype": "tfc",
                "map": "phantom",
                "numplayers": 4,
                "maxplayers": 31,
                "numspectators": 0,
                "maxspectators": 0,
                "ping": 37,
                "retries": 0,
                "players": [
                        {
                                "name": "Maurice",
                                "score": 0,
                                "time": "21h9m9s"
                        },
                        {
                                "name": "Lance",
                                "score": 0,
                                "time": "21h9m9s"
                        },
                        {
                                "name": "Alvin Steele",
                                "score": 0,
                                "time": "21h9m9s"
                        },
                        {
                                "name": "Charlie",
                                "score": 0,
                                "time": "21h9m9s"
                        }
                ]
        }
]

Yes this seems to work. This issue can be closed.

There's a new issue though which breaks the A2S_INFO query.

The server you picked runs the latest HLDS, but opted out of the newest changes to the A2S protocol.

https://developer.valvesoftware.com/wiki/Server_queries#A2S_INFO
https://steamcommunity.com/discussions/forum/14/2974028351344359625/

These changes are no longer opt-in, but opt out, i.e. they are default for updated servers.

Servers which use the new protocol update:

142.54.164.26:27015 This server has bots, so you can check -P here in addition.
217.146.91.91:27015

I noticed that when using localhost as IP, no challenge is required. So in this case older QStat versions still work fine for the A2S_INFO query.