question

darren zou avatar image
darren zou asked

Add a event listener to inventory etc?

I am looking for an event listener to notify the client when something like inventory has changed so it will update it.

The reason I want an event listener is that when a player accepts a trade I want the other player to have their inventory updated.

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

·
Ivan Cai avatar image
Ivan Cai answered

Since "playfab.inventory.trade_accept" is still in the preview state, and its availability is not guaranteed. You can create custom event for trade accepted players and trigger corresponding rule to execute cloudscript/Azure function for sending push notification for other player. Also, you can update the locally cached trade information every time players open the trade panel or simply update once a while. For the security of the trade information, I suggest you can completely code in cloudscript/Azure function.

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.

darren zou avatar image darren zou commented ·

In preview means free accounts can use it?

0 Likes 0 ·
Ivan Cai avatar image Ivan Cai ♦ darren zou commented ·

No. We cannot guarantee the availability of the "playfab.inventory.trade_accept" event.

0 Likes 0 ·
darren zou avatar image darren zou Ivan Cai ♦ commented ·
0 Likes 0 ·
Show more comments

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.