Y_INI ParseFile Doesn't want to obey
#1

Solved: In case there is some other dummy like me, I just forgot to hash the input. Kill me please.
I also learned you shouldn't do other things in the callback, it's supposed to be for read only operations (INI_Int, INI_String...) so there was actually no weird behavior.

Hey.

So recently I went back to scripting and everything went smoothly until I decided to make a reg-log system.
Everything typical... But. I can't find a way for ParseFile to work. It just doesn't behave the way it used to few years ago. I am using YSI 4.1 and also whirlpool plugin to hash the passes.

Here's my code: ("Lozinka" means "Password").

Somewhere in OnPlayerConnect:
Код:
                new filename[64];
		format(filename,sizeof filename,PLAYER_PATH,GetName(playerid));
		printf("filename: %s",filename);
                INI_ParseFile(filename, "LoadAccount", .bExtra = true, .extra = playerid);
This is the callback:

Код:
forward LoadAccount(playerid, name[], value[]);
public LoadAccount(playerid, name[], value[])
{
        INI_String("Lozinka", PlayerInfo[playerid][pLozinka],129);
	return 1;
}
And when I check later for "PlayerInfo[playerid][pLozinka]" it stays nothing.
I tried downgrading YSI library and everything possible, but I just can't make it work.
It worked countless times before, but now, it doesn't.

Here's the part where I save it:

Код:
	new file[128];
	format(file,sizeof file,PLAYER_PATH,GetName(playerid));
	new INI:ini = INI_Open(file);
	INI_WriteString(ini, "Lozinka", PlayerInfo[playerid][pLozinka]);
        INI_Close(ini);
Код:
#define     PLAYER_PATH					"Players/%s.ini"
What did I do wrong?

What I did notice is that the callback gets called like 5 times carrying all information in "name" and "value", but INI_String doesn't seem to save it to a string. Weird, right?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)