Jump to content
code34

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

Recommended Posts

@56Curious looks like the inidbi2 is loaded. wish I could help you more but I don't know much about servers.

Share this post


Link to post
Share on other sites
Just now, 56Curious said:

@gc8 Thank you for trying, helped me clarify some stuff anyway so your time wasn't completly wasted ;)

 

no problem. if there was actual error messages I might be able to help but now I'm clueless

Share this post


Link to post
Share on other sites

I'll run a version of the server now, upload the logs, see if you can spot anything. It is just me doing this within my community rn anyway so no harm in a second pair of eyes.

Share this post


Link to post
Share on other sites
4 minutes ago, 56Curious said:

Right here is the latest log. Attempted to save loadout, nothing.

 

 

from what I understand the _Request variable is not ok and hence "_Request select 5" causes Zero divisor error.

["write", ["GEAR", "Loadout", _Request select 5]] call _Database;

 

Share this post


Link to post
Share on other sites

@code34 can you save the ini file in mission folder or only only in the addon folder?

 

Share this post


Link to post
Share on other sites

by default, it s only in the addon folder

Share this post


Link to post
Share on other sites
2 hours ago, code34 said:

by default, it s only in the addon folder

 

So it can be changed?

Share this post


Link to post
Share on other sites
12 hours ago, code34 said:

yes look at ligne 55 :

https://github.com/code34/inidbi2/blob/master/inidbi2/inidbi2.cs

 


string mypath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\db\\";

 

 

 

 

That's great, any change you could add script command that changes the path? Or maybe command that toggles between execute location and mission location?

 

 

  • Like 1

Share this post


Link to post
Share on other sites

It s a design choice to not permit those kind of operations at sqf level cause it can lead to override by mistake some files.

 

Everybody who want, can do it at the dll level with his own modifications from the original source. You just have to edit it in visual studio community and recompile it as 64bits exe.

 

But you can not write directly some datas into your pbo without unpack it.

Share this post


Link to post
Share on other sites

this here script works fine in singleplayer.... it also work on my dedicated server, the problem is only, that it writes the database on the machine of the player, not on the server. What could i be doing wrong?

 

_uid = getPlayerUID player;
_inidbi = ["new", "creditsDB"] call OO_INIDBI;
_existing = ["read", ["section", _uid, 0]] call _inidbi;
_check = _existing;
if (_check == 0) then {["write", ["section", _uid, 80]] call _inidbi; hint format ["%1 bananas", 80] } else {hint format ["%1 bananas", _check]};

 

Share this post


Link to post
Share on other sites

hi griesgram

 

how do you check the script work dedicated server ? you should check if inidbi addon is well loaded with the version command 

 

check also -servermod=

 

on server start parameters :)

Share this post


Link to post
Share on other sites

@code34 Hey It's me again. I was thinking could you make it so that the inidb2 uses loadfile script command to load the db file even from inside of pbo? Because loadfile can do this.

 

Also it would be great if you could set the db save path to your mission folder, then you don't have to ask everyone who plays your mission to drop the db file to inidb2 addon folder. But the db file would packed in to the mission pbo once mission is exported. is this possible?

 

thx for your great work code34!

Share this post


Link to post
Share on other sites
On 12.4.2018 at 10:53 AM, gc8 said:

@code34 Hey It's me again. I was thinking could you make it so that the inidb2 uses loadfile script command to load the db file even from inside of pbo? Because loadfile can do this.

 

Also it would be great if you could set the db save path to your mission folder, then you don't have to ask everyone who plays your mission to drop the db file to inidb2 addon folder. But the db file would packed in to the mission pbo once mission is exported. is this possible?

 

thx for your great work code34!

no loadFile cannot do this. loadFile is made to handle text. Not binary files. It will stop on a null char.

But inidb could directly parse the pbo and load the DB from it.

Share this post


Link to post
Share on other sites
22 minutes ago, Dedmen said:

no loadFile cannot do this. loadFile is made to handle text. Not binary files. It will stop on a null char.

But inidb could directly parse the pbo and load the DB from it.

 

I did not mean loadfile would load the pbo... but a text file packed in the pbo like so:

_str = loadFile "test.txt";

I tested this with exported mission and it worked, the contents of the file were successfully returned. :)

 

Share this post


Link to post
Share on other sites
2 hours ago, gc8 said:

 

I did not mean loadfile would load the pbo... but a text file packed in the pbo like so:


_str = loadFile "test.txt";

I tested this with exported mission and it worked, the contents of the file were successfully returned. :)

 

Ooohh. Inidb uses ini files.. who would've thought :dozingoff:

I better go and get some sleep. Forget that I was here ;)

Share this post


Link to post
Share on other sites

@gc8, i don't understand what you expected to do. You can't write into a pbo file. Like i said before you can custom yourself your path from c# source.

 

What is your goal ?

Share this post


Link to post
Share on other sites
42 minutes ago, code34 said:

@gc8, i don't understand what you expected to do. You can't write into a pbo file. Like i said before you can custom yourself your path from c# source.

 

What is your goal ?

 

Not write into pbo... write to unpacked mission folder. and read from it (pbo or unpacked). :) 

 

that way when someone wants to play your mission they don't have to drop the .ini files to inidb addon folder. But the .ini can be readed directly from the mission file.

 

 

Edited by gc8
ini

Share this post


Link to post
Share on other sites

ok but what is the goal of this ? What is the benefit ?

 

ini file should be read / write by application or developpers not by users.

 

this has been configured this way to prevent security issues, and prevent users from overwriting files elsewhere

Share this post


Link to post
Share on other sites
24 minutes ago, code34 said:

ok but what is the goal of this ? What is the benefit ?

 

The benefit is that you can publish your mission with the .ini file in the pbo so that user wont have to install the ini file separately. 

 

24 minutes ago, code34 said:

this has been configured this way to prevent security issues, and prevent users from overwriting files elsewhere

 

If inidb saves only files with .ini extension then it can't overwrite anything important.

Share this post


Link to post
Share on other sites

Finally, gc8 has added the feature to his version. I invite you to contact him if you need more information.

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

×