DOWNLOAD QSTAT

QStat FAQs

Contents

1. Most Frequently Asked Questions
1.1 How do I run QStat?
1.2 Does QStat support game XYZ?
1.3 When will QStat support game XYZ?
1.4 Why can't I use the GameSpy master servers?
1.5 How can I make a status web page for my server?
2. Less Frequently Asked Questions
2.1 How do I use QStat with IRC?
2.2 Is there a DLL or ActiveX version of QStat?
2.3 Does QStat support Visual Basic?
2.4 What is the query protocol for game XYZ?
2.5 How do I write something like QStat in Visual Basic/Java/Perl/PHP?

Answers

1. Most Frequently Asked Questions

1.1 How do I run QStat?

QStat is a command-line text program. It does not have a window, menus, or buttons. To run QStat, you will need the qstat program. The QStat program is called "qstat" on Linux/Unix and "qstat.exe" on Windows. The Windows binary can be found in "win32/qstat.exe" of the QStat ZIP file.

QStat can be run in a command window. Examples on Unix/Linux are xterm, gnome-terminal, and dtterm. On Windows 9x use command.exe. On Windows NT/2000/XP, use cmd.exe.

At the prompt, run qstat like this:

qstat -P -hls 203.17.15.220:27018
This will get status from the Half-Life server (-hls) at 203.17.15.220:27018 and include player information (-P). You should see output something like this:
ADDRESS           PLAYERS      MAP   RESPONSE TIME    NAME
203.17.15.220:27018   18/25      de_dust     86 / 0  cstrike SGL CStrike 1.5 (Dust Only)
          0 frags     1m34s GTO
          1 frags    19m 7s NoodlePower
          1 frags    16m17s FoddeR
          2 frags     6m40s _cam
          2 frags  1h 2m46s AK-47
          0 frags     9m44s GUINNESS
          0 frags  1h32m 7s ING
          0 frags  1h 5m36s ~{ FraG S.O.B }~
          0 frags  1h 0m55s ~{ Live2Die S.O.B }~
          0 frags  1h 4m59s 007
          0 frags    13m17s boneros
          3 frags    53m 4s TKT.yl
          1 frags  1h 0m35s a
          0 frags    13m 6s [- Br3nDaNw0r -]
          0 frags    36m20s Blue
          0 frags    43m 5s .
          1 frags    31m26s Dimsum | OnG
QStat can output the human readable format above and a raw and XML format.

To output in raw format, run qstat with the -raw flag:

qstat -raw __ -P -hls 203.17.15.220:27018
The characters after -raw will be put between each piece of data. For example:
HLS__203.17.15.220:27018_|SGL CStrike 1.5 (Dust Only)__de_dust__25__20__102__0
GTO__1__317
NoodlePower__6__1370
FoddeR__3__1201
_cam__11__624
AK-47__3__3990
GUINNESS__0__808
ING__2__5751
Dragon-X__3__223
~{ FraG S.O.B }~__0__4160
~{ Live2Die S.O.B }~__1__3879
Skitzah__0__38
boneros__2__1020
TKT.yl__8__3408
a__1__3859
Gunja-Monkey__0__128
[- Br3nDaNw0r -]__0__1010
-=[Saint Pedigree]=-__0__155
Blue__2__2403
Dimsum | OnG__2__2109
To output in XML format, run qstat with the -xml flag:
qstat -xml -P -hls 203.17.15.220:27018
XML is extremely verbose. The output will look something like this:
<qstat>
        <server type="HLS" address="203.17.15.220:27018" status="UP">
                <hostname>203.17.15.220:27018</hostname>
                <name>OzForces.Com|SGL CStrike 1.5 (Dust Only)</name>
                <gametype>cstrike</gametype>
                <map>de_dust</map>
                <numplayers>21</numplayers>
                <maxplayers>25</maxplayers>
                <ping>85</ping>
                <retries>0</retries>
                <players>
                        <player>
                                <name>GTO</name>
                                <score>1</score>
                                <time>    6m19s</time>
                        </player>
Finally, QStat has a template output mode. You can write template files that describe exactly how output should be formatted. This is useful for generating web pages. See "How can I make a status web page for my server?"

1.2 Does QStat support game XYZ?

QStat supports most first person shooter (FPS) style games. These are games like Quake, Unreal, and Half-Life. The QStat documentation and web page (
http://www.qstat.org) list many of the supported games.

QStat supports games beyond those listed in the documentation. This works because most new games use a network protocol similar to an existing game. The two most common protocols are Unreal and Quake. If QStat does not include a flag for your game, then try the -uns (Unreal) and -q3s (Quake 3) flags with your server's IP address and game port. For example:

qstat -uns 10.10.128.1:25000

qstat -q3s 10.10.128.1:29000
If the status of your server is displayed, then qstat supports the game.

QStat can be configured with new flags by using a QStat configuration file. The qstat package includes a default config file called qstat.cfg. Additional game types can be added to this file with a text editor. Kingley Foreman maintains a list of additional qstat configs on his web site (http://qstat.uglypunk.com). If you want to write your own qstat configs, see the QStat documentation (http://www.qstat.org/qstatdoc.html).

1.3 When will QStat support game XYZ?

The game might already be supported, see Does QStat support game XYZ?

If the game is using a new protocol, then someone will need to modify qstat to support the game. The programming is usually done by the QStat author (Steve Jankowski) or contributed by another programmer. When the programming will be done depends on a number of factors:

QStat is moving toward a more open development model (using SourceForge). This should allow contributed code to become available much sooner, but without much testing.

1.4 Why can't I use the GameSpy master servers?

GameSpy protects their master server lists using a secret challenge-response algorithm. QStat does not know the algorithm so cannot access the server lists.

1.5 How can I make a status web page for my server?

big question

Use an existing server status provider: http://www.serverspy.net

2. Less Frequently Asked Questions

2.1 How do I use QStat with IRC?

I don't use IRC and don't know anything about programming IRC scripts. The QStat derived works page lists several IRC utilities that use qstat, including:

2.2 Is there a DLL or ActiveX version of QStat?

No. There have been many requests for this feature, but adding it is a significant undertaking. I wouldn't rule it out completely, but QStat may never support DLL or ActiveX.

2.3 Does QStat support Visual Basic?

See 1.7. But you can run qstat.exe from Visual Basic and output to a file (-of flag), then parse the file in VB.

2.4 What is the query protocol for game XYZ?

The QStat Network Protocol page (http://www.qstat.org/qprotocol.html) includes links to some game status protocol descriptions. But most of them are for old games. I have not written any documents myself.

I usually figure out game protocols using reverse engineering. I use network snoop tools like 'tcpdump' to capture network packets. Some protocols are text-based and fairly simple to decipher. Some use a binary encoding and are much harder to figure out.

I use Unix based tools like tcpdump. On Windows, try NetworkActiv sniffer (http://www.networkactiv.com/Sniffer.html). Also on Windows, but command-line based is InetWatch 0.95.

I've heard that network sniffers generally don't work on modem connections. An alternative for Windows is to use a winsock sniffer. The only one I know of is TCP Spy (http://www.westbrooksoftware.com/tsdetails.shtml) which is free if you can live with a 32K buffer.

Finally, QStat has a debug mode (-d) that will print all received packets. Once you know the request packet, you can write a QStat config with a "status packet" entry. Then run qstat with the -d flag using the new game type.

2.5 How do I write something like QStat in Visual Basic/Java/Perl/PHP?

While I know Java and a little Perl and PHP, I don't have time to be a teacher. I suggest looking for existing open source game server browsers to see how they work.