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.
 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ MXP Login issue

MXP Login issue

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


Posted by Slakker   (4 posts)  Bio
Date Fri 27 Jan 2012 08:17 PM (UTC)

Amended on Sat 28 Jan 2012 09:28 PM (UTC) by Nick Gammon

Message
Hey guys :)

First off,
I'm not a complete noob! =P
It's just been a good 10+ years since I've done any mud coding, so I'm really rusty! I've been busy playing the graphic MMOs, and running a raiding guild, but I miss the creativity and detail of my old texted base gaming days. :)
I was suprised to see one of my old snippets still floating around on Samson's smaugfuss site, kinda gave me a warm fuzzy.. LOL

My Setup: I'm running Smaugfuss1.9 on the latest version of Ubuntu. I've got an old laptop acting as a server on my home network. BTW that compiler is SO picky and complains more then my wife does! =P

Issue:
I added the MXP code posted here on the website, and actually got most of it working!... WOOT! The only bug appears to be while logging in I have to enter my name 2x! depending on the client I use. With Mushclient I get this..

What's your name? or create a new Hero type NEW:      
slakker

No such player exists.
Please check your spelling, or type new to start a new player.

Name: 
slakker
Password: 
Reconnecting.


So concluding the issue is in my code and not the client, I have 2 suspects in comm.c

In void new_descriptor( int new_desc ) just before the greetings I've got

 /*
    * MCCP Compression
    */
   write_to_buffer( dnew, (const char *)will_compress2_str, 0 );

   /*
    *telnet negotiation to see if they support MXP
    */
   write_to_buffer( dnew, (const char *)will_mxp_str, 0 );

   /*
    * Send the greeting.



or in void read_from_buffer( DESCRIPTOR_DATA * d ) which I changed because of lots of signed and unsighed char issues.


if ( d->inbuf[i] == (signed char) IAC)
        {
          if (!memcmp(&d->inbuf[i], mxp_do, strlen(mxp_do)))
          {
            i += strlen(mxp_do) - 1;
            turn_on_mxp (d);
            log_string( "client mxp on" );
          }
          else if (!memcmp(&d->inbuf[i], mxp_dont, strlen(mxp_dont)))
          {
            i += strlen(mxp_dont) - 1;
            d->mxp = FALSE;
            log_string( "client mxp off" );
          }
        }
        else if ( d->inbuf[i] == '\b' && k > 0 )
            --k;
        else if ( isascii(d->inbuf[i]) && isprint(d->inbuf[i]) )
            d->incomm[k++] = d->inbuf[i];



I'd appreciate and suggestions on how to solve this.. thanks :)

[Moderator edit] Fixed code inside code tags.
Top

Posted by Slakker   (4 posts)  Bio
Date Reply #1 on Sat 28 Jan 2012 06:21 AM (UTC)
Message
Ok figured out the problem. I just needed to move the client checks farther down in read_from_buffer. Works great now expect I've discovered I lose MXP whenever I do a hotboot/copyover, but that should be an easy fix.
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,643 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.