Raised This Month: $153 Target: $400
 38% 

INI File Reader/Writer AMXX 1.9


Post New Thread Reply   
 
Thread Tools Display Modes
E1_531G
Senior Member
Join Date: Dec 2017
Old 05-28-2019 , 02:11   Re: INI File Reader/Writer AMXX 1.9
Reply With Quote #11

Hello again.
I think this API misses one very good thing: natives for keeping file open for some time, for multiple-writings/readings.
You can see similar feature in SQLVault: https://forums.alliedmods.net/showthread.php?t=146849

For example:
1. I know i have to read 3 settings keys from the file
2. I use: ini_init( ... )
3. I use 3 times: ini_read_int( ... )
4. I use ini_end( ... )

How it works?
ini_init() creates a global temporary file pointer.
if ini_read_int or others natives see what that global pointer is available they use it instead of opening and closing the file again and again.
ini_end() kills that global pointer.

Maybe it is not a big deal speaking about performance, but think a bit, when you use an API like this one you almost always know which keys you have to read and how many they are.
__________________
My English is A0

Last edited by E1_531G; 05-28-2019 at 02:13.
E1_531G is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 05-28-2019 , 15:32   Re: INI File Reader/Writer AMXX 1.9
Reply With Quote #12

Not a bad idea, I'll update it when I've time.
__________________
Accepting private $$$ plugins requests.

@Steam: crazy770
@Discord: CrazY.#5317

Website | Channel

CrazY. is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 11-30-2019 , 21:52   Re: INI File Reader/Writer AMXX 1.9
Reply With Quote #13

hey, how i see this include doesnt have option to delete section (by steamid for example)...
@CrazY. can you add that one?

because if we use only writing data to file, time of loading will be slower by time, so having option to reduce 'old rows' will really help us

PS: is 'ini_read_string' even working? im getting arguments error, with this simple example: ini_read_string(FILENAME, szAuthId, "Name", g_szName[ id ] );
__________________
KZ Public Autocup
PrimeKZ


My blog:
http://primekz.xyz/ (not entirely finished yet)

Last edited by JocAnis; 11-30-2019 at 22:14.
JocAnis is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 12-04-2019 , 11:03   Re: INI File Reader/Writer AMXX 1.9
Reply With Quote #14

I don't have much free time now, anyway I didn't added a option to remove sections because the main purpose of this include is work with settings. There are many vault systems already to work with player data and such things.
__________________
Accepting private $$$ plugins requests.

@Steam: crazy770
@Discord: CrazY.#5317

Website | Channel

CrazY. is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:33.


Powered by vBulletin®
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Theme made by Freecode