30.05.2014, 03:38
So I've attempted to create a login system without the use of tutorials, etc. And I've encountered an issue.
The issue is when you connect and login with any password it successfully logs you in when it obviously shouldn't. Can anyone spot the issue? I've spent hours trying to nerrow it down, debugging every aspect and it still doesn't work. I even temporarily removed my hashing method(s) - being udbhash and whirlpool.
That is what happens when they login. If you need any other code, you know where to ask. Thanks.
The issue is when you connect and login with any password it successfully logs you in when it obviously shouldn't. Can anyone spot the issue? I've spent hours trying to nerrow it down, debugging every aspect and it still doesn't work. I even temporarily removed my hashing method(s) - being udbhash and whirlpool.
pawn Код:
if(dialogid == REGISTER_LOGIN)
{
if(!response) return Kick(playerid);
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid, REGISTER_LOGIN, DIALOG_STYLE_INPUT, "NO INPUT DETECTED", "Please enter your password to login.", "Enter", "Quit");
return 1;
}
if(response)
{
if(!strcmp(inputtext, pInfo[playerid][pPass]))
{
INI_ParseFile(UserPath(playerid), "LoadUser", .bExtra = true, .extra = playerid);
SCM(playerid,COLOR_GREEN, "You've successfully logged in.");
return 1;
}
else
{
ShowPlayerDialog(playerid, REGISTER_LOGIN, DIALOG_STYLE_INPUT, "WRONG PASSWORD", "Please enter your password to login.", "Enter", "Quit");
return 1;
}
}
}