question

harsh avatar image
harsh asked

Transfer Items Between Users

Waddup, waddup?

Looking for a way to transfer items between users while keeping the instance Id intact.

Use-Case: Have a custom server trading scenario. I positively can't use the Client-side trading API. Due to certain reasons, my custom server has its own versions/copies of specific PlayFab items. When these copies are traded through a non-PlayFab method, I want the change to sync to the PlayFab inventory (either immediately or after a certain delay).


What research says: There doesn't seem to be a way to satisfy my use-case while keeping the instanceId intact. My fallback plan is to write a CloudScript that does the following:

1) Revokes item from player A

2) Grants item to player B

3) Reports back the new instanceId to the custom server so it can update its copy.


What I need from this post: One of two things: either a direct way/API to solve the problem mentioned here (assuming it exists and I couldn't find it), or, a review or alternate solution to my plan. No Client APIs. Either server or admin would be fine.

Looking forward to your inputs.

Thanks.

CloudScriptIn-Game EconomyTrading
1 comment
10 |1200

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

harsh avatar image harsh commented ·

Since I can't find the edit button...

How unique are the ItemInstanceIds? In my fallback plan, I plan to use the instanceId of the first copy of the item (created from purchase) as the unique identifier in my server (to track item using custom data across grants/revokes), basically so I don't have to write my own unique id generator.

0 Likes 0 ·

1 Answer

·
Seth Du avatar image
Seth Du answered

Instance ID is unique within a title and the only way it remains after transferring is via trading by players, which can only be done via client API.

May I know why will you need to keep the instance ID intact? The only possible reason from PlayFab’s perspective is that you want to keep the custom data of item instance, however, it still can be manually “migrate”.

According to your requirement, there should be no game-changing solutions, but in my point of view, it is also a solution that implementing Rules to automatically do the revokes and grants(still with Cloud Script function). The custom server will simply send a PlayStream Event, which contains trader and customer’s information, along with trade information. Triggered function can read information from events. This workaround can help with later analysis.

5 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.

harsh avatar image harsh commented ·

Really like the idea of using PlayStream events over providing a direct cloud script.

Thing is, my custom server creates its own copy for items purchased from PlayFab. So it needs some way to link the two. By having the instance Id remain intact, we could've traded the items through the custom server without having to modify that link. With the grant+revoke solution, the custom server would need to be constantly updated with the new instanceId of the item.

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ harsh commented ·

[Deleted]

Please also feel free to send a thread on the Feature Request forum.

1 Like 1 ·
harsh avatar image harsh Seth Du ♦ commented ·

Thanks a lot for your help. This is definitely an alternative worth looking into.

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.