Daily Lucky Numbers:
1
12
19
25
42
44

Merging with SMFShop

Started by Tom, September 04, 2013, 01:45:13 AM

Previous topic - Next topic

Tom

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

Fog

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.

Tom

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.

Chen Zhen

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.

Fog

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....

Tom

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. :)

Fog

I'm getting SA Shop mixed up with SMF Shop.


SA

hmmm in battle admin you can change bcash to money for smf shop cash no need to reinvent the wheel there just saying :P
http://samods.github.io/SAChatBar/

Customizer @ SimpleMachines

Chen Zhen

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.

Tom

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!