Site Tools


Table of Contents

# $EPIC: serverctl.txt,v 1.10 2010/03/22 00:52:57 jnelson Exp $


$serverctl(REFNUM <server refnum>)
$serverctl(REFNUM <name>)
$serverctl(REFNUM <name>:<port>)
$serverctl(OMATCH <pattern>)
$serverctl(IMATCH <pattern>)
$serverctl(GMATCH <pattern>)
$serverctl(GET <refnum> <param>)
$serverctl(SET <refnum> <param> <val>)


This function is a low-level interface to the client's server structure.

The REFNUM operation takes a server refnum, and returns that refnum if the refnum is valid, or returns the empty string if the refnum is invalid.

The REFNUM operation takes a regular old server description, but only the first two fields are used. The first field should contain a wildcard pattern that will match either an “ourname”, an “itsname”, a group, or an alternate name. If you specify a port number, then the server has to match the port number as well as the host. The operation returns a refnum to an open server if it can, and to a closed server if it must. It returns the empty string if nothing is found.

The REFNUM operation can take a port after the server name, and then any server must match the port as well as the server name. Normally the port is ignored.

The OMATCH, IMATCH, and GMATCH operations match a wildcard pattern against each server's “ourname”, “itsname”, and “groupname” respectively. The return value is a space separated list of server refnums that match.

The LAST_SERVER operation returns the refnum of the last irc server that sent us some data. This cannot be changed by the user.

The FROM_SERVER operation returns the current operative server. This can be changed by the user with XEVAL -s.

The MAX operation returns the highest server refnum in use. This can be used to bound a loop to iterate over all servers.

The ALLGROUPS operation returns a unique word list of all of the server groups that are in use. At this time, this operation does not take any arguments, but that will probably change in the future. You should not pass any arguments to this operation for now.

The GET and SET operations read and write respectively, attributes about a server refnum. Server refnum -1 always refers to the FROM_SERVER.

Attribute name Description
ADDRFAMILY (READ-ONLY) Either “ipv4”, “ipv6”, “unix”, or “unknown”
ADDRSLEFT (READ-ONLY) Number of round-robin addresses from the DNS lookup left for EPIC to try.
ALTNAME (WRITE-ONLY) Add an alternate-server-name for the refnum
ALTNAMES All of the alternate-server-names for the refnum
AUTOCLOSE If set to 1, a window has to be pointing at a server for the server to be (or stay) open. If set to 0, a server does not automatically close just because no windows are pointing at it.
AWAY The server's away message. SETting this will send an AWAY message to the server. SETting this to the empty string clears the AWAY message.
CONNECTED (READ-ONLY) 1 if we are registered with the server and 0 if not
COOKIE The TS4 server cookie
FULLDESC The Fully Qualified Server Description for a server, suitable for recreating a server list file.
GROUP The server group
ITSNAME The name the server calls itself in protocol messages
LOCALPORT When connected, the port number on our host we are using.
MAXCACHESIZE The maximum number of people who can be in a channel that does userhost caching. Channels bigger than this are not cached. Set to 0 to turn off userhost caching entirely.
MAXISON The maximum size of the ISON queue. ISON commands are ignored when the queue is full.
MAXUSERHOST The maximum size of the USERHOST queue. USERHOST commands are ignored when the queue is full.
NAME The hostname that we use to connect to the server
NICKNAME Our official nickname (pending nicknames are not returned)
PASSWORD The password we use to connect to the server
PORT The port on the server's hostname we connect to
QUIT_MESSAGE The message we will use when we QUIT
SSL The “type” field from the server description, either “IRC” or “IRC-SSL”.
STATUS The operational status of a server: see server state.
UMODE (READ-ONLY) The protocol user mode. Use MODE to change.
UNIQUE_ID The IRCNet unique nickname identifier
USERHOST The userhost the server says we're using
VERSION The version of irc software the server is using
005s All of the 005s the server supports
005 <token> Retrieve A particular 005 the server supports
005 <token> <value> Set or change particular 005 the server supports


Return the first server entry for on any port


Tell EPIC to use SSL on server refnum 1

 $serverctl(SET 1 SSL 1)

Return 1 if we can send irc commands to server 2, return 0 if not.

 $serverctl(GET 2 CONNECTED) 

Returns all refnums in server group “EFnet”

 $serverctl(GMATCH EFnet)
serverctl.txt · Last modified: 2019/04/01 17:00 (external edit)