Hab das mal gemacht, Login genauso ähnlich?
C
public OnPasswordChecked(playerid)
{
new bool:match = bcrypt_is_equal(),query[256];
mysql_format(handle, query, sizeof(query), "SELECT * FROM accounts WHERE Name = '%e' AND Password = '%e'", AccountInfo[playerid][account_Name], hash);
mysql_pquery(handle, query, "AccountLogin", "d", playerid);
return 1;
}
C
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DIALOG_REGISTRATION:
{
bcrypt_hash(inputtext, BCRYPT_COST, "OnPasswordHashed", "d", playerid);
}
case DIALOG_LOGIN:
{
// Variable hash is expected to contain the hash loaded from the database
bcrypt_check(inputtext, hash, "OnPasswordChecked", "d", playerid);
}
}
return 1;
}
Alles anzeigen
Soweit ist es mir auch noch klar, aber wie mache ich den Dialog am besten?