On Wed, 23 Jan 2002, Steven Radziul wrote:
SR> Greets,
SR>
SR> Since I hear so much about MXP and MSP and all that, is there a FAQ out
SR> there far as how to install this into a ROM based mud anywhere? I haven't
SR> seen it come over the net recently.
it's a pain, use mushclient instead zmud or you will never get the <support>
tag working since v6.24 and older has a bug in it that prevents zmud from
responding to the <support> tag, it responds only to <support tagname>, if i
remember right you have my telopt code, just copy the MTELOPT macro, modify it
and use that for the negotiation if you want 2 way communication. though you
could just check if the client confirms mxp in the telopt negotiation and then
just send it to them anyway, i think that mav does something like that. you can
get the specs for it from zuggs site and i nick gammon [mushclient author] has
little better explanation of it on his site, together with some example on how
to implement it in rom based muds, only thing you may want to change on his
stuff is to send the <version> tag first and if the client responds to it and
returns mxp version >= 0.4, use something like this snip below to respond to
it:
char *data;
char file[MSL];
FILE *fp;
char *p;
sprintf(file,"%smxp_config.dat",DATA_DIR);
if ((fp = fopen(file,"r")) == NULL)
return;
data = FREAD_FILE(fp);
p = data;
do {
switch (*p)
{
default:
break;
case '\n':
case '\r':
case ' ':
case '\t':
strcpy(p,p+1); // *p = ' ';
continue;
break;
}
p++;
} while ( *p != '\0' );
write_to_descriptor(d, data, 0);
free_string(data);
fclose(fp);
what it does is that it reads the data from mxp_config.dat file and removes any
cr/lf's and spaces from it, so no garbage will show when the config stuff is
sent to the client and you can format/indent the config file so it don't
have to be one nasty long line.
this is the pd mxp_config.dat file, i've hammered out this with mav and from
nicks faq, and it works well:
<!ELEMENT RName '' FLAG="RoomName">
<!ELEMENT RDesc FLAG='RoomDesc'>
<!ELEMENT RExits '' FLAG='RoomExit'>
<!ELEMENT Ex "<send href='&name;|look &name;' HINT='Right click to see exit
menu|Go &name;|Look &name;'>" ATT='name'>
<!ELEMENT prompt FLAG="Prompt">
<!ELEMENT hitp FLAG="Set hitp">
<!ELEMENT maxhitp FLAG="Set maxhitp">
<!ELEMENT whitp FLAG="Set whitp">
<!ELEMENT mana FLAG="Set mana">
<!ELEMENT maxmana FLAG="Set maxmana">
<!ELEMENT wmana FLAG="Set wmana">
<!ELEMENT move FLAG="Set move">
<!ELEMENT maxmove FLAG="Set maxmove">
<!ELEMENT wmove FLAG="Set wmove">
<!ELEMENT combat FLAG="Set combat">
<!ELEMENT Get "<send href='get '&name;'|examine '&name;'|read
'&name;'|look in '&name;'|drink '&name;'' hint='Right
click to use &desc;|Get &desc;|Examine &desc;|Read &desc;|Look in &desc;|Drink
from &desc;'>" ATT='name desc'>
<!ELEMENT Drop "<send href='drop '&name;'|examine '&name;'|look
in '&name;'|wear '&name;'|eat '&name;'|drink
'&name;'' hint='Right click to use this object|Drop &desc;|Examine
&desc;|Look inside &desc;|Wear &desc;|Drink &desc;'>" ATT='name desc'>
<!ELEMENT List "<send href='buy '&name;'' hint='Buy &desc;'>" ATT='name
desc'>
<!ELEMENT Equi "<send href='examine '&name;'|look in
'&name;'|remove '&name;'' hint='Right click to use this
object|Examine &desc;|Look inside &desc;|Remove &desc;'>" ATT='name desc'>
<!ELEMENT Port "<send href='enter &name;|look in &name;' HINT='Right click for
list of portal commands|Enter '&desc;'|Look in '&desc;''>"
ATT='name desc'>
don't forget to use the \e[1z before you send the stuff and i use \e[7z on the
end of every mxp tag/line so nothing except the tags is parsed, i did this when
i found out that both zmud and mushclient get confused if there is < or > chars
in the normal output, the \e[7z locks out any parsing of anything that is
between <> chars. that is good for 2 reasons, 1. i didn't have to changed a
damn thing in the helps and stuff, and 2. there is no way possible that the
players could sneak fake mxp tags in and mess up other players zmud/mushclient.
until version 6.24 there was a bug in the zmud that allowed sending zmud
commands with the <send> tag and zmud would process them, this was really nice
for setting up hp/mana/mv/combat gauges and stuff, but zugg fixed it in 6.25
since i tried to show him another bug and he figured out what i was doing with
it :)
don't bother trying to use the <GAUGE> tag because there is still bug in the
zmud and mushclient doesn't support it. if you really want to use the gauges
[imho that is the only thing that was worth in mxp] you can still use the
<SEND> tag if you add the PROMPT argument on the end of it, though you will
have to instruct the zmud player to hit enter when the stuff pops out in their
prompt. the format of the exported script with the gauge settings probably
changed in 6.25 though i haven't checked that yet. so you may want to check the
version and send string corresponding to the version.
well that's all i can remember right now, and no i'm not going to write mxp
tutorial :) ask pete .. if he is willing, i'll donate the code for it to him ;)
Dingo.
).|.(
'.'___'.'
' '(>~<)' '
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-ooO-=(_)=-Ooo-=-=-=-=-=-=-=-=-=-=-=-=-=-
Debian version 2.2.18pre21, up 3 days, 14 users, load average: 1.00
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-