I got to know that we can trade virtual currency b/w two players via cloud script.
Can any one told me how can I make a cloud script for trading of virtual currency?
I got to know that we can trade virtual currency b/w two players via cloud script.
Can any one told me how can I make a cloud script for trading of virtual currency?
If you want to use CloudScript or AzureFunctions to implement this feature. As the answer in your previous thread said, you need to use Server API AddUserVirtualCurrency, SubtractUserVirtualCurrency to handle the exchanges of the User VC. Suppose two players A and B want to exchange VC. The possible workflow would like this.
In the above process, you need to make at least two CloudScript functions. One function used to handle the trade request. Another one used to handle the trade acceptation and exchange the players’ VC.
Except using CloudScript, you can also consider using PlayFab native trade API to implement such VC trades. Please check this document for more info about PlayFab Trading. The API is designed to trade the item instances of players. If you want to trade VC, you can add the VC to the Container to create several types of VC packs. Players can purchase the corresponding VC pack firstly, then use the trade API to do the trade. The possible workflow could like this.
2 People are following this question.