GMCP |
Discworld Player Help |
GMCP |
Name
Generic Mud Communication Protocol
Description
GMCP is a mud client protocol which, unlike for instance MXP, does not have pre-defined behaviour. MUDs can use it to send extra information to the player. Players can write client plugins to use this information.
This help file does not explain the way GMCP works; information about this is available on the internet, or in the documentation of various mud clients. It does explain the features supported by Discworld.
Supported Features
At the moment, Discworld supports six GMCP commands:
* char.login
* char.info
* char.vitals
* room.info
* room.map
* room.writtenmap
The first two of these is sent when you log in. Here, char.login supplies the name of your character, and char.info supplies some additional static information such as guild and character role.
The third (char.vitals) is sent whenever you send a command (much like the prompt) and supplies your hitpoints, guildpoints, experience points, alignment and burden.
The other three are sent whenever you look, glance or enter a room. Here, room.info sends some information on the current room: the room name, room identifier, its status (e.g. inside, outside, underwater) and whether you're currently able to see (and get updated info) in the room. The two map commands send a small minimap to your client, which may be empty if vision is bad (for instance in the case of snow). Unless you have maps set to plain (see options output map), the "room.map" command will include colour codes.
Starting GMCP
So how to get this data, you may ask.
Well, the technical details depend on your mud client. However, to get GMCP started, your client should send the following when you connect to Discworld (after GMCP was successfully negotiated):
core.hello { "client" : "<your client name>", "version" : "<client version>" }
core.supports.set [ "char.login", "char.info", "char.vitals", "room.info", "room.map", "room.writtenmap" ]
If you don't support a particular feature (for example, you only support char.vitals, not the room commands) you can of course omit this feature from the list.
On Triggers and Timers
To send GMCP commands after connecting, you may be inclined to use a trigger. This is allowed, provided only GMCP communication is sent.
Triggers and timers which send anything that could make your character unidle are not allowed. This includes blank lines! So you may not, for instance, automatically send a blank line every 10 seconds to keep your char.vitals updated. If you set up GMCP triggers, make sure they do not accidentally do this.