wrong password everytime (strcmp)
#1

I'm having trouble to fix this and I had this problem few times before. When I try to log-in into the character it's always saying wrong password even if it's the correct one.
Here's my code and thanks in advance!
Reply
#2

Debug. Use printf to see what the strings actually are.
Reply
#3

Quote:
Originally Posted by MP2
Посмотреть сообщение
Debug. Use printf to see what the strings actually are.
I used mysql_debug(1) and here's the results:
PHP код:
[14:18:41]  ** MySQL Debugging enabled (03/12/13)
[
14:18:41]  
[
14:18:59] >> mysql_query_callbackConnection handle)
[
14:18:59Passing query SELECT FROM `playeraccountsWHERE `username` = 'Player_Name' ii
[14:19:00ProcessQueryThread(OnQueryFinish) - Query was successful. (SELECT FROM `playeraccountsWHERE `username` = 'Player_Name')
[
14:19:00ProcessQueryThread(OnQueryFinish) - Data caching enabled.
[
14:19:00CMySQLHandler::StoreResult() - Result was stored.
[
14:19:00CMySQLHandler::FreeResult() - Result was successfully free'd.
[14:19:00] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()
[14:19:00] OnQueryFinish(ii) - Threaded function called.
[14:19:00] >> cache_get_data( Connection handle: 1 )
[14:19:00] ProcessTick() - The cache has been cleared. 
The password of the account in the database is 123456, so what can you tell me about that?
Thanks!
Reply
#4

It has nothing to do with mySQL debugging. Read what I posted.
Reply
#5

Okay I used printf to print the inputext and the Password from enum and it came back the same password, so the problem is here:
PHP код:
            new szHashedPassword[129];
            
WP_Hash(szHashedPassword129inputtext);
            
            if(!
response) return Kick(playerid);
            if(
response)
            {
                if(!
strcmp(szHashedPasswordAccountData[playerid][szPassword])) 
Reply
#6

You know that strcmp returns 0 on succes right?
Reply
#7

Quote:
Originally Posted by Jari_Johnson*
Посмотреть сообщение
You know that strcmp returns 0 on succes right?
Yes, I know that.
Anyone please?

EDIT: Never mind, I fixed it! the problem actually was the hash and not the statement. L&A please.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)