[Include] dini2.inc - Improved dini file processor with amazing benchmarks (aka. gini)!
#41

Nice, TY.
Reply
#42

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

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 "
Reply
#44

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.
Reply
#45

Awesome work. Rep++
Reply
#46

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

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.
Reply
#48

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
Reply
#49

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
Reply
#50

Fixed in v2.4.2.
Reply
#51

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.
Reply
#52

But it not overwrite for Tidoos and Tidoos111 for different action.
Reply
#53

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.
Reply
#54

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.
Reply
#55

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.
Reply
#56

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.
Reply
#57

[---]
Reply
#58

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.
Reply
#59

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.
Reply
#60

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)