17.10.2018, 14:54
(
Последний раз редактировалось BloodMaster; 17.10.2018 в 15:31.
)
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:
This is the callback:
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:
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?
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);
Код:
forward LoadAccount(playerid, name[], value[]); public LoadAccount(playerid, name[], value[]) { INI_String("Lozinka", PlayerInfo[playerid][pLozinka],129); return 1; }
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 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?