[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  MXP and Pueblo
. . -> [Subject]  Enabling MXP on C# code
Home  |  Users  |  Search  |  FAQ
Register forum user name
Forgotten password?

Enabling MXP on C# code

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Posted by Wjmurdick   (13 posts)  [Biography] bio
Date Fri 02 Oct 2009 10:22 PM (UTC)
Been trying to get MXP enabled on a custom codebase.

Using C# and .NET and I've got a TCPClient and NetworkStream object.

I've tried sending a byte array with the codes (IAC, SB, TELOPT_MXP, IAC, SE) as well as the MXP START codes. But I can't for the life of me get it to enable.

Anyone familiar with C# and the TCPClient/NetworkStream and could give me some pointers?

byte[] buffer = new byte[5];
buffer[0] = User.IAC;
buffer[1] = User.SB;
buffer[2] = (byte)User.TELOPT_MXP;
buffer[3] = User.IAC;
buffer[4] = User.SE;
clientStream.Write(buffer, 0, 5);

buffer = new byte[4];
buffer = encoder.GetBytes(User.ESC + "[6z");
clientStream.Write(buffer, 0, 4);


Jason (wjmurdick at gmail dot com)
[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Reply #1 on Sat 03 Oct 2009 08:09 AM (UTC)
Not familiar with MXP (yet), nor with C#, but since I finished implementing a custom telnet stack for my own codebase yesterday, everything is fresh in my mind.

First of all, just saying IAC WILL MXP won't give you MXP if the client isn't written (AND configured) to support it. Using MUSHclient it is really easy to find out. Just go to Edit->Debug Packets, and try connecting to your mud.

You'll want to see your side send IAC WILL MXP (hex: FF FB 5B), and you'll want your client to say (either before or after the WILL, should not matter) IAC DO MXP (hex: FF FD 5B).

At this point, you have a succesful handshake where your server acts as the server. Only at this point can you enable it with the command you mentioned (I can't find anything in the MXP specs to corroborate that command, but that specification document sucks): IAC SB MXP IAC SE (hex: FF FA 5B FF F0).

If you have any other questions, feel free to ask.
[Go to top] top

Posted by Nick Gammon   Australia  (21,677 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Sat 03 Oct 2009 09:56 PM (UTC)
Take a look at this page:


That shows the telnet sequences needed for, first seeing if the client supports MXP, and secondly, turning it on.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Wjmurdick   (13 posts)  [Biography] bio
Date Reply #3 on Sat 03 Oct 2009 10:10 PM (UTC)
Oh, thats where I got the sequences from in the first place. And I know the client I'm testing it with does, its zmud. I'm sending the enable sequence it just isn't working.

Hahah... Turns out I wasn't sending all of the proper sequences... I sent "IAC, SB, TELOPT_MXP, IAC, SE" but then forgot to send "IAC, DO, TELOPT_MXP".

Thanks guys!

[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum

[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]