Whirlpool Register And Login System Problem
#1

Hello,

I wanted to edit my simple hash to Whirlpool, so i did this and all was fine, but the problem that when i login with any password even if it is wrong it logs me in

And yes whirlpool hash is working fine and also i got whirlpool plugin in plugins folder and server.cfg and i installed it correctly, any help?

Enum :

pawn Code:
enum pInfo
{
    pHash[130],
    pCash,
    pAdmin,
    pKills,
    pDeaths,
    pWarns
}
new PlayerInfo[MAX_PLAYERS][pInfo];
OnDialogResponse :

pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if(!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_LIGHTBLUE"Type your password below to register a new account.","Register","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                WP_Hash(PlayerInfo[playerid][pHash], 130, inputtext);
                INI_SetTag(File,"data");
                INI_WriteString(File,"Password",PlayerInfo[playerid][pHash]);
                INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_Close(File);
                Block[playerid] = 0;

                ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Thank you for registering!","Ok","");
            }
        }

        case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(!strcmp(PlayerInfo[playerid][pHash], inputtext, true))
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                    Block[playerid] = 0;
                    ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_LIGHTBLUE"Type your password below to login.","Login","Quit");
                }
                return 1;
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)