OnCommandStats is a
TIdIrcTwoParmEvent event handler that allows the server to respond to the IRC STATS command. STATS is used to query statistics for the server specified in Parm1 using the query in Parm1.
If Parm2 is omitted, only the end of stats reply is sent back. The implementation of this command is highly dependent on the server which replies, although the server must be able to supply information as described by the queries below (or similar).
A query may be given by any single letter which is only checked by the destination server (if given as the Parm2 parameter) and is otherwise passed on by intermediate servers, ignored and unaltered.
The following queries are those found in the current IRC implementation and provide a large portion of the setup information for that server. Although these may not be supported in the same way by other versions, all servers should be able to supply a valid reply to a STATS query which is consistent with the reply formats currently used and the purpose of the query.
The currently supported queries are:
- c - returns a list of servers which the server may connect to or allow connections from.
- h - returns a list of servers which are either forced to be treated as leaves or allowed to act as hubs.
- i - returns a list of hosts which the server allows a client to connect from.
- k - returns a list of banned username/hostname combinations for that server.
- l - returns a list of the server's connections, showing how long each connection has been established and the traffic over that connection in bytes and messages for each direction.
- m - returns a list of commands supported by the server and the usage count for each if the usage count is non zero.
- o - returns a list of hosts from which normal clients may become operators.
- y - show Y (Class) lines from server's configuration file.
- u - returns a string showing how long the server has been up.