08.02.2017, 17:46
I'm trying to use the MyBB hash in PAWN to try to create a login system, but the following happens. I do not know if the problem should be differentiation because of capital letters or whatever. But I debugged how I am using the function:
I will leave the code of how the function is, so that if anyone can help I will be grateful:
pawn Код:
debug with tolower: C17B0956505182F5308108A602077A1D
debug with toupper: E1B1BC3B6D56D56531FF2E47106F6A9E
PHP код:
Dialog:DialogLogin(playerid, response, listitem, inputtext[])
{
if(response)
{
if(strcmp(MyBB_Hash(inputtext, APlayerData[playerid][Salt]), APlayerData[playerid][Password]) == 0)
{
cache_set_active(APlayerData[playerid][Player_Cache]);
cache_get_value_int(0, "uid", APlayerData[playerid][ID]);
cache_delete(APlayerData[playerid][Player_Cache]);
APlayerData[playerid][Player_Cache] = MYSQL_INVALID_CACHE;
APlayerData[playerid][LoggedIn] = true;
SendClientMessage(playerid, COLOR_GREEN, "Logado com sucesso.");
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "Senha incorreta.");
Dialog_Show(playerid, DialogLogin, DIALOG_STYLE_PASSWORD, "Logando", "Teste", "Registrar", "Sair");
}
}
return 1;
}