Jump to content

[Release] Advanced Trading 2.1 !UPDATED!


Zupa

Recommended Posts

Hi Zupa,

 

Good to see this is progressing nicely.

 

One thing I thought I would mention is a limitation with the Hiveext.dll. 

 

Scanning through the SQL in the hivesql code I noticed that the calls for buying or selling are hard coded for individual item updates to the trader inventories (i.e. buy 1x tin of beans and the code will make a call to the DB 1 time to deduct 1 from the traders inventory in the DB, buy 10x tin of beans and the code needs to make the call to the hive 10 times :wacko: ).  This is not so much of an issue when there is the animation cycle between single item purchases but if someone buys 10 cans of beans using the gui it may start firing 10 updates at the DB in quick succession.  This in itself should not be too much of an issue for a reasonible MySQL server install but may cause some issues later around server restarts or with lots of players buying and selling at the same time. 

 

Have a scan of the code here.  The function is fetchTraderObject at the bottom of the file which is part of the 398 call initiated from server_tradeObject.sqf

 

It would probably be pretty easy to update the hive code to change this to a variable rather than a hard coded number allowing each call to update stock levels in more than a single item increment (yep another custom hive version) unless you have already worked around this some other way.

 

I came across this when checking out the code for adding items to traders and how the hive gets the data.  Just thought you may like the heads up in case you were not aware (as I wasn't until I fell across it).

 

A quick answer from work ( sorry for the short asnwer, will reply more detailed later)

 

I was not planning to do a stock market. 

 

This will only support Config traders in the first version ( might never support SQL traders, like u said, too much data calls). // or i just remove the stock check for sql.

 

Side note, this does NOT replace the originaly trading, it will be a 2nd option when u look at the trader ( or 1st ofcourse, depends which u add first).

Link to comment
Share on other sites

That's a shame.  Having some risk of there being no stock can be quite good (or frustrating) when searching for items on a server.

 

I would have probably looked at changing the EH to also pass a number of items to the server and then just get the server to loop one DB call at a time for each item.  Client to server is limited to a single call and the server can add a delay on the DB calls.  Would need to build something in to manage clearing any outstanding changes before a restart (kick the players for restart then wait until the queues are clear and then restart the server.

 

Not the most efficient but with the hiveEXT limitations, still workable.

 

Will be good to see how this mod progresses after the config traders version is out.

Link to comment
Share on other sites

Is there a benefit to having config traders over database traders? I like a small mission file and config traders does quite the opposite.  Also, where would one find zupas single currency script install details as it seems so many scripts use that and people like it?  Not exactly the right place to ask these but this script uses both so meh :P AND lastly... great work zupa

Link to comment
Share on other sites

Is there a benefit to having config traders over database traders? I like a small mission file and config traders does quite the opposite.  Also, where would one find zupas single currency script install details as it seems so many scripts use that and people like it?  Not exactly the right place to ask these but this script uses both so meh :P AND lastly... great work zupa

http://epochmod.com/forum/index.php?/forum/56-project-gold-coin-based-single-currency-banking-system/

Link to comment
Share on other sites

Config traders are faster and much easier to add/remove things to it.

 

If you don't care about quantity, then go config traders all the way.

 

Meh not necessarily. Config traders are often faster cause server admins don't fail to properly setup their database server. Also disagree on the second part, i do not feel it is much easier to edit sqf files and repack your PBO then to simply chance a value in the database and wait for restart, also a database is much more suited to easily find and sort stuff which is actually quite handy.

Agree with RimBlock, would be a shame if this mod would only be for config traders.

Link to comment
Share on other sites

Would be good if someone wrote a db server advanced setup guide including things like fine tuning the my.ini, setting up accounts with appropriate access (for Epoch / backups / any web based queries) etc.

Would have thought Someone like Dave (MGT) would have a wealth of info if they were willing to share.

thought inventory quantities were 'pseudo' real time for backend updates. Have only had a quick browse around the code so could well be wrong.

Link to comment
Share on other sites

Would be good if someone wrote a db server advanced setup guide including things like fine tuning the my.ini, setting up accounts with appropriate access (for Epoch / backups / any web based queries) etc.

Would have thought Someone like Dave (MGT) would have a wealth of info if they were willing to share.

thought inventory quantities were 'pseudo' real time for backend updates. Have only had a quick browse around the code so could well be wrong.

 

MGT doesn't share ^^ thats how it looks like ^^

 

For backups this is what i use

 

http://mysqlbackupftp.com/

 

I let it backup every hour and it places the files in my Dropbox ( Which i got 77GB of space on ^^).

 

Also the rotate logs for your rpt/hive: rewrite that so it stores the folder in cloud aswell.

 

Some info on basic.cfg:

 

https://community.bistudio.com/wiki/basic.cfg

 

For the rest i don't have experience with :)

Link to comment
Share on other sites

hmm i do have a linux bash script which a) copy the stuff somewhere, b) injecting the stuff into my website ( for statistics ) the kids like to see how many meters they ran, along who is the most bad ass bandit stuff like that.

 

secondly i do internal reporting, of new players joined last 24 hours, along with buying and selling items, to fine tune the prices in my database.

Link to comment
Share on other sites

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
×
×
  • Create New...