SA-MP Forums Archive
[Help] Whirpool problem (Weird) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Help] Whirpool problem (Weird) (/showthread.php?tid=593246)



[Help] Whirpool problem (Weird) - David (Sabljak) - 03.11.2015

Hello, this problem comes randomly and im not getting it...

Imagine you join server, type your password and script say's its wrong (3 Times you can enter password).. you reconnect, type it again and you enter...

This happens randomly...

Its Yini + Whirpool il'l give you login dialog for example.

Il'l cut script to be easier to read.

Код:
case DIALOG_LOGIN:
{
	if(response)
	{
		new hashpass[129];
		WP_Hash(hashpass,sizeof(hashpass),inputtext);
		if(!strcmp(hashpass, PlayerInfo[playerid][pPassword], false))
		{
			//IF Password is good, login part
		}
		else
		{
	           //if miss 3 times part when kick's him..
		}
	}
	else Kick(playerid);
}



Re: [Help] Whirpool problem (Weird) - prineside - 03.11.2015

It can be random only if you use random values. Run a simple unit test on WP_Hash to check how it works - if it always provide correct hash then you should look for an issue in your code

Print hashpass and inputtext to see in which case you get errors.


Re: [Help] Whirpool problem (Weird) - lukewid - 03.11.2015

pawn Код:
case DIALOG_LOGIN:
{
    if(response)
    {
        new hashpass[129];
        WP_Hash(hashpass,sizeof(hashpass),inputtext);
        if(!strcmp(hashpass, PlayerInfo[playerid][pPassword], false))
        {
            //IF Password is good, login part
        }
        else
        {
               //if miss 3 times part when kick's him..
        }
        printf("%s", PlayerInfo[playerid][pPassword]);
        printf("%s", hashpass);
    }
    else Kick(playerid);
}
Tell me the results of the printf function.

EDIT:
Probably the size of PlayerInfo[playerid][pPassword] is 128, on which Whirlpool requires 129.


Re: [Help] Whirpool problem (Weird) - David (Sabljak) - 03.11.2015

Il'l tell you result of print in thurdsay, cant make it earlier.. I put 129 on all and check all few times so...


Re: [Help] Whirpool problem (Weird) - David (Sabljak) - 05.11.2015

Quote:
Originally Posted by lukewid
Посмотреть сообщение
pawn Код:
case DIALOG_LOGIN:
{
    if(response)
    {
        new hashpass[129];
        WP_Hash(hashpass,sizeof(hashpass),inputtext);
        if(!strcmp(hashpass, PlayerInfo[playerid][pPassword], false))
        {
            //IF Password is good, login part
        }
        else
        {
               //if miss 3 times part when kick's him..
        }
        printf("%s", PlayerInfo[playerid][pPassword]);
        printf("%s", hashpass);
    }
    else Kick(playerid);
}
Tell me the results of the printf function.

EDIT:
Probably the size of PlayerInfo[playerid][pPassword] is 128, on which Whirlpool requires 129.
Print is the same... if that was mistake you could never login with same password