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 ➜ SMAUG ➜ SMAUG coding ➜ For my own morbid curiosity..

For my own morbid curiosity..

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


Pages: 1 2  

Posted by Toy   (206 posts)  Bio
Date Sun 08 Feb 2004 07:42 PM (UTC)
Message
How would one go about removing the need for the RIP, ANS, and ASC mudtitle files. I put in a menu at startup that loadups up after those files, and I'm thinking that I could prolly just do without em. Any advice?

-Toy

It's always good to know how far you are willing to go to be the best...

Karl Mancine
aka
Toy the Dark Puppet
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #1 on Sun 08 Feb 2004 10:28 PM (UTC)
Message
Since they are not used at all in SWR, you could take a look at that codebase. The other option is to go through, find whereever they are referenced/written/read, and just get rid of that code(and the appropriate code in comm.c). Unless there is something horribly wrong with that(I don't know smaug as well as I do SWR, it should work).

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
Top

Posted by Nick Gammon   Australia  (23,169 posts)  Bio   Forum Administrator
Date Reply #2 on Mon 09 Feb 2004 08:08 PM (UTC)
Message
There are 3 functions in act_comm.c, namely: send_rip_screen, send_rip_title, send_ansi_title.

You could delete those, and references to them.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Toy   (206 posts)  Bio
Date Reply #3 on Wed 18 Feb 2004 01:06 PM (UTC)
Message
I attempted to remove the calls as you suggested Nick, and they seemed to work until I tried to log in. After I input my password it shows this:

Last connected from 127.0.0.1

Wrong Password.

And now I can't log in. I removed the calls in both act_comm.c and comm.c for send_title and show_rip_title and show_ansi title.

-Toy

It's always good to know how far you are willing to go to be the best...

Karl Mancine
aka
Toy the Dark Puppet
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #4 on Wed 18 Feb 2004 05:45 PM (UTC)
Message
What probably happened in the mess that is nanny() is that after removing all the calls to those functions, your d->connected is supposed to be set to GET_RIP or GET_ANSI or something, but you removed it, and it is staying at GET_OLD_PASSWORD. Make sure that at the end of GET_OLD_PASSWORD that your changing d->connected to the next on in the login order, whichever that may be. If you need to, check your old code for what it used to do ( if it went "password" to "ansi" to "press enter", change it to "password" to "press enter")

Hope that helps.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
Top

Posted by Toy   (206 posts)  Bio
Date Reply #5 on Wed 18 Feb 2004 07:22 PM (UTC)
Message
    case CON_GET_OLD_PASSWORD:
	write_to_buffer( d, "\n\r", 2 );

	if ( strcmp( crypt( argument, ch->pcdata->pwd ), ch->pcdata->pwd ) )
	{
	    write_to_buffer( d, "Wrong password.\n\r", 0 );
	    /* clear descriptor pointer to get rid of bug message in log */
	    d->character->desc = NULL;
	    close_socket( d, FALSE );
	    return;
	}

	write_to_buffer( d, echo_on_str, 0 );

	if ( check_playing( d, ch->pcdata->filename, TRUE ) )
	    return;

	chk = check_reconnect( d, ch->pcdata->filename, TRUE );
	if ( chk == BERR )
	{
	    if ( d->character && d->character->desc )
	      d->character->desc = NULL;
	    close_socket( d, FALSE );
	    return;
	}
	if ( chk == TRUE )
	  return;

	sprintf( buf, ch->pcdata->filename );
	d->character->desc = NULL;
	free_char( d->character );
	d->character = NULL;
	fOld = load_char_obj( d, buf, FALSE );
	ch = d->character;
        if ( ch->position ==  POS_FIGHTING
          || ch->position ==  POS_EVASIVE
          || ch->position ==  POS_DEFENSIVE
          || ch->position ==  POS_AGGRESSIVE
          || ch->position ==  POS_BERSERK )
		ch->position = POS_STANDING;

	sprintf( log_buf, "%s@%s(%s) has connected.", ch->pcdata->filename, 
		d->host, d->user );
	if ( ch->level < LEVEL_IMMORTAL )
	{
	  /*to_channel( log_buf, CHANNEL_MONITOR, "Monitor", ch->level );*/
	  log_string_plus( log_buf, LOG_COMM, sysdata.log_level );
	}
	else
	  log_string_plus( log_buf, LOG_COMM, ch->level );
//	show_title(d);
	break;


Ok, the only thing I changed in OLD_PASSWORD was commenting out show_title(d);.

When I log in it goes to

Password:

Last connected from 127.0.0.1

Wrong Password.


-Toy

It's always good to know how far you are willing to go to be the best...

Karl Mancine
aka
Toy the Dark Puppet
Top

Posted by Toy   (206 posts)  Bio
Date Reply #6 on Wed 18 Feb 2004 07:25 PM (UTC)
Message
Sorry... forgot to post this as well.

	    /* Old player */
	    write_to_buffer( d, "Password: ", 0 );
	    write_to_buffer( d, echo_off_str, 0 );
	    d->connected = CON_GET_OLD_PASSWORD;
	    return;


-Toy

It's always good to know how far you are willing to go to be the best...

Karl Mancine
aka
Toy the Dark Puppet
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #7 on Wed 18 Feb 2004 08:33 PM (UTC)
Message
Ok, thats the problem. This is my version of show_title
void show_title( DESCRIPTOR_DATA *d )
{
    CHAR_DATA *ch;

    ch = d->character;

    if ( !IS_SET( ch->pcdata->flags, PCFLAG_NOINTRO ) )
    {
	if (IS_SET(ch->act, PLR_ANSI))
	  send_ansi_title(ch);
	else
	  send_ascii_title(ch);
    }
    else
    {
      write_to_buffer( d, "Press enter...\n\r", 0 );
    }
    d->connected = CON_PRESS_ENTER;
}
That last line is the important one, because it changes d->connected, which nanny() uses to figure out if it should send your command it interperate, or try to log you in, or if you are in a writing buffer, etc. If you don't change it, it will assume that your still confirming your password, and when you just hit enter, it will boot you out cause enter does not match your password.

The fix? You can just change show_title to this:
void show_title( DESCRIPTOR_DATA *d )
{
    CHAR_DATA *ch;

    ch = d->character;
    write_to_buffer( d, "Press enter...\n\r", 0 );
    d->connected = CON_PRESS_ENTER;
}
and uncomment show_title, or after the commented call, but the bolded line into CON_GET_OLD_PASSWORD

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
Top

Posted by Toy   (206 posts)  Bio
Date Reply #8 on Thu 19 Feb 2004 12:17 AM (UTC)
Message
Thanks Greven. All I had to do was this:

	    /* Old player */
	    write_to_buffer( d, "Password: ", 0 );
	    write_to_buffer( d, echo_off_str, 0 );
	    d->connected = CON_GET_OLD_PASSWORD;
	    d->connected = CON_PRESS_ENTER;
	    return;


And it worked fine.

-Toy

It's always good to know how far you are willing to go to be the best...

Karl Mancine
aka
Toy the Dark Puppet
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #9 on Thu 19 Feb 2004 01:26 AM (UTC)
Message
Uhhh, small problem with that, I beleive that makes it so that they don't have to enter any password at all, check that. The better method would be:
	sprintf( log_buf, "%s@%s(%s) has connected.", ch->pcdata->filename, 
		d->host, d->user );
	if ( ch->level < LEVEL_IMMORTAL )
	{
	  /*to_channel( log_buf, CHANNEL_MONITOR, "Monitor", ch->level );*/
	  log_string_plus( log_buf, LOG_COMM, sysdata.log_level );
	}
	else
	  log_string_plus( log_buf, LOG_COMM, ch->level );
//	show_title(d);
	d->connected = CON_PRESS_ENTER;
	break;

That would probably work better. Then again, if a wrong password actually disconnects your character, then you have no problem, but from what I can see, that is a problem.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
Top

Posted by Toy   (206 posts)  Bio
Date Reply #10 on Thu 19 Feb 2004 01:49 AM (UTC)
Message
Yup, you were right. Wrong password didn't matter the way I had it. Thanks for noticing that.

-Toy

It's always good to know how far you are willing to go to be the best...

Karl Mancine
aka
Toy the Dark Puppet
Top

Posted by Toy   (206 posts)  Bio
Date Reply #11 on Thu 19 Feb 2004 08:16 PM (UTC)
Message
Quick question: Everything works fine, I just need help with this:

Last connected from *ip*

Whenever you log in, it reaches that line and goes no further until a player hits enter. How do I set it so it'll automatically hit enter and more on to the next screen?

-Toy

It's always good to know how far you are willing to go to be the best...

Karl Mancine
aka
Toy the Dark Puppet
Top

Posted by Toy   (206 posts)  Bio
Date Reply #12 on Thu 19 Feb 2004 08:16 PM (UTC)
Message
Sorry. Typo:

more should be move

-Toy

It's always good to know how far you are willing to go to be the best...

Karl Mancine
aka
Toy the Dark Puppet
Top

Posted by Nick Gammon   Australia  (23,169 posts)  Bio   Forum Administrator
Date Reply #13 on Thu 19 Feb 2004 09:04 PM (UTC)
Message
You can edit your own posts, you know, Toy.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Toy   (206 posts)  Bio
Date Reply #14 on Thu 19 Feb 2004 11:41 PM (UTC)
Message
Hehe... didn't realize that. My bad. :)

-Toy

It's always good to know how far you are willing to go to be the best...

Karl Mancine
aka
Toy the Dark Puppet
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.


54,328 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

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.