Queston on funny Rom24b6 MXP text

Posted by Drithentir on Fri 09 Sep 2005 10:40 AM — 15 posts, 40,477 views.

Canada #0
Hi there, with the help of these forum posters, I was able to get a ROM 2.4b6 with MXP working, but now I've run into another snag:

What's this?

By what name do you wish to be known? Drithentir
Password:
<!ELEMENT Ex '<send>' FLAG=RoomExit><!ELEMENT rdesc '<p>' FLAG=RoomDesc><!ELEMENT Get "<send href='get &#39;&name;&#39;|examine &#39;&name;&#39;|drink &#39;&name;&#39;' hint='RH mouse click to use this object|Get &desc;|Examine &desc;|Drink from &desc;'>" ATT='name desc'><!ELEMENT Drop "<send href='drop &#39;&name;&#39;|examine &#39;&name;&#39;|look in &#39;&name;&#39;|wear &#39;&name;&#39;|eat &#39;&name;&#39;|drink &#39;&name;&#39;' hint='RH mouse click to use this object|Drop &desc;|Examine &desc;|Look inside &desc;|Wear &desc;|Eat &desc;|Drink &desc;'>" ATT='name desc'><!ELEMENT List "<send href='buy &#39;&name;&#39;' hint='Buy &desc;'>" ATT='name desc'><!ELEMENT Player "<send href='tell &#39;&name;&#39; ' hint='Send a message to &name;' prompt>" ATT='name'>


I assume that's some weird MXP gibberish? How do I fix it? Thanks.
USA #1
That's what MXP is. Does your client support MXP?
Canada #2
zMUD 6.16, so I assume so.

Wow fast response :P


Second question, I'm a bit rusty on my C, so what does this mean again and how do I fix it? I prefer not to have warning ready to pounce on me and become errors later.


Comm.c line 421 Warning: implicit declaration of function 'close'
Comm.c line 1073 Warning: implicit declaration of function 'read'
Comm.c line 151 Warning: implicit declaration of function 'write'


Thank you very much.
USA #3
Do you have MXP enabled on Zmud? It seems like it is not interpreting it.

Try to copy/paste the errors exactly from now on.

I would assume you forgot to include a file. Can you paste those lines?
Canada #4
That's the error exactly from zMUD. I gave up on using MXP because I figured some players might not be using zMUD and so I restarted with a base ROM24b6



OK the error is this:

comm.c: In function 'main':
comm.c:421: warning: implicit declaration of function 'close'
comm.c: In function 'read_from_descriptor':
comm.c:1073: warning: implicit declaration of function 'read'
comm.c: In function 'write_to_descriptor':
comm.c:1531: warning: implicit declaration of function 'write'

This is straight vanilla ROM 24b6. Sorry about the confusion last night, it was really late :P


CC = gcc
PROF = -O -g
NOCRYPT = -DNOCRYPT
C_FLAGS = -Wall $(PROF) $(NOCRYPT) -DOLD_RAND
L_FLAGS = $(PROF)
LIBS = -lcrypt

O_FILES = act_comm.o act_enter.o act_info.o act_move.o act_obj.o act_wiz.o \
alias.o ban.o comm.o const.o db.o db2.o effects.o fight.o flags.o \
handler.o healer.o interp.o note.o lookup.o magic.o magic2.o \
music.o recycle.o save.o scan.o skills.o special.o tables.o \
update.o

rom: $(O_FILES)
rm -f rom
$(CC) $(L_FLAGS) -o rom $(O_FILES) $(LIBS)

.c.o: merc.h
$(CC) -c $(C_FLAGS) $<

That's the MAKEFILE

Thank you for your time.
USA #5
ZMud isn't the only client that supports MXP, I see no reason to remove it I suppose.

Can you show me those lines in comm.c?
USA #6
MXP isn't really supposed to be enabled by default, rather the MUD is supposed to negotiate with the client. I'm a little surprised that the codebase is spitting it out without "asking", as it were.

For the functions you probably need to include unistd.h or something like that.
Canada #7
Yeah I found that funny in regards to the MXP, otherwise it would be a pretty poor piece of code. I got the MXP enabled ROM 24b6 off this site, anyone with more experience than me able to figure out the toggle to turn it on/off?

Thanks again.
Canada #8
#if defined(unix)
control = init_socket( port );
boot_db( );
sprintf( log_buf, "ROM is ready to rock on port %d.", port );
log_string( log_buf );
game_loop_unix( control );
close (control); <--Line 421
#endif




#if defined(MSDOS) || defined(unix)
for ( ; ; )
{
int nRead;

nRead = read( d->descriptor, d->inbuf + iStart, <--Line 1073
sizeof(d->inbuf) - 10 - iStart );
if ( nRead > 0 )
{
iStart += nRead;
if ( d->inbuf[iStart-1] == '\n' || d->inbuf[iStart-1] == '\r' )
break;
}
else if ( nRead == 0 )
{
log_string( "EOF encountered on read." );
return FALSE;
}
else if ( errno == EWOULDBLOCK )
break;
else
{
perror( "Read_from_descriptor" );
return FALSE;
}
}
#endif

d->inbuf[iStart] = '\0';
return TRUE;
}



bool write_to_descriptor( int desc, char *txt, int length )
{
int iStart;
int nWrite;
int nBlock;

#if defined(macintosh) || defined(MSDOS)
if ( desc == 0 )
desc = 1;
#endif

if ( length <= 0 )
length = strlen(txt);

for ( iStart = 0; iStart < length; iStart += nWrite )
{
nBlock = UMIN( length - iStart, 4096 );
if ( ( nWrite = write( desc, txt + iStart, nBlock ) ) < 0 ) <--Line 1531
{ perror( "Write_to_descriptor" ); return FALSE; }
}

return TRUE;
}

USA #9
MXP must be turned on/off via the client. You'll have to look through the ZMud options.

Did you try the include Ksilyan suggested?
Canada #10
Nevermind about the comm.c, it was true, adding #include <unistd.h> helped.

Thanks a bunch :)

Now to figure out what's with MXP. I'm going to see if adding it manually from an MXP package has any difference


Canada #11
So what if telnet tried accessing the MUD with MXP? I mean right now I got weird gibberish from a zMUD with MXP. This is new grounds for me because the last MUD I was on was more "traditional".
USA #12
Right, telnet does not support MXP. But there should be a ingame option to toggle MXP off or on. (Most MUDs ask when you create your character)

It means that Zmud doesn't have the MXP option on. You'll have to turn it on.
USA #13
Well, there's either the in-game option, or the negotiation option. My MUD negotiates with the client, so if the client supports it the MUD enables MXP automatically. I modified the code that Nick provides on this website to enable MXP for SMAUG.

But yes, simply turning it on by default isn't very "polite"... what Zeno suggested, asking for MXP support at character creation, is a good idea. The only problem with that is that you can't get MXP until the character has logged in. On my MUD I can use MXP for auto-login, which is sort of nifty.
Canada #14
Hrm, guess I'll do without MXP for now until I know someone on the dev team will actually use the thing. :P