SA-MP Forums Archive
[Include] cini - simple and fast ini system - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] cini - simple and fast ini system (/showthread.php?tid=216668)

Pages: 1 2


Re: cini - simple and fast ini system - cessil - 08.02.2011

Quote:
Originally Posted by Y_Less
View Post
Small bug:

Code:
	cini_FSave("hello.ini", "si",
		"break", "hi\nwoop=11",
		"woop", 42);
Some people could exploit that to get better at something - I don't know what, but it's like the old privilege escalation bug in GF.

I also managed to repeatedly crash the system while testing, but in trying to narrow down why it happened, it stopped happening...
thanks, that was actually something I thought about when creating it, but I figured for example if you saved a password as something like.
pass\nAdminLevel=123

it wouldn't really work unless you save to a file and then load from that file straight away, the cini_Save clears the file when writing and cini_Load will get the last found match I could see it happening if someone had another string to save near the bottom of the file and that's why I included cini_EscapeString.

I'd like to hear more about the crash if you do manage to narrow it down.


Re: cini - simple and fast ini system - Sasino97 - 08.02.2011

dini, zini, yini, rini and now cini.......


Re: cini - simple and fast ini system - Y_Less - 08.02.2011

Quote:
Originally Posted by cessil
View Post
thanks, that was actually something I thought about when creating it, but I figured for example if you saved a password as something like.
pass\nAdminLevel=123

it wouldn't really work unless you save to a file and then load from that file straight away, the cini_Save clears the file when writing and cini_Load will get the last found match I could see it happening if someone had another string to save near the bottom of the file and that's why I included cini_EscapeString.

I'd like to hear more about the crash if you do manage to narrow it down.
If cini_Load gets the last found match you could still use that for strings found after numbers, just change the order. As for the crash, I don't know how I managed it - it seemed to crash on fread, which is an odd place to crash, but I don't know why and now I can't replicate it, so I wouldn't worry about it.


Re: cini - simple and fast ini system - Black_Death - 27.08.2011

Cool :d I like it


Re: cini - simple and fast ini system - GangsTa_ - 27.08.2011

Good job!


Re: cini - simple and fast ini system - cessil - 18.12.2011

updated with version 2.0


Re: cini - simple and fast ini system - Scenario - 18.12.2011

I laughed when I didn't see any benchmark test with this system and y_ini...


Re: cini - simple and fast ini system - cessil - 18.12.2011

feel free to run and paste your own results


Re: cini - simple and fast ini system - Calgon - 18.12.2011

Nice release, it's nice to see an INI system which conforms to the format common in SA-MP. Dini doesn't compare, Y_Ini conforms to the real INI standard of formatting, and the rest aren't really that good.


Re: cini - simple and fast ini system - Uberanwar - 13.05.2014

Nice one


Re: cini - simple and fast ini system - QuaTTrO - 13.05.2014

Quote:
Originally Posted by Uberanwar
View Post
Nice one



Re: cini - simple and fast ini system - Uberanwar - 16.05.2014

Can someone explain me this?

Quote:

public OnPlayerConnect(playerid)
{
if(!cini_CheckAccount(playerid))
{
cini_Register(playerid,"default_pass");
cini_Save(playerid,"ssssdf",
"Props1","Slice",
"Props2","Grim_",
"Props3","Blacklite",
"Props4","Rachael",
"digit1",18,
"float1",1.24
);
cini_Add(playerid,"d","digit2",20);
}

if(!cini_CheckLogin(playerid,"wrong_pass")) print("wrong password");
if(cini_CheckLogin(playerid,"default_pass"))
{
print("correct password!");
new name[cini_string], Float:fl, digit2;
cini_Load(playerid,"sfd",
"Props3",name,
"float1",fl,
"digit2",digit2
);
printf("name = %s, fl = %.02f, digit2 = %d",name,fl,digit2);
cini_Update(playerid,"sf",
"Props3","Potassium",
"float1",floatmul(fl,2.0)
);
cini_Load(playerid,"sf","Props3",name,"float1",fl) ;
printf("name = %s, float = %.02f",name,fl);
}
print(cini_EscapeString("Password=pass\n\rAdminLev el=1337"));
return 1;
}

The one that I bold


Re: cini - simple and fast ini system - Djole1337 - 16.05.2014

You should't really use this, there are much better systems like y_ini. (No SQL)

The bolded part is obv saving.
ssssdf - string string string string integer float
Slice Grim_ Blacklite Rachael 18 1.24

Props1, Props2... - ini keys.


Re: cini - simple and fast ini system - punklord - 16.05.2014

Quote:
Originally Posted by QuaTTrO
View Post
Lmfao