dekela

Client side files access database

5 posts in this topic

I'm working on a dynamic trader price setup where basically when an item is bought it's price goes up,  when sold price goes down. I currently have it reading/writing to missionNameSpace, but want to move it to the database so it becomes persistent. 

So the question is can the client side files I have overwritten, read/write values to the database in order to show/change the sell/buy prices in the trader.  If so,  could someone pleases post an example piece of code. 

Thanks 

 

Edit: given the prices are already read/written to missionNameSpace, maybe it would be easier to have a server side script that loads the values from the database to missionNameSpace at server start up,  then saves them back to the database from missionNameSpace periodically. 

Edited by dekela

Share this post


Link to post
Share on other sites

Hello Dekela,

While it is possible, I would advise against it.

To make it 'work' would require a separate login into the SQL server for the client.  With a name and password ANYONE can see/use.  So, I come in see the price as being 100, I think it is too high, I lower it to 0.  You would also have to have your 'own version' of the Exile client too, which would be another major problem.

 

What you can do is have a 'transaction' sent to the server and then have the sever adjust the price via a mod to the Exile server.

 

Another way is to 'monitor' the DB in real-time with an EXE program that would adjust the prices.  By doing it this way, it would not 'slow up' the Exile server by processing prices over and over.

 

I would suggest an stand alone EXE and have the prices adjusted at server restart.   Then, this EXE can modify the file(s) that contain pricing info, which is loaded at server startup.  This would 'speed' things up and make it safer as well.  It also removes the need to 'hack' Exile; be it on the server side or the client side.

I have a program which sets the date and time at server reboot to the real date/times and this is exactly how I do it.  At startup, my EXE will un-PBO the mission file, changes the date and time, re-PBO's the mission file, the start ARMA/Exile.  Takes about 5 - 10 seconds from start to finish.  At next reboot, it repeats the process with setting the date and time to the 'new' date and time, then start the server.  You could do the 'same process' for the prices.

:)

Edited by Z80CPU

Share this post


Link to post
Share on other sites
Advertisement

Thanks for the reply,  although I don't understand most of it. I may not have been clear on what I was asking,  so I'll try again. 

Inside @exile folder is an sqf called exileclient_somethingToDoWithListbox.sqf. one of the things this does is populates the trader menu with buy/sell prices of items.  It gets these values from the config.cpp. 

I have overwritten this to get the values from variables stored in missionNameSpace instead. 

My question is can I add some kind of db call to this sqf to pull values from a table in the database instead of missionNameSpace. 

Or,  is there a way to pull values from the database table,  then publicVariable them. 

Thanks again

Edited by dekela

Share this post


Link to post
Share on other sites
6 hours ago, kuplion said:

Use network messages.

thanks again, but i think i'm over my head with this, lol

anyway, i have a database table called "price". columns are "econItem", "econMin", "econPrice", "econMax"

i want to retrieve the value from the "econPrice" column. would the following query be correct?

[getEconPrice]
SQL1_1 = SELECT econPrice FROM price WHERE econItem = ?
Number of Inputs = 1
SQL1_INPUTS = 1
OUTPUT = 1

this db stuff is all new to me, so thanks for the help

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.