QStat is a command-line program that displays information about Internet Quake servers. The servers are either down, non-responsive, or running a game. For servers running a game, the server name, map name, current number of players, and response time are displayed. Server rules and player information may also be displayed.
Several different Quake server types and derived games are supported. These can be divided into two categories: POQS (Plain Old Quake Server) and QuakeWorld. Quake shareware, Quake commercial (from CD), winquake, winded, unixded, and Hexen II are all POQS. The various versions of QuakeWorld and Quake II use a QuakeWorld type server. The distinction is based on network protocol used to query the servers, and affects the kind of information available for display.
The different server types can be queried simultaneously. If qstat detects that this is being done, the output is keyed by the type of server being displayed. See DISPLAY OPTIONS.
The Quake server may be specified as an IP address or a hostname. Servers can be listed on the command-line or, with the use of the -f option, a text file.
One line will be displayed for each server queried. The first component of the line will be the server's address as given on the command-line or the file. This can be used as a key to match input addresses to server status. Server rules and player information are displayed under the server info, indented by one tab stop.
These options select how a server should be queried. The address of POQS can be specified at the end of the command-line or in a file (see option -f.) QuakeWorld server addresses can be fetched from a QuakeWorld master using -qw or specified individually with -qws. The address of Quake II servers can be specified using the -qws option (must include port number) or in a file.
Alternatively, addresses can be listed in a file specified with -f. Each address in the file may be typed by the kind of server it is.
QS normal Quake server (POQS) H2S Hexen II server (POQS) QW QW server QWM QW master server Q2 Quake II server (will assume a default port of 27910)
The qstat output should be self explanatory. However, the type of information returned is different between POQS and QuakeWorld. If qstat queries multiple server types, then each server status line is prefixed with a key:
QS normal Quake server (POQS) H2S Hexen II server (POQS) QW QW server QWM QW master server Q2 Q2 server
The response time is a measure of the expected playability of the server. The first number is the server's average time in milli-seconds to respond to a request packet from qstat. The second number is the total number of retries required to fetch the displayed information. More retries will cause the average response time to be higher. The response time will be more accurate if more requests are made to the server. For POQS, a request is made for each server rule and line of player information. So setting the -P and -R options will result in a more accurate response time. Quake and Hexen II are POQS. For QuakeWorld and Quake II, qstat makes just one request to retrieve all the server status information, including server rules and player status. The -P and -R options do not increase the number of requests to the server.
Quake supports a number of control codes for special effects in player names. Qstat normalizes the codes into the ASCII character set before display. The graphic codes are not translated except the orange brackets (hex 90, 10, 91, and 11) which are converted to '[' and ']'. Use the hex-player-names option -hpn to see the complete player name.
Quake servers do not return version information. But some small amount of info can be gathered from the server rules. The noexit rule did not appear until version 1.01. The Quake II server rules includes a version key that appears to contain the id build number.
The following is an example address file which queries a QuakeWorld master, several Hexen II servers, some POQS, and a few Quake II servers.
QWM 192.246.40.12:27004 H2S 207.120.210.4 H2S 204.145.225.124 H2S 207.224.190.21 H2S 165.166.140.154 H2S 203.25.60.3 QS 207.25.198.110 QS 206.154.207.104 QS 205.246.42.31 QS 128.164.136.171 Q2 sm.iquest.net Q2 209.39.134.5 Q2 209.39.134.3
If the above text were in a file called QSERVER.TXT
,
then the servers could be queried by running:
qstat -f QSERVER.TXT
Qstat sends packets to each host and waits for return packets. After some interval, another packet is sent to each host which has not yet responded. This is done several times before the host is considered non-responsive. Qstat can wait for responses from up to 20 hosts at a time. For host lists longer than that, qstat checks more hosts as results are determined.
The following applies only applies to POQS. If qstat exceeds the maximum number of retries when fetching server information, it will give up and try to move on to the next information. This means that some rules or player info may occasionally not appear. Player info may also be missing if a player drops out between getting the general server info and requesting the player info. If qstat times out on one rule request, no further rules can be fetched. This is a side-effect of the Quake protocol design.
The number of available file descriptors limits the number of simultaneous servers that can be checked. QStat reuses file descriptors so it can never run out. The macro MAXFD in qstat.c determines how many file descriptors will be simultaneously opened. Raise or lower this value as needed. The default is 20 file descriptors.
Operating systems which translate ICMP Bad Port (ICMP_PORT_UNREACHABLE) into a ECONNREFUSED will display some hosts as DOWN. These hosts are up and connected to the network, but there is no program on the port. Solaris 2.5 and Irix 5.3 correctly support ICMP_PORT_UNREACHABLE, but Solaris 2.4 does not. See page 442 of "Unix Network Programming" by Richard Stevens for a description of this ICMP behavior.
Operating systems without correct ICMP behavior will just report hosts without Quake servers as non-responsive. Windows NT and Windows 95 don't seem to support this ICMP.
For hosts with multiple IP addresses, qstat will only send packets to the first address returned from the name service.
QStat will report bogus reponse times if a server is listed
multiple times in a file or on the command line. Generally,
the later requests to the same server will take much longer.
Be sure to cull duplicate addresses from your server list.
On Unix, this can be done with sort | uniq
.
QStat has been compiled and tested on Solaris 2.4/2.5/2.6, Irix 5.3/6.2/6.3, Windows NT 3.51 & 4.0, Windows 95, FreeBSD 2.2, BSDi, HP-UX 10.20, and various flavors of Linux.
The Windows version of qstat (win32/qstat.exe) runs on Windows 95 and Windows NT as a console application. On Windows 95 and NT 4.0, short-cuts can be used to set the arguments to qstat. On Windows NT 3.51, use a batch file.
An OS/2 binary is no longer included. Try contacting Per Hammer for an OS/2 Warp binary. per@mindbend.demon.co.uk.
This is qstat version 2.0b. It works with every known
version of Quake and all derivatives except versions of
QuakeWorld before 1.5. No one is running pre-1.5 QuakeWorld,
so this can hardly be a problem.
The qstat webpage is updated for each new version and
contains links to Quake server listings and pages about
the Quake network protocol. The page can be found at
http://www.activesw.com/people/steve/qstat.html
Quake and Quake II created by id Software. Hexen II created by Raven Software.
Steve Jankowski
steve@activesw.com
Copyright © 1996,1997 by Steve Jankowski
Permission granted to use this software for any purpose you desire provided that existing copywrite notices are retained verbatim in all copies and derived works.