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.
 Entire forum ➜ Programming ➜ General ➜ Login stuck problem

Login stuck problem

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


Posted by Alkarindil   Brazil  (70 posts)  Bio
Date Mon 31 Mar 2008 12:21 PM (UTC)
Message
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.
Top

Posted by Nick Gammon   Australia  (23,102 posts)  Bio   Forum Administrator
Date Reply #1 on Mon 31 Mar 2008 08:29 PM (UTC)
Message
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?

- Nick Gammon

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

Posted by Alkarindil   Brazil  (70 posts)  Bio
Date Reply #2 on Tue 01 Apr 2008 11:55 AM (UTC)

Amended on Tue 01 Apr 2008 12:58 PM (UTC) by Alkarindil

Message
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!
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.


12,469 views.

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.