Open lPauI opened 7 months ago
OK, so a function not being found is fine - that's just YSI determining which BCrypt plugin and version is being used (which I should maybe make clearer in the messages). However, I tested and confirmed the new version with BCrypt 0.4.1 so I'm not sure what is going on there. What do you mean "unstable"?
I mean when I try to use the BCrypt_CheckInline the server is freezing
Could you post some code please? It worked here.
OnPlayerLogin(const playerid, const password[], const racecheck)
{
inline const LoadPassword()
{
if(racecheck != MySQLRaceCheck[playerid])
{
SendClientMessage(playerid, COLOR_SERVER, "SERVER >>{FFFFFF} Server-ul este suprasolicitat. Revino mai tarziu.");
KickEx(playerid);
return 1;
}
new dbpass[BCRYPT_HASH_LENGTH], pass[BCRYPT_HASH_LENGTH];
strcpy(pass, password, sizeof pass);
cache_get_value_name(0, "Password", dbpass);
cache_get_value_name_int(0, "Admin", PlayerInfo[playerid][pAdmin]);
new
google[16 + 1];
cache_get_value_name(0, "Google", google);
inline const CheckPassword(bool:same)
{
switch(same)
{
case false:
{
SetPVarInt(playerid, "LoginTries", GetPVarInt(playerid, "LoginTries") - 1);
if(GetPVarInt(playerid, "LoginTries") == -3)
{
KickEx(playerid);
return 1;
}
va_SendClientMessage(playerid, COLOR_WARNING, "Parola incorecta. Mai ai %d incercari ramase.", GetPVarInt(playerid, "LoginTries") + 3);
format(gString, 100, "Bun venit, %s!\nPune-ti parola mai jos pentru a te loga!", PlayerInfo[playerid][pUsername]);
Dialog_ShowCallback(playerid, using public DIALOG_LOGIN<iiiis>, DIALOG_STYLE_PASSWORD, "Login:", gString, "Login", "Quit");
}
case true:
{
#if defined GOOGLE_AUTH
if(PlayerInfo[playerid][pAdmin] > 6)
{
if(google[0] == '0')
{
new
gkey[16 + 1];
for(new i = 0; i < sizeof gkey; i ++) gkey[i] = 65 + random(25 + 1);
format(gkey, sizeof gkey, gkey);
mysql_format(SQL, gString, sizeof gString, "UPDATE `users` SET `Google` = '%e' WHERE `Name` = '%e'", gkey, PlayerInfo[playerid][pUsername]);
mysql_tquery(SQL, gString, "", "");
KickEx(playerid);
return 1;
}
inline const DIALOG_GOOGLE(response, listitem, string:inputtext[])
{
#pragma unused listitem, response
new
const code = GoogleAuthenticatorCode(google, gettime());
if(strval(inputtext) == code)
{
mysql_format(SQL, gString, sizeof gString, "SELECT * FROM `users` WHERE `Name` = '%e'", PlayerInfo[playerid][pUsername]);
mysql_tquery(SQL, gString, "LogPlayer", "dd", playerid, MySQLRaceCheck[playerid]);
}
else
{
KickEx(playerid);
return 1;
}
}
Dialog_ShowCallback(playerid, using inline DIALOG_GOOGLE, DIALOG_STYLE_INPUT, "Google:", "Introdu mai jos codul din aplicatia google:", "Login", "Quit");
return 1;
}
#endif
mysql_format(SQL, gString, sizeof gString, "SELECT * FROM `users` WHERE `Name` = '%e'", PlayerInfo[playerid][pUsername]);
mysql_tquery(SQL, gString, "LogPlayer", "dd", playerid, MySQLRaceCheck[playerid]);
}
}
}
BCrypt_CheckInline(pass, dbpass, using inline CheckPassword);
}
MySQL_TQueryInline(SQL, using inline LoadPassword, "SELECT * FROM `users` WHERE `Name` = '%e'", PlayerInfo[playerid][pUsername]);
return 1;
}
I had the previous YSI version, and I decied to update to the last one. I updated to the latest bcrypt version, and then I updated the YSI v5.10.0006. But these errors showed up, and then bcrypt became unstable.