Login stuck problem

Posted by Alkarindil on Mon 31 Mar 2008 12:21 PM — 3 posts, 17,031 views.

Brazil #0
Hi everyone!
I am having some odd problem with nanny() function on these lines:

//comm.c nanny() Login screen
/* Old players can keep their characters. -- Alty */
if ( !check_parse_name( argument, (d->newstate != 0) ) ){
write_to_buffer( d, "Illegal name, Try Another.\n\rName: ", 0 );
return;
}

The thing is: Everytime I try to log on, I get this error.
If I type 'new', I also get this error.
Strange is that it happens always in the first time, se second time it works as it should be.
I mean, if I try to enter 'Thoric' in the login, it returns me this error, and I need to enter it again.

What can it be?

Thanks in advance.
Australia Forum Administrator #1
Clearly you are changing something that affects the test. That small post doesn't show what it is.

See my post about debugging with gdb: http://www.gammon.com.au/forum/?id=3653

I would be putting a breakpoint on that line, and then stepping into the function with "step" to see why it works one time and not the next. Maybe the name is wrong? Maybe d->newstate is zero the first time and not the next?
Brazil #2
Well, I am not very good at C++ yet, but you are right! d->newstate is really zero.
I can't see a way of making this debugging you talk about because I use a Windows Compiler in the work, and in home I use macintosh xcode and never tryed to compile smaug there. Maybe someday I sit down in front of my mac and try hard to make it works, and I believe this kind of debugging will work fine in a mac, but I'll think in that later..

I've found that the variable "argument" returns a " ' " before anything I type in the first time. It's origin is the d->incomm variable on strcpy( cmdline, d->incomm ); line.

Anyway, does anybody cares to give-me a shot of what does this d->incomm? I believe that removing this " ' " symbol, it's done!

Thanks a lot!