14.03.2012, 16:04
Hi guys. I am working on a login/register system, which is using djson and whirlpool.
It almost works fine. When the plaayer registers, his password is hashed and saved, no problems there.
But when someone is trying to log in to a registered account, it just doesn't work. It keeps saying wrong password.
Here is the code from the login dialog:
Hope someone can help me. Thank you.
It almost works fine. When the plaayer registers, his password is hashed and saved, no problems there.
But when someone is trying to log in to a registered account, it just doesn't work. It keeps saying wrong password.
Here is the code from the login dialog:
pawn Код:
if(dialogid == 2)
{
if(!response)
{
StopAudioStreamForPlayer(playerid);
SendClientMessage(playerid, COLOR_SYSTEMRED, "( ! ) You must log in to play on this server. Please come again soon");
Kick(playerid);
gPlayerLogged[playerid] = 0;
}
new hashed_password[129];
WP_Hash(hashed_password, sizeof(hashed_password), inputtext);
if(!strcmp(hashed_password, dj(file, "Password")))
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_PASSWORD, "{FFFF00}Hopes Hills RPG Account", "{AF0000}Incorrect Password!\n{FFFFFF}Enter your Password", "Login", "Quit");
}
else
{
SendClientMessage(playerid, COLOR_GREEN, "( ! ) You have successfully Logged In!");
GivePlayerMoney(playerid, djInt(file, "Money"));
PlayerInfo[playerid][pBanned] = djInt(file, "Banned");
gPlayerLogged[playerid] = 1;
OnceLogged[playerid] = 1;
}