question

eric@begoodi.fr avatar image
eric@begoodi.fr asked

server.GetStoreItems from CloudScript ?

It seems that calling server.GetStoreItems from CloudScript gives an error.

The API is documented in the "client" and "admin" sections, not in "server".

I need to check some prices in the store from Cloudscript, how can I do ?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

Actually, wait. There's a fairly significant issue with this model. That is, once you have defined a price for an item - whether in the Catalog or Store - the item can be purchased for that price. So while your intent is to sell the item for VCa + VCb, a hacker could use the PurchaseItem call to buy the item for VCa or VCb. That's clearly not desirable.

What I would recommend is to put the information on the combined VCs needed to purchase the item in Title Data or Custom Data for the Catalog item. Then, you can read that in Cloud Script and apply the appropriate price using the calls to subtract the VCs and Grant the item.

We'll be adding an alchemy/crafting system later (where you specify one or more VCs/items on the input and output sides of the equation), but we don't have a date for that right now, so the Title Data/Custom Data route would be best for now.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

Correct - there's no Server version of GetStoreItems, as it's not possible to make purchases from Cloud Script (since the player has to confirm any purchase action). And since all the custom data (attributes) are at the Catalog level, it wasn't seen as needed in the Server API. What's the scenario you have for which you would need that call in Cloud Script, if you don't mind?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

eric@begoodi.fr avatar image
eric@begoodi.fr answered

I'm currently writing a Cloudscript handler to be able to buy an item with 2 virtual currencies.

So I just want to check that the prices given by the client are correct compared to the store.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

Understood - we'll add that to the backlog.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

office@gamednastudio.com avatar image
office@gamednastudio.com answered

I need this ASAP!

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

Unfortunately, short of a custom development contract (which we would still need to budget time for), we're not able to prioritize things out-of-band. We do track on the requests coming from the developer community, so that we can prioritize more highly things which have been asked for by higher numbers of developers, but to date this feature has only been asked for a couple of times. For now, I would have to recommend using the method described above.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.