GameSpy query protocol version 1 has three packets for querying the players, server info and server rules.
5C 69 6E 66 6F 5C \info\
5C 72 75 6C 65 73 5C \rules\
5C 70 6C 61 79 65 72 73 5C \players\
According to Luigi Auriemma there are two hidden queries \ison\ and \ucount\ available for some games. More information available at http://aluigi.altervista.org/papers/gshlist.txt. Unreal Wiki also mentions \basic\, \echo\, \level_property\, \game_property\ and \player_property\ as possible request contents.
Responses to the queries are \ (0x5C) delimited key value pairs. The response might be sent back into multiple packets. Each packet is delimited by \querid\x.y, where x is a unique integer value for the query and y the sequence number of the packet. The final packet ends with \final\. The \final\ is not always be at the very end and can be before \querid\. Packet may be received out of order. The sequence number helps restore the correct order. The \final\ terminator might not be received at all.
For example, a response to a players query consists of 3 packets. The first two packets end in \querid\15.1\ and \queryid\15.2\ and the last packet \queryid\15.3\final\.
Queries can be combined into a single request, e.g. \info\\rules\. \status\ is shorthand for \basic\\info\\rules\\players\. The packets always arrive in the order
- info
- rules
- players
regardless of the order in which the parts are appended to the request bytes.
Any of the other query parts (echo, level_property, game_property, player_property) are best included as last. Including these in the middle confuses the server, causing it to not respond for anything after these parts and not send the \final\ on the last packet.
Games supporting GameSpy 1
Resources
- http://int64.org/docs/gamestat-protocols/gamespy.html
- http://www.codeproject.com/KB/game/gameserverinfo.aspx
- http://nwn2forums.bioware.com/forums/viewtopic.html?topic=674295&forum=119
- http://aluigi.altervista.org/papers/gshlist.txt
- http://wiki.beyondunreal.com/Legacy:UT_Server_Query