Whirlpool issue.
#1

We have a login system, however, if we compare our real password, to the inputted password, it removes the first character of the real password, thus, making the inputted password seem incorrect.

PHP код:
case DIALOG_LOGIN:
        {
            if ( !
response ) return Kick playerid );
            if( 
response )
            {
                new 
hpass[129];
                
WP_Hash(hpasssizeof(hpass), inputtext);
                if(!
strmatch(pVariables[playerid][pPassword], hpass))
                {
                    
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_PASSWORD,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
                }
                else
                {
                    
mysql_format(mysqlquerysizeof(query), "SELECT * FROM `users` WHERE `Username` = '%s' LIMIT 1"name1);
                    
mysql_tquery(mysqlquery"OnAccountLoad""i"playerid);
                }
                new 
string[256], string1[256];
                
format(stringsizeof(string), "Real pass: %s"pVariables[playerid][pPassword]);
                
SendClientMessageToAll(-1string);
                
format(string1sizeof(string1), "Input Pass: %s"hpass);
                
SendClientMessageToAll(-1string1);
                return 
1;
            } 



Heres a screenshot:

Reply
#2

show me the dialog register dude...
Reply
#3

Here


PHP код:
case DIALOG_REGISTER:
        {
            if (!
response) return Kick(playerid);
            if(
response)
            {
                if(!
strlen(inputtext)) return ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_PASSWORD""COL_WHITE"Registering...",""COL_RED"You have not entered a password.\n"COL_WHITE"Type a password below to register a new account.","Register","Quit");
                
WP_Hash(pVariables[playerid][pPassword], 129inputtext);
                
pVariables[playerid][pMoney] = 1500;
                
mysql_format(mysqlquerysizeof(query), "INSERT INTO `users` (`Username`, `Password`, `IP`, `Admin`, `Helper`, `VIP`, `Money`, `PosX`, `PosY`, `PosZ`, `Faction`, `FRank`, `Family`, `Medical`) VALUES ('%s', '%s', '%s', 0, 0, 0, 1500, '%f', '%f', '%f', '0', '0', '0', '0')"Name[playerid], pVariables[playerid][pPassword], IP[playerid], Spawn_XSpawn_YSpawn_Z);
                
mysql_tquery(mysqlquery"OnAccountRegister""i"playerid);
                
SendClientMessage(playeridCOL_BLUE"----Credits----");
                
SendClientMessage(playeridCOL_BLUE"Scripted by Connor and Tony ( All rights reserved © SF-RP )");
                
SendClientMessage(playeridCOL_BLUE"Mappings - Damon");
            } 
Reply
#4

If thats the case, how come it wont let us login in?
Reply
#5

Hmm, this is the first time I heard of it. Did you try re-downloading Whirlpool?
Reply
#6

Anyone? Please I need this fixed.
Reply
#7

Yes, it is threaded.
Reply
#8

show we function OnAccountLoad and make sure length of column Password is 128
Reply
#9

Quote:
Originally Posted by rickisme
Посмотреть сообщение
show we function OnAccountLoad and make sure length of column Password is 128
No, the password field must be 129 characters in length. That's the length of the hashed passwords/strings.

But yeah, as you said, he needs to show the OnAccountLoad function.
Reply
#10

Edited richisme's code a bit, not even 1 line, added a few numbers and a symbol.
pawn Код:
public OnPlayerConnect(playerid)
{
* * //... check roleplay name, banned, blah blah
* *
* * // Check if valid user
* * new name[MAX_PLAYER_NAME+1];
* * GetPlayerName(playerid, name, sizeof(name))
* * mysql_format(mysql, query, sizeof(query), "SELECT * FROM `users` WHERE `Username` = '%s' LIMIT 1", name);
* * new Cache:result = mysql_query(mysql, query);
* * if(cache_num_rows() > 0)
* * {
* * * * // Get password from database and set it to pVariables[playerid][pPassword]
* * * * cache_get_field_content(0,"Password",129,pVariables[playerid][pPassword]);
* * * * // Show real password from database
* * * * SendClientMessageToAll(-1, pVariables[playerid][pPassword]);
* * * * // Show login dialog
* * * * ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,""COL_WHITE"Login","Type your password below to login.","Login","Quit");
* * }
* * else
* * {
* * * * // Show Register dialog
* * }
* * cache_delete(result);

* *
* * return 1;
}


case DIALOG_LOGIN:
{
* * if ( !response ) return Kick ( playerid );
* * if( response )
* * {
* * * * new hpass[129];
* * * * WP_Hash(hpass, sizeof(hpass), inputtext);
* * * * // Show Input Password
* * * * SendClientMessageToAll(-1, hpass);
* * * * if(!strmatch(pVariables[playerid][pPassword], hpass))
* * * * {
* * * * * * ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
* * * * }
* * * * else
* * * * {
* * * * * * mysql_format(mysql, query, sizeof(query), "SELECT * FROM `users` WHERE `Username` = '%s' LIMIT 1", name1);
* * * * * * mysql_tquery(mysql, query, "OnAccountLoad", "i", playerid);
* * * * }
* * * * /*
* * * * new string[256], string1[256];
* * * * format(string, sizeof(string), "Real pass: %s", pVariables[playerid][pPassword]);
* * * * SendClientMessageToAll(-1, string);
* * * * format(string1, sizeof(string1), "Input Pass: %s", hpass);
* * * * SendClientMessageToAll(-1, string1);
* * * * */

* * * * return 1;
* * }
}
IGNORE ALL THE "*****", MY S3 FUCKED IT ALL.]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)