question

Kurtav avatar image
Kurtav asked

How do I send a data change to the PlayFab (site management bd) in the Unity game without updating the build?,

My example (is it possible to implement it?) - I add the item to the store and the game should learn about it, that I added the item to the store to update the UI's list of items in the store.
What function do I need to write in the C # scripts in Playfab SDK?
How to do it?
It may be necessary to write new lines in the section - Automation - Cloud Script ?
Is there an article in the documentation for this topic?

,

unity3d
10 |1200

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

1 Answer

·
brendan avatar image
brendan answered

When you update the items in a store in the Game Manager (or via the Admin API), ideally that should be all you need to do. When the client (or a server/Cloud Script) queries the store after that, it will get the new list of items. Is there something specific to your game that causes you to need to hard-code something about the catalog/store in the client or Cloud Script? If so, can you describe that, so that we can advise you on how to move to a more data-driven approach?

4 comments
10 |1200

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

Kurtav avatar image Kurtav commented ·

I mean the situation when the user is in the store tab, in the game and at the same time the store is updated. In the script, the catalog of items should be obtained when the user enters the store in the game. Do not check me the update every second(PlayFabClientAPI.GetStoreItems). If he leaves the store and comes back - the store will be updated. And what if he leaves the game after the store immediately.

0 Likes 0 ·
brendan avatar image brendan Kurtav commented ·

Yes, you should not constantly poll the store for changes. If you change the store while the user is in it (after they have retrieved the store), when the player tries to make a purchase, if that purchase is no longer valid, they'll get an error back. At that point, you would re-load the store. This should be extremely rare, unless you're changing your store frequently (as in multiple times per day, which isn't really a good idea).

0 Likes 0 ·
Kurtav avatar image Kurtav commented ·

How do I get an update(new item) in this sequence?
1) The customer enters the store - checks available items - PlayFabClientAPI.GetStoreItems
2) At the same time, a new product is added to the store (via the Admin API) (https://developer.playfab.com/en-US/****/economy/catalogs/***/stores)
3) the client leaves the store
4) the client leaves the game

In this sequence, he will not see a new item in the store

0 Likes 0 ·
brendan avatar image brendan Kurtav commented ·

Correct. Please see above - if the catalog or store changes while the player is making a purchase, you would re-query for the new store after getting the error back that the purchase is no longer valid (if it is - in many cases, you might not even be changing the things they're trying to buy).

0 Likes 0 ·

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.