If you are not using a custom FrontEnd you can get away with using this Published version with only the below changes made. > Fixed FrontEnd Link Click Here<
public function eventBuyQtyCallback (state:Boolean, text:String=""):void
{
if (state)
{
var q:uint = uint(text);
if(q>0)
FrontEndEvents.eventBuyItem (BuyItemID, BuyGamePoints, BuyGameDollar, q);
}
}
Open src\Frontend.fla and Publish.
-------- Stage 2 Editing the API
Spoiler:
Open server\src\Scripts\WZBackend-ASP.NET\WZBackend-ASP.NET.sln
The files you will need open are: api_ClanMgr.aspx.cs, api_ClanCreate.aspx.cs, api_CharSlots.aspx.cs, api_BuyItem3.aspx.cs
mStore_BuyQuantity = args[3].GetInt(); // new quantity code
mStore_BuyPrice *= mStore_BuyQuantity; // make price take into account the new quantity!
mStore_BuyPriceGD *= mStore_BuyQuantity; // make price take into account the new quantity!
Find (unsigned int WINAPI FrontendWarZ::as_BuyItemThread(void* in_data))
Spoiler:
int apiCode = gUserProfile.ApiBuyItem(This->mStore_BuyItemID, buyIdx, &This->m_inventoryID);
Replace With
Spoiler:
int apiCode = gUserProfile.ApiBuyItem(This->mStore_BuyItemID, buyIdx, &This->m_inventoryID, This->mStore_BuyQuantity);
Find
Spoiler:
int quantityToAdd = storecat_GetItemBuyStackSize(mStore_BuyItemID);
Replace With
Spoiler:
int quantityToAdd = storecat_GetItemBuyStackSize(mStore_BuyItemID) * mStore_BuyQuantity;
Open UserProfile.cpp
Find
Spoiler:
int CClientUserProfile::ApiBuyItem(int itemId, int buyIdx, __int64* out_InventoryID)
Replace With
Spoiler:
int CClientUserProfile::ApiBuyItem(int itemId, int buyIdx, __int64* out_InventoryID, int qty)
Within (ApiBuyItem)
Find
Spoiler:
req.AddParam("BuyIdx", buyIdx);
Add Below
Spoiler:
req.AddParam("Qty", qty);
Open UserProfile.h
Find
Spoiler:
int ApiBuyItem(int itemId, int buyIdx, __int64* out_InventoryID);
Replace
Spoiler:
int ApiBuyItem(int itemId, int buyIdx, __int64* out_InventoryID, int qty);
Server
Spoiler:
Open AsyncFuncs.cpp
Find
Spoiler:
req.AddParam("BuyIdx", BuyIdx);
Add Below
Spoiler:
req.AddParam("Qty", 1);
This will fix ingame store. As it does not yet have support for qty purchases will default to 1 / 1 stack.
--------
* Confirmed Working *
Please post any errors you receive on this thread and will gladly fix these for you.
Hope it all works regardless or atleast helps you make progress getting this system running.
<3 Hit that Likes button
Special Thanks @erickstyle for posting a fix and the community for feeding back bugs.
13-12-15
Sylvanas1234
Re: Buy Item Quantity From Marketplace
Cheers big ears! <3
13-12-15
GetRektBambi
Re: Buy Item Quantity From Marketplace
All updated. Awaiting feedback of working state.
13-12-15
beastgameer
Re: Buy Item Quantity From Marketplace
i can not find the other things under frontendevents :L
13-12-15
erickstyle
Re: Buy Item Quantity From Marketplace
i have this error
Code:
1>.\Sources\UI\FrontEndWarZ.cpp(2820) : error C2664: 'CClientUserProfile::ApiBuyItem' : cannot convert parameter 4 from 'int *' to 'int'
1> There is no context in which this conversion is possible
i dont find : private var transactionsData:Array = null; ....
13-12-15
GetRektBambi
Re: Buy Item Quantity From Marketplace
Quote:
Originally Posted by beastgameer
i can not find the other things under frontendevents :L
Open src\classes\warz\FrontEnd\MarketPlace.as
sorry was inside for the rest.
Quote:
Originally Posted by erickstyle
i have this error
Code:
1>.\Sources\UI\FrontEndWarZ.cpp(2820) : error C2664: 'CClientUserProfile::ApiBuyItem' : cannot convert parameter 4 from 'int *' to 'int'
1> There is no context in which this conversion is possible
will take a look when I get home, just doing some shopping.
13-12-15
Oosmar02
Re: Buy Item Quantity From Marketplace
And public function ActionFunction (button:String) not find :c
13-12-15
Nikita505
Re: Buy Item Quantity From Marketplace
thx for sharing, and
sir, can u clear PM? :):
13-12-15
erickstyle
Re: Buy Item Quantity From Marketplace
i remove the "$"
int apiCode = gUserProfile.ApiBuyItem(This->mStore_BuyItemID, buyIdx, &This->m_inventoryID, This->mStore_BuyQuantity);
and compile ok.. i will continue
13-12-15
GetRektBambi
Re: Buy Item Quantity From Marketplace
Quote:
Originally Posted by Oosmar02
And public function ActionFunction (button:String) not find :c
Open src\classes\warz\FrontEnd\MarketPlace......as
sorry was inside for the rest.
Quote:
Originally Posted by Nikita505
thx for sharing, and
sir, can u clear PM? :):
Np and cleared.
13-12-15
LukeFire
Re: Buy Item Quantity From Marketplace
Quote:
Originally Posted by erickstyle
i have this error
Code:
1>.\Sources\UI\FrontEndWarZ.cpp(2820) : error C2664: 'CClientUserProfile::ApiBuyItem' : cannot convert parameter 4 from 'int *' to 'int'
1> There is no context in which this conversion is possible
int apiCode = gUserProfile.ApiBuyItem(This->mStore_BuyItemID, buyIdx, &This->m_inventoryID, This->mStore_BuyQuantity);
and compile ok.. i will continue
fix has been posted
13-12-15
LukeFire
Re: Buy Item Quantity From Marketplace
Everything works fine but when i buy something it gives me only one... it doesn't give me the quantity i ask for.
13-12-15
erickstyle
Re: Buy Item Quantity From Marketplace
Quote:
Originally Posted by LukeFire
Everything works fine but when i buy something it gives me only one... it doesn't give me the quantity i ask for.
me too
would not have to be changed here?
Code:
int totalQuantity = 1;
13-12-15
hawkingsamcro
Re: Buy Item Quantity From Marketplace
Post the querys from sql on pastebin...There you will not spoil
13-12-15
Oosmar02
Re: Buy Item Quantity From Marketplace
Yes me too ^-^
13-12-15
GetRektBambi
Re: Buy Item Quantity From Marketplace
Have fixed the single item purchase
Inside the Marketplacescreen.fla
Quote:
public function eventBuyQtyCallback (state:Boolean, text:String=""):void
{
if (state)
{
var q:uint = uint(text);
if(q>0)
FrontEndEvents.eventBuyItem (BuyItemID, BuyGamePoints, BuyGameDollar, q);
}
}
Red was the problem. Re-publish and should be fixed. I will uploaded a new swf. It was reading from variable initially set to 1 and never updated. It is not needed and will read directly from the box reply.
You could put the sql querys on pastebin? There he not mess anything. Please
Have done this :) Updated main thread
Updated: Check Main Thread for link (Fix for single purchase of items)
Anymore problems please let me know :)
13-12-15
Oosmar02
Re: [Release] Buy Item Quantity From Marketplace
How disable for one item ?
13-12-15
hawkingsamcro
Re: [Release] Buy Item Quantity From Marketplace
I did update the sql still get this error.
Code:
000053.542| WO_API: failed with error code 5 SQL Select Failed: Procedure or function 'WZ_BuyItem_GD' expects parameter '@in_Qty', which was not supplied.
000053.543| BuyItem FAILED, code: 5
13-12-15
GetRektBambi
Re: [Release] Buy Item Quantity From Marketplace
Quote:
Originally Posted by hawkingsamcro
I did update the sql still get this error.
Code:
000053.542| WO_API: failed with error code 5 SQL Select Failed: Procedure or function 'WZ_BuyItem_GD' expects parameter '@in_Qty', which was not supplied.
000053.543| BuyItem FAILED, code: 5
Check Stage 2 Editing the API that you did this correctly
- - - Updated - - -
Quote:
Originally Posted by Oosmar02
How disable for one item ?
working on it :)
Question are ya'll building your api and updating this along with client/studio?
13-12-15
Oosmar02
Re: [Release] Buy Item Quantity From Marketplace
Ok cool :) warn me.
13-12-15
GetRektBambi
Re: [Release] Buy Item Quantity From Marketplace
*** Confirmed Working ***
Follow the main thread fully and it will work. Also the download link for the Compiled FrontEnd.swf has also been updated. Thanks for all the bug reports. So credit to you all :)