For my own morbid curiosity..

Posted by Toy on Sun 08 Feb 2004 07:42 PM — 16 posts, 58,788 views.

#0
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
Canada #1
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).
Australia Forum Administrator #2
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.
#3
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
Canada #4
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.
#5
    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
#6
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
Canada #7
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
#8
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
Canada #9
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.
#10
Yup, you were right. Wrong password didn't matter the way I had it. Thanks for noticing that.

-Toy
#11
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
#12
Sorry. Typo:

more should be move

-Toy
Australia Forum Administrator #13
You can edit your own posts, you know, Toy.
#14
Hehe... didn't realize that. My bad. :)

-Toy
Canada #15
What you want to do is look at CON_PRESS_ENTER, and see what it does. If it sets the d->connected = CON_PLAYING, and do_look(ch, "auto");, then replace where you set them to CON_PRESS_ENTER with whatever it does. I hope thats makes some sort of sense. Basically, cut CON_PRESS_ENTER out of the loop.