BCrypt plugin issue - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: BCrypt plugin issue (
/showthread.php?tid=665272)
BCrypt plugin issue -
solstice_ - 28.03.2019
Hi, so I have noticed an issue on my script. I'll keep it short, here's everything:
pawn Code:
Dialog:DIALOG_REGISTER(playerid, response, listitem, inputtext[])
{
if(response)
{
bcrypt_hash(inputtext, BCRYPT_COST, "OnPasswordHashed", "d", playerid);
print("Function called - DialogRegister");
}
else
Kick(playerid);
return 1;
}
I'm calling that OnPlayerConnect, and if you can notice this:
pawn Code:
bcrypt_hash(inputtext, BCRYPT_COST, "OnPasswordHashed", "d", playerid);
That's not being called.
pawn Code:
forward OnPasswordHashed(playerid);
public OnPasswordHashed(playerid)
{
new hash[BCRYPT_HASH_LENGTH], query[300];
bcrypt_get_hash(hash);
mysql_format(Database, query, sizeof(query), "INSERT INTO `players` (`Username`, `Password`, `IPAddress`, `Cash`, `Kills`, `Deaths`, `Admin`, `Banned`, `LastLogin`, `LastIP`) VALUES ('%e', '%e', '%e', 0, 0, 0, 0, 0, '%e', '%e')", GetName(playerid), hash, ReturnIP(playerid), ReturnDate(), ReturnIP(playerid));
mysql_tquery(Database, query, "OnPlayerRegister", "d", playerid);
print("Function called - OnPasswordHashed");
return 1;
}
I have tried to debug it and noticed it's not being called.
Re: BCrypt plugin issue -
solstice_ - 28.03.2019
Fixed after including BCrypt after crashdetect, which means as the second plugin. I don't know why but that worked.