Try this, see if it works out for you.
case CON_GET_LNAME:
argument[0] = UPPER(argument[0]);
if ( !check_parse_name( argument ) )
{
write_to_buffer( d, "Illegal lastname, try another.\n\r",
0 );
write_to_buffer( d, "\n\rLastname: ", 0 );
return;
}
ch->lname = str_dup( argument );
sprintf( buf, "Did I get that right, %s %s (Y/N)? ",
ch->name, ch->lname );
write_to_buffer( d, buf, 0 );
d->connected = CON_CONFIRM_LNAME;
return;
break;
case CON_CONFIRM_LNAME:
switch ( *argument )
{
case 'y': case 'Y':
sprintf(buf, "\n\rGive me a password for %s %s: %s",
ch->name, ch->lname, echo_off_str );
write_to_buffer( d, buf, 0 );
d->connected = CON_GET_NEW_PASSWORD;
break;
case 'n': case 'N':
free_string( ch->lname );
ch->lname = str_dup( "" );
write_to_buffer( d, "Ok, what IS it, then? ", 0 );
d->connected = CON_GET_LNAME;
break;
default:
write_to_buffer( d, "Please type Yes or No? ", 0 );
break;
}
break;
- Valnir
----- Original Message -----
From: "Jesse Boulianne" <[EMAIL PROTECTED]>
To: "Richard Lindsey" <[EMAIL PROTECTED]>; <[email protected]>
Sent: Friday, January 23, 2004 10:15 AM
Subject: Re: [CON_* States] - New - Last Names
> Ok.
>
> Here's the requested con states:
>
> case CON_CONFIRM_NEW_NAME:
> switch ( *argument )
> {
> case 'y': case 'Y':
> sprintf( buf, "New character.\n\rGive me a last name for %s:
> %s",
> ch->name, lname );
> ch->pcdata->socket = str_dup( d->host );
> ch->lname = lname;
> write_to_buffer( d, buf, 0 );
> d->connected = CON_GET_LNAME;
> break;
>
> case 'n': case 'N':
> write_to_buffer( d, "Ok, what IS it, then? ", 0 );
> free_char( d->character );
> d->character = NULL;
> d->connected = CON_GET_NAME;
> break;
>
> default:
> write_to_buffer( d, "Please type Yes or No? ", 0 );
> break;
> }
> break;
> case CON_GET_LNAME:
> argument[0] = UPPER(argument[0]);
> if ( !check_parse_name( argument ) )
> {
> write_to_buffer( d, "Illegal lastname, try another.\n\r",
> 0 );
> write_to_buffer( d, "\n\rLastname: ", 0 );
> return;
> }
> sprintf( buf, "Did I get that right, %s %s (Y/N)? ", ch->name,
> argument );
> write_to_buffer( d, buf, 0 );
> d->connected = CON_CONFIRM_LNAME;
> return;
> break;
>
> case CON_CONFIRM_LNAME:
> switch ( *argument )
> {
> case 'y': case 'Y':
> sprintf(buf, "\n\rGive me a password for %s %s: %s", ch->name,
> ch->lname, echo_off_str );
> write_to_buffer( d, buf, 0 );
> d->connected = CON_GET_NEW_PASSWORD;
> break;
>
> case 'n': case 'N':
> write_to_buffer( d, "Ok, what IS it, then? ", 0 );
> d->connected = CON_GET_LNAME;
> break;
>
> default:
> write_to_buffer( d, "Please type Yes or No? ", 0 );
> break;
>
> ----- Original Message -----
> From: "Richard Lindsey" <[EMAIL PROTECTED]>
> To: "Jesse Boulianne" <[EMAIL PROTECTED]>; <[email protected]>
> Sent: Friday, January 23, 2004 10:16 AM
> Subject: RE: [CON_* States] - New - Last Names
>
>
> How about you go ahead and post the con statements just so we can make
> sure you're substituting variable names and whatnot correctly...
>
> Richard Lindsey
> Network Administrator
> INTERA, Inc.
> 9111A Research Blvd.
> Austin, TX 78758
> (512) 425-2006
> [EMAIL PROTECTED]
>
>
> -----Original Message-----
> From: Jesse Boulianne [mailto:[EMAIL PROTECTED]
> Sent: Friday, January 23, 2004 9:04 AM
> To: [email protected]
> Subject: [CON_* States] - New - Last Names
>
> I am in the process of adding lastnames to the creation process.
> So far, I have everything working through 2 CON states - CON_GET_LNAME
> and
> CON_CONFIRM_LNAME
>
> In confirm_lname, a string displays the characters first and last names
> and
> asks if that's what the player wants (an ugly hack from
> con_confirm_name).
> After entering Y for yes, the player proceeds through the rest of the
> con_states until they get to con_playing.
>
> My problem appears at this point. The player is in the game, but their
> last
> name appears to have been left at the door. I've created a hack of a
> command called relname (re-lastname) which, when used, will set the
> player's
> last name to the argument. I've used this command on myself just to
> make
> sure that last names appear in all of the appropriate places within the
> mud,
> and they do. But new players end up with no last name appearing once
> they've entered the game.
>
> My knowledge of socket programming is practically NIL, so the code I've
> used
> for the new con states are hacks of CON_GET_NEW_NAME and
> CON_CONFIRM_NEW_NAME.
>
> If someone can offer a suggestion as to where my problem might lay, I'd
> appreciate the assistance. If the need is there, I'll gladly post what
> my
> CON states look like (although they're very simmilar to the states
> mentioned
> above).
>
> Thanks in advance for any assistance.
> -Jesse
>
>
> --
> ROM mailing list
> [email protected]
> http://www.rom.org/cgi-bin/mailman/listinfo/rom
>
>
> --
> ROM mailing list
> [email protected]
> http://www.rom.org/cgi-bin/mailman/listinfo/rom
>