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: dini2.inc - Improved dini file processor with amazing benchmarks (aka. gini)! - Marllun - 11.12.2017

DOF2_Exit(); Dini = ?


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

This is original dini conversion not DOF2.

If you are looking for DOF2 type of syntax, this include does have a new API to it, check the main thread for the list of functions.


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

Any sample tutorial using new API?
And 1 more question, when i update to new version from 2.6 to 2.8 my saving system got bug using the old API.
I hope you can solved this. I think i'll be using dini2 version 2.6, it's stable version i ever use.


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

I'll put up some examples in the thread and new update coming soon which will get rid of all bugs.


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

after using this dini in my script my login/register system got bugged its showing wrong password or sometimes always directly login without password


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

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
Okay man, here's the deal, i just tried it again (your new update) and i got one filterscript along with my gamemode, for some ambiguous reason it reads but... it won't write to the files on the filterscript, any idea? the code is very simply its literally just dini_Set, i already used print and the code is executed yet it doesn't write to the file.
Okay. I am gonna test the include script thoroughly this time since this update was my final major change to code.

And if you could provide me your filterscript either here or private message so i can test that too. If not thats okay.


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

Quote:
Originally Posted by Gammix
Посмотреть сообщение
Okay. I am gonna test the include script thoroughly this time since this update was my final major change to code.

And if you could provide me your filterscript either here or private message so i can test that too. If not thats okay.
As said it's very basic, OnPlayerDisconnect i'm checking if player spawned once, save the integers related to him, then i thought maybe that's the problem, so i used print all over onplayerdisconnect, they all checked out correct which means, the code is executed yet not writing to the file AND SOME are not being read, i'm gonna take a wild guess and say it might be the limits u set but i dunno, thanks for the help btw. If anything here's a small snippet:
PHP код:
if(spawnedonce[playerid])
{
    
GetPlayerPos(playerid,X,Y,Z);
     
GetPlayerFacingAngle(playerid,Angle);
      
dini_IntSet(zefile,"PSCORE",GetPlayerScore(playerid));
     
dini_IntSet(zefile,"Interior",GetPlayerInterior(playerid));
     
dini_IntSet(zefile,"World",GetPlayerVirtualWorld(playerid));
     
dini_IntSet(zefile,"WantedLevel",GetPlayerWantedLevel(playerid));
     if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
     {
         
dini_FloatSet(zefile,"X",X);
         
dini_FloatSet(zefile,"Y",Y);
         
dini_FloatSet(zefile,"Z",Z+1);
         } 
NOTE: When i say it's not writing, i don't mean its not writing values in the fields, i'm saying its not even creating the field. Thanks again really appreciate your effort.


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

I did a quick test and seems like everything works fine. Here test it yourself:
PHP код:
main() {
    new const 
file[] = "test.ini";

    
dini_IntSet(file"int"100);
     
dini_FloatSet(file"flt"100.0);
     
dini_Set(file"str""val_set");

     
printf("int = %i"dini_Int(file"int"));
     
printf("flt = %f"dini_Float(file"flt"));
     
printf("str = %s"dini_Get(file"str"));

     
printf("dini_NumKeys = %i"dini_NumKeys(file));
     
printf("dini_Isset = %i"dini_Isset(file"str"));

     
dini_Unset(file"str");
     
printf("dini_Isset = %i"dini_Isset(file"str"));
     
printf("dini_NumKeys = %i"dini_NumKeys(file));




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

Quote:
Originally Posted by Gammix
Посмотреть сообщение
I did a quick test and seems like everything works fine. Here test it yourself:
PHP код:
main() {
    new const 
file[] = "test.ini";

    
dini_IntSet(file"int"100);
     
dini_FloatSet(file"flt"100.0);
     
dini_Set(file"str""val_set");

     
printf("int = %i"dini_Int(file"int"));
     
printf("flt = %f"dini_Float(file"flt"));
     
printf("str = %s"dini_Get(file"str"));

     
printf("dini_NumKeys = %i"dini_NumKeys(file));
     
printf("dini_Isset = %i"dini_Isset(file"str"));

     
dini_Unset(file"str");
     
printf("dini_Isset = %i"dini_Isset(file"str"));
     
printf("dini_NumKeys = %i"dini_NumKeys(file));

Can having too many fields prevent it? can i increase any of the #define MAX ones u put?


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

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
Can having too many fields prevent it? can i increase any of the #define MAX ones u put?
You can have upto "64" fields by default.
To increase it simply do this:
PHP код:
#define DINI_MAX_FIELDS <your limit>
#include <dini2> 



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

Quote:
Originally Posted by Gammix
Посмотреть сообщение
You can have upto "64" fields by default.
To increase it simply do this:
PHP код:
#define DINI_MAX_FIELDS <your limit>
#include <dini2> 
Aha okay i'll work on it and get back to you on that, thanks a lot for the support.


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

Quote:

E:\Server\Haikal Roleplay\pawno\include\dini2.inc(200) : warning 219: local variable "NULL" shadows a variable at a preceding level

Any solution?


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

Quote:
Originally Posted by haikalbintang
Посмотреть сообщение
Any solution?
read this :https://sampforum.blast.hk/showthread.php?tid=648282
and this: https://sampforum.blast.hk/showthread.php?tid=648288


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

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
It's work, thanks dude


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

I switched from dini to this.It works well so far,ill give my taughts in near future to confirm the improvement.


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

I updated the test results, you can see how slow Dini.inc is from Dini2.inc.

Also test code is updated with a little tutorial on how to perform that test yourself, if you want to satisfy by testing yourself!


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

warning 219: local variable "NULL" shadows a variable at a preceding level

hmm? (in dini2, line 200)


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

I wouldn't recommend.


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

What happens if I don't use dini_timeout when finishing writing a file??


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

Quote:
Originally Posted by insus100
Посмотреть сообщение
What happens if I don't use dini_timeout when finishing writing a file??
Then the timer will close the file, its optional; "dini_Timeout" is just for efficiency.
But, If you are writing new code with dini2, you should use this function after Setting/Getting data, its just like any other INI_Close function.