This is an old revision of the document!


Dune and GMCP

Generic Mud Communication Protocol (GMCP) is a way for Dune to send your MUD client extra information that isn't printed as game text. This is a helpful way to get extra context you can use for scripts and triggers. As a simple example, Dune can send a GMCP message to a GMCP enabled client when your character's health has changed so that you could automatically use a healing command.

GMCP Messages

Presently Dune only supports sending you GMCP messages as output. We do not support any GMCP input commands.

Some messages are sent whenever data changes, and will only contain the parts of the data that has changed since the last message. If you want to maintain a full picture of this kind of message's information you must store the data client-side as it arrives and update it over time. See the supported messages documentation that follows for more details.

Supported Modules

Dune supports opting in to different categories of GMCP messages by telling the game which your client supports. Some clients (like Mudlet) will do this automatically for some packages. Others (like Blightmud) require you to opt-in explicitly.

Name Description
Char Character information
Room Room information
Comm.Channel Channel information 1)
Guild Guild specific information 2)

Supported Messages by Module

Char

TODO

Room

TODO

Comm.Channel

TODO

Guild

TODO

Client Setup

How to use GMCP messages sent by Dune depends on which MUD client you're using.

Mudlet

You can use gmod.enableModule(“USERNAME”, “XXX”) from Lua code to opt-in to a supported module. E.g. use gmod.enableModule(“sneak”, “Comm.Channel”) to have in-game channel echo turned off and channel messages sent only via GMCP. You can use whatever you want for the first username argument, it has no relation to your in-game character.

By default Mudlet enables Char and Room modules, and Dune sends Guild by default. Only enable Comm.Channel if you have set up a channel capture trigger.

See the Mudlet wiki for more information.

Blightmud

To use Dune's GMCP data in Blightmud you'll have to set up a script that will register some of the supported packages described above, and add handlers to do something with the received data.

You can use gmcp.register(“XXXX”) from Lua code to opt-in to a supported module. E.g. use gmcp.register(“Comm.Channel”) to have in-game channel echo turned off and channel messages sent only via GMCP.

Example:

function gmcp_init()
  --Uncomment next line to see all raw GMCP messages (good for debugging).
  --gmcp.echo(true)
 
  -- Register some packages to get information sent from the MUD.
  gmcp.register('Room')
  gmcp.register('Room.Info')
  gmcp.register('Char')
  gmcp.register('Char.Info')
  gmcp.register('Char.Vitals')
  gmcp.register('Char.Guild')
 
 -- Example handler for receiving room info
  gmcp.receive('Room.Info', function(data)
    obj = json.decode(data)
    blight.output("You're now in room: " .. data['name'])
  end)
end
 
gmcp.on_ready(gmcp_init)

See /help gmcp from inside Blightmud for more information.

Other

Other MUD clients that support GMCP can be made to work with Dune but it will require you to figure out how to configure it. Consider adding steps to this wiki page!

1)
Disables in-game channel echo when enabled.
2)
Enabled automatically for all GMCP clients.