Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Entire forum
➜ MUSHclient
➜ MXP and Pueblo
➜ Enabling MXP on C# code
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Wjmurdick
(13 posts) Bio
|
Date
| Fri 02 Oct 2009 10:22 PM (UTC) |
Message
| 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);
-----------
Thanks!
Jason (wjmurdick at gmail dot com) | Top |
|
Posted by
| Worstje
Netherlands (899 posts) Bio
|
Date
| Reply #1 on Sat 03 Oct 2009 08:09 AM (UTC) |
Message
| 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.
| Top |
|
Posted by
| Nick Gammon
Australia (23,120 posts) Bio
Forum Administrator |
Date
| Reply #2 on Sat 03 Oct 2009 09:56 PM (UTC) |
Message
| |
Posted by
| Wjmurdick
(13 posts) Bio
|
Date
| Reply #3 on Sat 03 Oct 2009 10:10 PM (UTC) |
Message
| 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!
| 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.
21,734 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top