Whirlpool
#17

here you go: my password processing works fine, maybe you find some useful lines in that snippet.
remove the //commented-debug-chat-spam (showing passwords etc) lines, maybe it helps you at spotting your bug...
Код:
		case DIALOG_REGISTER:
		{
			new PassWordStringInput[24];
			new buffer[129];
			new filename[32];
			new Name[MAX_PLAYER_NAME];
			GetPlayerName(playerid,Name,sizeof(Name));
			if(response)
			{
				if(!sscanf(inputtext,"s[24]",PassWordStringInput))
				{
				//	SendClientMessage(playerid,MSGCMDS_COLOR,PassWordStringInput);
					WP_Hash(buffer,sizeof(buffer),PassWordStringInput);
				//	SendClientMessage(playerid,MSGCMDS_COLOR,buffer);
					format(filename, sizeof(filename),"userdata/%s.txt",Name);
					new File:PWFile=fopen(filename,io_readwrite);
					fwrite(PWFile,buffer);
					fclose(PWFile);
					WelcomeMessage(playerid);
				}
				else
				{
					Kick(playerid);
				}
			}
			else
			{
				Kick(playerid);
			}
			return 1;
		}
		case DIALOG_LOGIN:
		{
			new PassWordStringInput[24];
			new buffer[129];
			new readbuffer[129];
			new filename[32];
			new Name[MAX_PLAYER_NAME];
			GetPlayerName(playerid,Name,sizeof(Name));
			if(response)
			{
				if(!sscanf(inputtext,"s[24]",PassWordStringInput))
				{
				//	SendClientMessage(playerid,MSGCMDS_COLOR,PassWordStringInput);
					WP_Hash(buffer,sizeof(buffer),PassWordStringInput);
				//	SendClientMessage(playerid,MSGCMDS_COLOR,buffer);
					format(filename, sizeof(filename),"userdata/%s.txt",Name);
					new File:PWFile=fopen(filename,io_read);
					fread(PWFile,readbuffer);
					fclose(PWFile);
					if(strfind(readbuffer,buffer,false,0)==0)
					{
						WelcomeMessage(playerid);
//						SendClientMessage(playerid,MSGSUCC_COLOR,"match");
					}
					else
					{
						Kick(playerid);
					}
				}
				else
				{
					Kick(playerid);
				}
			}
			else
			{
				Kick(playerid);
			}
			return 1;
		}
Reply


Messages In This Thread
Whirlpool - by Wesley221 - 04.07.2011, 19:42
Re: Whirlpool - by Vince - 04.07.2011, 19:46
Re: Whirlpool - by Wesley221 - 04.07.2011, 19:47
Re: Whirlpool - by MadeMan - 04.07.2011, 20:51
Re: Whirlpool - by Wesley221 - 05.07.2011, 08:00
Re: Whirlpool - by MadeMan - 05.07.2011, 09:19
Re: Whirlpool - by Wesley221 - 05.07.2011, 09:25
Re: Whirlpool - by Wesley221 - 05.07.2011, 20:57
Re: Whirlpool - by FireCat - 05.07.2011, 21:01
Re: Whirlpool - by Wesley221 - 05.07.2011, 21:48
Re: Whirlpool - by =WoR=Varth - 05.07.2011, 23:44
Re: Whirlpool - by Wesley221 - 06.07.2011, 06:21
Re: Whirlpool - by Wesley221 - 06.07.2011, 14:52
Re: Whirlpool - by Calgon - 06.07.2011, 14:59
Re: Whirlpool - by Wesley221 - 06.07.2011, 15:00
Re: Whirlpool - by Calgon - 06.07.2011, 15:01
Re: Whirlpool - by Babul - 06.07.2011, 15:31
Re: Whirlpool - by Wesley221 - 06.07.2011, 16:30

Forum Jump:


Users browsing this thread: 1 Guest(s)