SA-MP Forums Archive
[Include] dini2.inc - Improved dini file processor with amazing benchmarks (aka. gini)! - 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] dini2.inc - Improved dini file processor with amazing benchmarks (aka. gini)! (/showthread.php?tid=611399)

Pages: 1 2 3 4 5 6 7


Re: gini.inc - Fast multi file processor with "dini's" syntax - JokeyL - 17.12.2016

Nice, TY.


Re: gini.inc - Fast multi file processor with "dini's" syntax - Gammix - 18.12.2016

Update v2.4.0:
- Code optimized a bit
- Fixed auto file creation when using "Get" function


Re: gini.inc - Fast multi file processor with "dini's" syntax - JokeyL - 18.12.2016

It's still creating file, but now without any values.

++
Line 347

warning 202: number of arguments does not match definition ;

new instance = INI_OpenFileInstance(file, "dini_Set");


and where is " INI_StripLine "


Re: gini.inc - Fast multi file processor with "dini's" syntax - Gammix - 18.12.2016

Update v2.4.1:
- "fexist" check added in "Get" functions to resist auto file creation
- Fixed "argument type mismatch" for "Set" functions


@JokeyL: INI_StripLine is done in "INI_OpenFileInstance", it's not used as a function but raw code as it's only used once in a call.


Re: gini.inc - Fast multi file processor with "dini's" syntax - JokeyL - 18.12.2016

Awesome work. Rep++


Re: gini.inc - Fast multi file processor with "dini's" syntax - JokeyL - 18.12.2016

It's faster only 60-80 ms. But it still better than normal dini.


Re: gini.inc - Fast multi file processor with "dini's" syntax - Gammix - 18.12.2016

Quote:
Originally Posted by JokeyL
Посмотреть сообщение
It's faster only 60-80 ms. But it still better than normal dini.
That's not true. Have you tested it with original dini? And if yes show me the test code.


Re: gini.inc - Fast multi file processor with "dini's" syntax - JokeyL - 18.12.2016

LOL my bad i'm sory. I tested with your code:

Код:
    new s, e;
    
    s = GetTickCount();
    for (new i; i < 100000; i++)
    {
        dini_Get("Test1.ini", "Set1");
        dini_IntSet("Test1.ini", "Set2", 255);
        dini_Int("Test1.ini", "Set2");
        dini_Float("Test1.ini", "Set3");
        dini_Timeout("Test1.ini");
    }
    e = GetTickCount();
    printf("%i ms", e-s);
But i didn't change include from dini to gini XD

dini: 6383 ms
gini: 120 ms


Re: dini2.inc - Improved dini file processor with amazing benchmarks (aka. gini)! - JokeyL - 18.12.2016

Hmm i found next bug...

OnPlayerDeath: playerInfo[killerid][Kills] += 1;

Load: playerInfo[playerid][Kills] = dini_Int(path, "pKills");

Save: dini_IntSet(path, "pKills", playerInfo[playerid][Kills]);

And it works okay. File looks: pKills=1

But it's not resaving(not save again)

If you load your stats, and save with another value, e.g: playerInfo[killerid][Kills] = 100; and save this, file doesn't update.

Sorry for my English


Re: dini2.inc - Improved dini file processor with amazing benchmarks (aka. gini)! - Gammix - 18.12.2016

Fixed in v2.4.2.


Re: dini2.inc - Improved dini file processor with amazing benchmarks (aka. gini)! - Gammix - 28.12.2016

Quote:
Originally Posted by JokeyL
Посмотреть сообщение
If we have 2 players with similiar nicknames, for example:

Tidoos & Tidoos111

Then the files will not overwrite...
How can these two be same when there is "111" in the end of second name making it different! So yea no overwrite.


Re: dini2.inc - Improved dini file processor with amazing benchmarks (aka. gini)! - JokeyL - 28.12.2016

But it not overwrite for Tidoos and Tidoos111 for different action.


Re: dini2.inc - Improved dini file processor with amazing benchmarks (aka. gini)! - Gammix - 28.12.2016

Quote:
Originally Posted by JokeyL
Посмотреть сообщение
But it not overwrite for Tidoos and Tidoos111 for different action.
Show your code or explain it in a way i can get an idea atleast!

Anyways, if you have a file name with numbers (here is "111") and one without, booth will be treated as 2 different files and data won't be written same when handling either one of them.


Re: dini2.inc - Improved dini file processor with amazing benchmarks (aka. gini)! - CantBeJohn - 28.12.2016

Quote:
Originally Posted by Gammix
Посмотреть сообщение
Show your code or explain it in a way i can get an idea atleast!

Anyways, if you have a file name with numbers (here is "111") and one without, booth will be treated as 2 different files and data won't be written same when handling either one of them.
I think he's claiming that if there's two files with similar names, the script won't write data for both. Which is probably just something he's doing wrong in his code, because it's all working fine for me.

Superb job, Gammix.


Re: dini2.inc - Improved dini file processor with amazing benchmarks (aka. gini)! - Gammix - 28.12.2016

Quote:
Originally Posted by CantBeJohn
Посмотреть сообщение
I think he's claiming that if there's two files with similar names, the script won't write data for both. Which is probably just something he's doing wrong in his code, because it's all working fine for me.

Superb job, Gammix.
You cannot have two files with same name and extension. So it's actually not possible.


Re: dini2.inc - Improved dini file processor with amazing benchmarks (aka. gini)! - CantBeJohn - 28.12.2016

Quote:
Originally Posted by Gammix
Посмотреть сообщение
You cannot have two files with same name and extension. So it's actually not possible.
As far as I know, he's not claiming they're the same.

Quote:

This is his claim:

similar != same

blah and blah = same (aka not possible to have two files with same name and extension)

blah and blah1 = similar (according to what hes saying, when two files are similar like this, stuff doesn't write in either of them)

Although, like you said so yourself, files being similar have nothing to do with stuff not being written in either of them because they're different files and are treated differently and not the same when handling either one of them.

JokeyL just needs to post his code here.


Re: dini2.inc - Improved dini file processor with amazing benchmarks (aka. gini)! - JokeyL - 29.12.2016

[---]


Re: dini2.inc - Improved dini file processor with amazing benchmarks (aka. gini)! - JokeyL - 08.01.2017

Loool Gammix check this; If 2 players create account in the same time .ini file write values only for 1 player.
I tested it two times, it's bug.


Re: dini2.inc - Improved dini file processor with amazing benchmarks (aka. gini)! - JokeyL - 11.01.2017

Gammix, really fix this bug. Example if you use 2x dini_IntSet at the same time its not overwrite.

Look:

In file:
myValue=1

CMD:resave ;
dini_IntSet(player1, myValue, 0);
dini_IntSet(player2, myValue, 0);

= No effect.


Re: dini2.inc - Improved dini file processor with amazing benchmarks (aka. gini)! - Gammix - 11.01.2017

Quote:
Originally Posted by JokeyL
Посмотреть сообщение
Gammix, really fix this bug. Example if you use 2x dini_IntSet at the same time its not overwrite.

Look:

In file:
myValue=1

CMD:resave ;
dini_IntSet(player1, myValue, 0);
dini_IntSet(player2, myValue, 0);

= No effect.
I'll make some tests to make sure these are bugs. And then fix them, won't take long.