18.12.2019, 20:45
(
Last edited by EmilLykke; 18/12/2019 at 10:06 PM.
)
Today I began to build a UCP, consisting of a login and register.
The gamemode currently works with a master account system, allowing the accounts registered to function as a UCP account. Upon a registration in-game, the gamemode uses bcrypt hashing the passwords.
My request here is, can somebody help me figuring out, how I input my current settings of accounts into a functioning UCP?
The PHP page will output something similar to the gamemode, but it's not quite the same... Does anybody have a solution?
The bcrypt cost is currently set to 12.
The gamemode currently works with a master account system, allowing the accounts registered to function as a UCP account. Upon a registration in-game, the gamemode uses bcrypt hashing the passwords.
Code:
$options = [ 'cost' => 12, ]; $password = password_hash($_POST['password'], PASSWORD_BCRYPT, $options);
The PHP page will output something similar to the gamemode, but it's not quite the same... Does anybody have a solution?
The bcrypt cost is currently set to 12.
pawn Code:
// on dialog response, register
bcrypt_hash(inputtext, BCRYPT_COST, "OnAccountPasswordHash", "d", playerid);
public OnAccountPasswordChange(playerid) {
new msg[128];
new hash[BCRYPT_HASH_LENGTH];
bcrypt_get_hash(hash);
mysql_format(sqlHandle, msg, sizeof(msg), "UPDATE `users` SET `password` = '%e' WHERE `id` = '%d'", hash, GetPVarInt(playerid, "AccountID"));
mysql_function_query(sqlHandle, msg, false, "", "");
SendClientMessage(playerid, COLOR_LIGHTRED, "* Your password has been changed.");
format(msg, sizeof(msg), "%s changed %s password.", PlayerInfo[playerid][pName], HisHer(playerid));
return 1;
}