public OnPlayerLogin(playerid,password[])
{
SendClientMessage(playerid, COLOR_WHITE, "Logging you in.");
new string2[128], string[1024], pName[MAX_PLAYER_NAME], Escape[2][128], result[128];//keystring[256],
pName = PlayerName(playerid);
mysql_real_escape_string(pName, Escape[0]);
WP_Hash(hashPassword, 129, password);
SaveToMysql(password);
mysql_real_escape_string(password, Escape[1]);
format(string, sizeof(string), "SELECT * FROM players WHERE `Name`='%s' AND `Key`='%s'",Escape[0],Escape[1]);
mysql_query_ex(string);
mysql_store_result();
SendClientMessage(playerid, COLOR_WHITE, "Checking your password...");
if(mysql_num_rows() == 0)
{
mysql_free_result();
SendClientMessage(playerid, COLOR_RED, "Your password is wrong!");
ShowPlayerDialog(playerid, LOGIN_DIALOG, 1, "{3399CC}Information", "{FFFFFF}You have an account here, please type below your password to login.", "Login", "Quit");
WrongPass[playerid]++;
if(WrongPass[playerid]>6)
{
Kick(playerid);
}
return 1;
}
mysql_retrieve_row();
WP_Hash(hashPassword, 129, password);
SaveToMysql(password);
mysql_real_escape_string(password, Escape[1]);
All passwords are hashed with SHA1, that means you cannot decrypt SHA1 passwords once they are set. For more information, visit the Wikipedia Page |
format(query, sizeof(query), "INSERT INTO playerdata (user, password, score, money, IP) VALUES('%s', SHA1('%s'), 0, 0, '%s', 0.0)", pname, passwordstring, IP);
how to make change that to whirpool hashing passwords? please help |