Idea

tmichael avatar image
tmichael suggested

allow PurchaseItem from server api OR allow GetStoreItems from server api OR add parameter to client.PurchaseItem to copy customdata

There's actually multiple walls here with multiple solutions... allowing PurchaseItem from the server api is just one of them.

core problem:

- I need store item customdata to be copied over to the inventory item customdata on grant

solutions:

- call a client.PurchaseItem that has a new parameter to copy over the customdata for me

- call a cloudscript that calls a new server.PurchaseItem and then copies over the customdata

- call a cloudscript that calls a new server.GetStoreItems and does all the purchase item stuff manually and copies over the customdata

the best hack I can figure out in the meantime:

- call a cloudscript that uses an http.request to call the client.PurchaseItem api followed by copying over the customdata

apisCloudScriptPlayer Inventory
10 |1200

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

2 Comments

·
Redmond Urbino avatar image
Redmond Urbino commented

This worked for us. The client passes the client session ticket to the azure function. Using that session ticket, the server can call PlayfabClientApi.PurchaseItem. After getting that result back, the server can then add the custom data as needed on the returned items.

10 |1200

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

Redmond Urbino avatar image
Redmond Urbino commented

This worked for us. The client passes the client session ticket to the azure function. Using that session ticket, the server can call PlayfabClientApi.PurchaseItem. After getting the returned item instances, we then modify the custom data on those items.

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 a Comment

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

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.