Register forum user name Search FAQ

Gammon Forum

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.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ MXP and Pueblo ➜ MXP and LDMud howto

MXP and LDMud howto

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


Posted by Ettercap   (2 posts)  Bio
Date Fri 24 Feb 2006 04:01 AM (UTC)
Message
I just spent the past 4 days figuring out the basics of MXP in conjunction
to getting it running with the LDMud driver.

There is very little documentation out there for this so I thought I would
post what I had to do in order to get it working here where the largest
amount of MXP information is available.

I used the 3.3.712 driver version available at
http://www.bearnip.com/lars/proj/ldmud.html

For the lib I went basic with the 2.4.5 base provided with the driver. but
this should work for any lib with little modification.

Most of the info you need is buried in the docs for the driver, but I'll
still go through the entire process here.

To start with I untarred and compiled the driver without incident on my
slackware machine.

in /obj/master.c I added a hook to the driver to send all telnet negotiations
directly to the mudlib and included /sys/telnet.h which has all the defines
to handle the negotiations.


#include "/sys/telnet.h"
...
...

void inaugurate_master (int arg)
{
...
...

	set_driver_hook(H_TELNET_NEG, "telnet_neg");
}


This sends all negotiations to the function telnet_neg I defined in living.c
This could also be done in player.c I guess but the docs suggested here
first so thats where I put it. :)

Somewhere in living.c

#include "/sys/telnet./h"
...
...

void telnet_neg( int action, int option, mixed *sb) {
  switch(option) {
    case TELOPT_MXP:
        {
            switch(action) {
                case DO:
                    {
                    		// here you would probably want to set up a variable
                    		// in the player object for in game functionality.
                    		
                        binary_message( ({ IAC,SB,TELOPT_MXP,IAC,SE }), 3);
                        // this has to be sent as a direct response to the
                        // clients <IAC><DO><TELOPT_MXP>
                        
                        break;
                    }
                case WONT:
                    {
                   			// here you would probably want to set up a variable
                    		// in the player object for in game functionality.
                        break;
                    }
                // you can also define cases SB, WILL and DONT if needed.
                // if you dont know much about telnet negotiations google it.
                default:
                    break;
            }
            break;
        }
        // add other negotiation options here the same way.
    default: 
         break;
    }
}


In player.c we need to send an IAC,WILL,TELOPT_MXP using binary_message to
start the negotiation. The docs recommend sending it just before cat'ing
the welcome screen. I expect you could do it anywhere in the login seqeunce
though.. say in move_player_to_start3() if you felt like it.

#include "/sys/telnet.h"
...
...

static int logon() {
    binary_message( ({ IAC, WILL, TELOPT_MXP }), 3);
		cat("/WELCOME");
		...
		...
}


Thats it for the basics of getting MXP to start (with Mushclient.) if you set
Mushclient MXP debug level to 'the lot' you should see the debug window pop
open on connecting and logging into the mud with a 'I 10007: ( 1776) MXP turned on.'


Lastly, you'll need to set up the ESC codes for MXP. I just put them in my
ansi.h as the ESC character is already defined there. This doesnt come
with the lib so you'll have to find one for yourself and add to it. modifying
Nick's set up a bit we get:


#define MXP_BEG ESC+"[1z" // ESC should already be defined
#define MXP_END ESC+"[0z"
#define MXPTAG(arg) MXP_BEG arg MXP_END


Fini. :)

Now I'm off to set up a workable server to handle ANSI/MXP after I read a little
more on the proper implementation of MXP. :)

~Ettercap
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.


10,802 views.

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

Go to topic:           Search the forum


[Go to top] top

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