Whirlpool fail? - 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: Whirlpool fail? (
/showthread.php?tid=307225)
Whirlpool fail? -
Seven_of_Nine - 29.12.2011
I recently switched my hatching plugin to Whirlpool, I already got a problem.
This is the login dialog's code.
pawn Код:
new pHash[129];
WP_Hash(pHash,sizeof(pHash),inputtext);
if(!strcmp(pInfo[playerid][Pass],pHash)) {
INI_ParseFile(PlayerPath(playerid), "UserDataLoad_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid,pInfo[playerid][Cash]);
SetPlayerScore(playerid,pInfo[playerid][Score]);
if(pInfo[playerid][AdminLevel] == 0) {
SendClientMessage(playerid,lime,"You've successfully logged in!");
} else {
SendClientMessage(playerid,lime,"Welcome,{FFFF00} administrator!");
}
pInfo[playerid][Logged] = 1;
} else {
if(gTries[playerid] == 0) gTries[playerid] = 1;
if(gTries[playerid] == 3) {
new iStr[128];
format(iStr,sizeof(iStr),"%s has been kicked for exceeding login tries.",pName(playerid));
SendClientMessageToAll(red,iStr);
return Kick(playerid);
}
new iStr[128];
format(iStr,sizeof(iStr),"You've entered an incorrect password. Tries: %i/3",gTries[playerid]);
ShowPlayerDialog(playerid,iDialog1,DIALOG_STYLE_INPUT,"Login",iStr,"Login","Leave");
gTries[playerid]++;
}
}
This is the register dialog's code: (a part of it)
pawn Код:
new pHash[129],pIP[16];
if(!strlen(inputtext)) return ShowPlayerDialog(playerid,iDialog2,DIALOG_STYLE_INPUT,"Register","Please input a password.","Register","Leave");
WP_Hash(pHash,sizeof(pHash),inputtext);
pInfo[playerid][Pass] = pHash;
UserDataSave(playerid);
I checked, the password is hashed in my user file.
Then I wanted to login, but it always said incorrect password..
Can you help me? :\
And the
Re: Whirlpool fail? -
Calgon - 29.12.2011
Print 'pInfo[playerid][Pass]' and 'pHash' in your login code.
Re: Whirlpool fail? -
Seven_of_Nine - 29.12.2011
Код:
[21:01:54] F9A42F8EABDAB42DBD369E68571FC1C53BAE3C2BDAB2193C32A4CD74ACCC4DDC8CA7387CA8CAA38A6308848A2B428D6CB1BC8E8931C516CD15D409C430C13100
[21:01:54] F9A42F8EABDAB42DBD369E68571FC1C53BAE3C2BDAB2193C32A4CD74ACCC4DDC8CA7387CA8CAA38A6308848A2B428D6CB1BC8E8931C516CD15D409C430C1310
Re: Whirlpool fail? -
Calgon - 29.12.2011
Is there any reason why one of them is one character shorter than the other? What's the size of 'pInfo[playerid][Pass]'?
Re: Whirlpool fail? -
Seven_of_Nine - 29.12.2011
It's 129 characters. Like every single hash variable.
Re: Whirlpool fail? -
Calgon - 29.12.2011
Show us the code you use to get the password from the file.
Re: Whirlpool fail? -
Seven_of_Nine - 29.12.2011
It's in INI_ParseFile
pawn Код:
INI_String("Pass",pInfo[playerid][Pass],129);
Re: Whirlpool fail? -
Seven_of_Nine - 29.12.2011
Bump, I really need this. :\