Telnet negotiation

Posted by Nick Gammon on Tue 05 Jun 2001 01:35 AM — 1 posts, 11,515 views.

Australia Forum Administrator #0
The MXP spec defines a telnet negotiation sequence for determining if a client supports MXP or not.

MUSHclient extends that slightly by also recognising a sequence to "turn on MXP" in addition to one that queries whether or not it supports MXP.

For the benefit of MUD implementors, here are the relevant sequences. Sequence like <IAC> are not literally sent, they represent a single byte from the telnet negotiation protocol. The equivalents in hex are given underneath.



Do you support MXP?

(Sent from server to client)


<IAC><WILL><MXP>

which in hex is: 0xFF 0xFB 0x5B




Client supports MXP (and player wants to use it)

(Sent from client to server)


<IAC><DO><MXP>

which in hex is: 0xFF 0xFD 0x5B


Note - if you have MUSHclient's "Use MXP" option set to "On MXP Query" it starts expecting MXP tags from this point on, to be compliant with MUDs that don't implement the "turn on MXP" negotiation described below.



Client does not support MXP (or player does not want to use it)

(Sent from client to server)


<IAC><DONT><MXP>

which in hex is: 0xFF 0xFE 0x5B



Note - if you have MUSHclient's "Use MXP" option set to "No" it will send the <IAC><DONT><MXP> sequence described here.



Server is ready to start sending MXP

(Sent from server to client)


<IAC><SB><MXP><IAC><SE>

which in hex is: 0xFF 0xFA 0x5B 0xFF 0xF0


Following this sequence the server can then start sending MXP tags.

Note - if you have MUSHclient's "Use MXP" option set to "On MXP Command" it starts expecting MXP tags from this point onwards.




Stop using MXP

MUSHclient also supports the MXP tag


<MXP OFF>


... which tells it to stop interpreting MXP codes. The server should send this if the player types in a command to stop using MXP codes.