Jump to content
code34

iniDBI - Save and Load data to the server or your local computer without databases!

Recommended Posts

iniDBI(IMPROVED) - A simple server-side database extension using INI files

 

inidbi is not supported anymore, you can use now inidbi2:

https://forums.bistudio.com/topic/186131-inidbi2-save-and-load-data-to-the-server-or-your-local-computer-without-databases/

 

Authors:

inidbi - v1.4 code34 - nicolas_boiteux@yahoo.fr
inidbi - v1.3 code34 - nicolas_boiteux@yahoo.fr
inidbi - v1.2 code34 - nicolas_boiteux@yahoo.fr
inidbi - v1.1 code34 - nicolas_boiteux@yahoo.fr
inidb - v1.0 SicSemperTyrannis http://raiderbattalion.enjin.com/

iniDBI is a fork of the iniDB project. Download:
https://www.dropbox.com/s/d9cyw7wgbh9xuqb/%40inidbi.zip

Howto install inidbi in video:



Mission example using read & write Inidbi
https://www.dropbox.com/s/np91uw8d1cnrci4/test_mission.altis.zip

Github:
https://github.com/code34/-inidbi

README:

 

iniDBI(IMPROVED) - A simple server-side database extension using INI files

Authors:
inidbi - v1.4 code34 - nicolas_boiteux@yahoo.fr
inidbi - v1.3 code34 - nicolas_boiteux@yahoo.fr
inidbi - v1.2 code34 - nicolas_boiteux@yahoo.fr
inidbi - v1.1 code34 - nicolas_boiteux@yahoo.fr
inidb - v1.0 SicSemperTyrannis http://raiderbattalion.enjin.com/

How to use:
To use "iniDBI" in your mission, install the extension in your ARMA2 or ARMA3 directory by copying the entire "@inidbi" folder included in the download to your root directory.
Don't forget to copy over over or create the /db/ folder.
It should look like: /Arma 3/@inidbi/iniDB.dll
It should look like: /Arma 3/@inidbi/db/
It should look like: /Arma 3/@inidbi/Addons/inidbi.pbo

Then in your mission init.sqf, somewhere before you want to use the functions do this:
call compile preProcessFile "\inidbi\init.sqf";

It should be noted that when you install the @inidbi folder you can delete the /examples/ directory from there if you please, they serve no purpose in that folder.

You have permission to use, upload or otherwise distribute this as please, just mention differents authors.

----------------------------------------------------------------------------------------------

CHANGELOG

14-Decembrer-2013 - inidbi
- add deletesection feature
- fix buffer size

12-December-2013 - inidbi
- fix string serialize

16-November-2013 - inidbi
- check input/output data type
- add log messages

01-November-2013 - inidbi
- increase buffer 8k
- check size of written data
- change output function

13-March-2013
- Module
- Initial Release
- init.sqf
- Initial Release


DOCUMENTATION:

 

v 1.4 : iniDBI(IMPROVED) by code34 - nicolas_boiteux@yahoo.fr
v 1.3 : iniDBI(IMPROVED) by code34 - nicolas_boiteux@yahoo.fr
v 1.2 : iniDBI(IMPROVED) by code34 - nicolas_boiteux@yahoo.fr
v 1.1 : iniDBI(IMPROVED) by code34 - nicolas_boiteux@yahoo.fr
v 1.0 : IniDB by SicSemperTyrannis http://raiderbattalion.enjin.com/

Function: iniDB_version
Usage: diag_log call iniDB_version;
Output: the dll version and addon version

----------------------------------------------------------------------------------------------------------------------------------------------

Function: iniDB_exists
Usage: "myDatabaseFile" call iniDB_exists;
Output: true if the database exists as a file, false otherwise

----------------------------------------------------------------------------------------------------------------------------------------------

Function: iniDB_delete
Usage: "myDatabaseFile" call iniDB_delete;
Output: true if the file was deleted successfully, false otherwise
Notes: If you are concerned about security, you can recompile the PBO/DLL without this function.

----------------------------------------------------------------------------------------------------------------------------------------------

Function: iniDB_deletesection
Usage: [databasename, section] call iniDB_deletesection;
Output: true if the section was deleted successfully, false otherwise

----------------------------------------------------------------------------------------------------------------------------------------------
Function: iniDB_read
Prototype: [databasename, section, variablename, ("STRING"|"ARRAY"|"SCALAR")] call iniDB_read;
Usage: ["myDatabaseFile", "sectionname", name player, "STRING"] call iniDB_read;
Usage: ["myDatabaseFile", "sectionname", "position", "ARRAY"] call iniDB_read;
Usage: ["myDatabaseFile", "sectionname", "health", "SCALAR"] call iniDB_read;

output: data
inidb_errno: true if read succeed, false if read failed
data: data return type depends of fourth parameter function. Return empty array, string, or 0, if not set
Notes: fourth parameters musts exist (not like in iniDB where it is optionnal)
----------------------------------------------------------------------------------------------------------------------------------------------

Function: iniDB_write
Prototype: [databasename, section, variablename, value] call iniDB_read;
Usage: ["myDatabaseFile", "sectionname", "position", position player] call iniDB_write;
Usage: ["myDatabaseFile", "sectionname", "health", 100.0] call iniDB_write;
Usage: ["myDatabaseFile", "sectionname", "name", profileName player] call iniDB_write;
Output: true if the write succeeds, false otherwise.
Notes: The fourth parameter is assumed to be a string, array or number (scalar). If it is not, it will save as a string by default. This function automatically derives the type by the variable passed.
Please avoid saving strings or data with the character ' in it, it is an expected bug, but untested.

---------------------------------------------------------------------------------------------------------------------------------------------

Function: iniDB_CRC32
Usage: diag_log "SicSemperTyrannis" call iniDB_CRC32;
Output: "204E6A8B"
Notes: This is a standard implementation and will match PHP and various other languages.

----------------------------------------------------------------------------------------------------------------------------------------------

Function: iniDB_MD5
Usage: diag_log "SicSemperTyrannis" call iniDB_MD5;
Output: "ee89b42582c546fe47d17b14f6331bff"
Notes: This is a standard implementation and will match PHP and various other languages.

----------------------------------------------------------------------------------------------------------------------------------------------

Function: iniDB_Base64Encode
Usage: diag_log "SicSemperTyrannis" call iniDB_Base64Encode;
Output: "U2ljU2VtcGVyVHlyYW5uaXM="
Notes: This is a standard implementation and will match PHP and various other languages.

----------------------------------------------------------------------------------------------------------------------------------------------

Function: iniDB_Base64Decode
Usage: diag_log "U2ljU2VtcGVyVHlyYW5uaXM=" call iniDB_Base64Decode;
Output: "SicSemperTyrannis"
Notes: This is a standard implementation and will match PHP and various other languages.


You can save and load data persistently for your mission. Save money for players, inventories, etc. This is meant for servers but it could be used for clients, too.

The PBO (SQF) and C++ source is included. Have fun.

Edited by code34

Share this post


Link to post
Share on other sites
Guest

Release frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

thks Gagi ;)

just add an HOWTO video for install inidbi:

Share this post


Link to post
Share on other sites

Great!

When do you release the Hardcore Insurgency with inidbi support ? :)

Share this post


Link to post
Share on other sites

How to use:

To use "iniDBI" in your mission, install the extension in your ARMA2 or ARMA3 directory by copying the entire "@inidbi" folder included in the download to your root directory.

Don't forget to copy over over or create the /db/ folder.

It should look like: /Arma 3/@inidbi/iniDB.dll

It should look like: /Arma 3/@inidbi/db/

It should look like: /Arma 3/@inidbi/Addons/inidbi.pbo

Now, add this parameter in your command line to start the game:

-mod=@inidbi

Then in your mission init.sqf, somewhere before you want to use the functions do this:

call compile preProcessFile "\inidbi\init.sqf";

It should be noted that when you install the @inidbi folder you can delete the /examples/ directory from there if you please, they serve no purpose in that folder.

This is the same solution for server dedicated ?

Share this post


Link to post
Share on other sites

yes, it works the same way for dedicated server (only for windows server).

Share this post


Link to post
Share on other sites

call compile preProcessFile "\inidbi\init.sqf";

If i write that in my init mission where is the file inidbi\init.sqf ?

---------- Post added at 11:29 ---------- Previous post was at 10:51 ----------

I follow this in my dedicated server :

How to use:

To use "iniDBI" in your mission, install the extension in your ARMA2 or ARMA3 directory by copying the entire "@inidbi" folder included in the download to your root directory.

Don't forget to copy over over or create the /db/ folder.

It should look like: /Arma 3/@inidbi/iniDB.dll

It should look like: /Arma 3/@inidbi/db/

It should look like: /Arma 3/@inidbi/Addons/inidbi.pbo

Now, add this parameter in your command line to start the game:

-mod=@inidbi

Then in your mission init.sqf, somewhere before you want to use the functions do this:

call compile preProcessFile "\inidbi\init.sqf";

It should be noted that when you install the @inidbi folder you can delete the /examples/ directory from there if you please, they serve no purpose in that folder.

But when I launch my mission on the server he dont find inidbi\init.sqf where I can take this !

Share this post


Link to post
Share on other sites
call compile preProcessFile "\inidbi\init.sqf";

If i write that in my init mission where is the file inidbi\init.sqf ?

it is in the addon inidbi.pbo ;)

Share this post


Link to post
Share on other sites
call compile preProcessFile "\inidbi\init.sqf";

If i write that in my init mission where is the file inidbi\init.sqf ?

---------- Post added at 11:29 ---------- Previous post was at 10:51 ----------

I follow this in my dedicated server :

But when I launch my mission on the server he dont find inidbi\init.sqf where I can take this !

It is not easy to add inidb mod to any mission. I try to add inidb mod to Xeno domination mission and I've managed (with help of others) to save data but can't get data to load. You need to have unpacked version of mission and find file init.sqf In that file add that line with call compile preProcessFile "\inidbi\init.sqf"; BUT as I wrote above it can not work.

Share this post


Link to post
Share on other sites
It is not easy to add inidb mod to any mission. I try to add inidb mod to Xeno domination mission and I've managed (with help of others) to save data but can't get data to load. You need to have unpacked version of mission and find file init.sqf In that file add that line with call compile preProcessFile "\inidbi\init.sqf"; BUT as I wrote above it can not work.

yes, inidbi is an addon for mission maker not an addon that save itself data of all missions. So it requires to edit mission and add some script command to works ;)

Read function works well and all the time ;)

if you have a problem, report a bug with the command line you use, the db.ini, etc.

Edited by code34

Share this post


Link to post
Share on other sites

Can you write a tutoriel for dedicated server I can't install your script for my mission... I try many solution but it doesnt work

Share this post


Link to post
Share on other sites
Can you write a tutoriel for dedicated server I can't install your script for my mission... I try many solution but it doesnt work

do you try the test mission ?

---------- Post added at 18:10 ---------- Previous post was at 17:27 ----------

update test mission for server side:

https://www.dropbox.com/s/np91uw8d1cnrci4/test_mission.altis.zip

Share this post


Link to post
Share on other sites

So I have a very larg problem here,

Everything works fine on my side, BUT if a player joins my server it wont load any files or write them as it gives them error to the code, I've tried to fix this a few times now but nothing I do helps it. I've dubble checked the ini file, my saving saves writes without any problem, it wont write or load for other players besides me.... Any ideas?

Error in expression <erUID player, "Account", cash] call iniDB_write;
["Data", getPlayerUID p>
 Error position: <iniDB_write;
["Data", getPlayerUID p>
 Error Undefined variable in expression: inidb_write
File mpmissions\__CUR_MP.cherarus\Scripts\saveData.sqf, line 5

Seriusly? How hard can it be to answer me why it is only saving for me and not? A fix would be awesome before I kill my PC or something, it's driving me crazy it's been 48 hours now of same stupied error. I'll pay you if thats the case! Someone please tell me what is wrong and how I can fix it!!

Share this post


Link to post
Share on other sites
So I have a very larg problem here,

Everything works fine on my side, BUT if a player joins my server it wont load any files or write them as it gives them error to the code, I've tried to fix this a few times now but nothing I do helps it. I've dubble checked the ini file, my saving saves writes without any problem, it wont write or load for other players besides me.... Any ideas?

Error in expression <erUID player, "Account", cash] call iniDB_write;
["Data", getPlayerUID p>
 Error position: <iniDB_write;
["Data", getPlayerUID p>
 Error Undefined variable in expression: inidb_write
File mpmissions\__CUR_MP.cherarus\Scripts\saveData.sqf, line 5

Seriusly? How hard can it be to answer me why it is only saving for me and not? A fix would be awesome before I kill my PC or something, it's driving me crazy it's been 48 hours now of same stupied error. I'll pay you if thats the case! Someone please tell me what is wrong and how I can fix it!!

what is the code ? and where the code is executed (server or client side) ? where the inidbi addon is loaded ?

Share this post


Link to post
Share on other sites
Guest

Release frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites
Any plans to port this so it works on linux servers?

nope ;( i have no plan to port it for the moment on linux

Share this post


Link to post
Share on other sites

Just a quick question was any work done with the dll or just the pbo? The reason im asking is im looking at upgrading my hosted server from inidb to inidbi but dont want to go threw the hassle of getting the server host to upload the new dll.

Thanks

Edited by terrence
Fix spelling

Share this post


Link to post
Share on other sites

yes both, the dll and addon were updated :)

Share this post


Link to post
Share on other sites
Guest

Release frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×