08.01.2013, 15:02
When the login system initates, the player's "Salt" is pulled from the database and then checked with the input text to see if the password matches, however the following variables print "(Null)" into the logs rather than the correct input:
PVar[playerid][psalt]
salt
string
This used to work before switching to linux plugins from windows.
PVar[playerid][psalt]
salt
string
This used to work before switching to linux plugins from windows.
pawn Код:
new Query[256];
new saltquery[156], salt[38], string[128];
string = "";
salt = "";
format(saltquery, sizeof(saltquery), "SELECT `psalt` FROM `playerinfo` WHERE `username` = '%s'", pName(playerid));
mysql_query(saltquery);
mysql_store_result();
mysql_fetch_row_format(PVar[playerid][psalt]);
format(salt, sizeof(salt), PVar[playerid][psalt]);
print(saltquery);
print(PVar[playerid][psalt]);
print(salt);
format(string, sizeof(string), "%s%s", salt, inputtext);
format(Query, sizeof(Query), "SELECT * FROM `playerinfo` WHERE `username` = '%s' AND `ppassword` = md5('%s')", pName(playerid), string);
print(Query);
mysql_query(Query);
mysql_store_result();
string = "";
salt = "";