WebDev

Battle => Battle Support => Topic started by: Tom on September 04, 2013, 01:45:13 AM

Title: Merging with SMFShop
Post by: Tom on September 04, 2013, 01:45:13 AM
Hello, is it possible to easily integrate SMFShop with Battle just along the lines of having both mods read from the same field on the database? Just wanting to make it so that gold gained from exploring in battle and from posting on the forums go into the same "pot".

The value "money" I believe is what SMFShop uses, so I tried to change all "bcash" values to "money" in the Battle code, but didn't work. :P
Title: Re: Merging with SMFShop
Post by: Fog on September 04, 2013, 02:58:00 PM
There is Tom...I'm not sure when that feature will be available but I think something is in the works...clearing up some red tape was the first step.
Title: Re: Merging with SMFShop
Post by: Tom on September 04, 2013, 05:15:38 PM
I figured it would be rather easy to just make the mod point to whatever the value is for SMShop when it writes to the database, but alas. Maybe I have two different "money" variables in the database in two different locations.
Title: Re: Merging with SMFShop
Post by: Chen Zhen on September 04, 2013, 06:39:45 PM
Tom,

  You would need to configure one of the mods to use the others db table/column for tender. Since there are more plugins available for SMF Shop it would be wise to configure Battle to use SMF Shop's currency column. A plugin would have to be developed whereas there are many occurrences within the code to change. Also any update to Battle involving currency would invoke an update to said plugin.
Title: Re: Merging with SMFShop
Post by: Fog on September 05, 2013, 12:31:40 AM
Some way on my site one of my members says they are getting x amount of money/credits that they don't know how they get.  The same amount of money they get is the same amount as I have set on Battle...then I asked him how often and it was the same as on battle.

However it doesn't show up on the Battle Game....
Title: Re: Merging with SMFShop
Post by: Tom on September 05, 2013, 12:59:58 AM
OK...so I'm close here.

In the mySQL database, these values are stored in the same file: smf_members...so close! I cannot, for the life of me, find in the battle script where it calls the gold value from like:

SELECT gold
FROM {db_prefix}members

If I could find it, the mod would literally just have to SELECT money from that same database and eventually update itself. Guidance appreciated. :)
Title: Re: Merging with SMFShop
Post by: Fog on September 05, 2013, 02:26:31 AM
I'm getting SA Shop mixed up with SMF Shop.

Title: Re: Merging with SMFShop
Post by: SA on September 05, 2013, 09:30:45 AM
hmmm in battle admin you can change bcash to money for smf shop cash no need to reinvent the wheel there just saying :P
Title: Re: Merging with SMFShop
Post by: Chen Zhen on September 05, 2013, 04:29:50 PM
Quote from: SA on September 05, 2013, 09:30:45 AM
hmmm in battle admin you can change bcash to money for smf shop cash no need to reinvent the wheel there just saying :P

  I had forgotten that it was set up like that... I seen it in the code enough times where it checks the modSettings for the members table db column designation. I should have realized.
Title: Re: Merging with SMFShop
Post by: Tom on September 06, 2013, 03:25:26 PM
Wow, fantastic! I had originally seen this field and thought it merely just changed the display name of the currency, not the db designation. Thanks SA!
EhPortal 1.39.6 © 2024, WebDev