Hi there!
I was looking for an older version of my SMAUG codes to get some snippets I am not able to find again on the Internet. So I decided to code in this older version.
The thing is: everytime I try to do the login, I get an error in the nanny function.
By the first attempt, this condition becomes true and it returns an error:
if(!check_parse_name(argument, (d->newstate != 0))){
//error
return;
}
In the second attempt it works fine.
I used some printf in the server and I discovered that in the first time I write the nickname, the argument passed to nanny is (without the cotes): " 'lordrom"; with a space, an apostrophe and then the name.
Once the argument is passed, the function get rid of the space, but the apostrophe remains.
I am looking for the root of this problem, but I wasn't able to find it. Can you help-me?
This is part of the nanny code:
This is the MUD window:
And this is what I get in the console. Take a look in the password (123) and the way the nickname first appear and how my second try goes.
Hope you can help-me, this thing is starting to bother me.
Thanks in advance!
I was looking for an older version of my SMAUG codes to get some snippets I am not able to find again on the Internet. So I decided to code in this older version.
The thing is: everytime I try to do the login, I get an error in the nanny function.
By the first attempt, this condition becomes true and it returns an error:
if(!check_parse_name(argument, (d->newstate != 0))){
//error
return;
}
In the second attempt it works fine.
I used some printf in the server and I discovered that in the first time I write the nickname, the argument passed to nanny is (without the cotes): " 'lordrom"; with a space, an apostrophe and then the name.
Once the argument is passed, the function get rid of the space, but the apostrophe remains.
I am looking for the root of this problem, but I wasn't able to find it. Can you help-me?
This is part of the nanny code:
void nanny( DESCRIPTOR_DATA *d, char *argument )
{
char buf[MAX_STRING_LENGTH];
char arg[MAX_STRING_LENGTH];
CHAR_DATA *ch;
char *pwdnew;
char *p;
int iClass;
int iRace;
int iTown;
extern int top_nation;
bool fOld, chk;
printf("1. %s\n\r", argument);
while ( isspace(*argument) )
argument++;
printf("2. %s\n\r", argument);
ch = d->character;
switch ( d->connected ){
default:
bug( "Nanny: bad d->connected %d.", d->connected );
close_socket( d, TRUE );
return;
//-----------------------------------
case CON_GET_NAME:
if ( argument[0] == '\0' ){
close_socket( d, FALSE );
return;
}
argument[0] = UPPER(argument[0]);
/* Old players can keep their characters. -- Alty */
if ( !check_parse_name( argument, (d->newstate != 0) ) ){
write_to_buffer( d, "Prohibited name. Please try again.\n\rName: ", 0 ); //this is the error
return;
}
(...)
This is the MUD window:
[welcome things]
Enter your character's name, or type new: lordrom
Prohibited name. Please try again.
Name: lordrom
Password:
And this is what I get in the console. Take a look in the password (123) and the way the nickname first appear and how my second try goes.
Fri Jan 21 22:52:03 2011 :: Sock.sinaddr: 127.0.0.1, port 1572.
Fri Jan 21 22:52:03 2011 :: [*****] BUG: Auth_open: connection refused
1. 'lordrom
2. 'lordrom
1. lordrom
2. lordrom
Fri Jan 21 22:52:10 2011 :: Preloading player data for: Lordrom (0K)
1. 123
2. 123
Fri Jan 21 22:52:11 2011 :: Loading player data for: Lordrom (0K)
Fri Jan 21 22:52:11 2011 :: Lordrom@127.0.0.1((connect refused)) is connected.
Hope you can help-me, this thing is starting to bother me.
Thanks in advance!