I want a user to be able to initiate a currency transfer to another user. I was thinking that it would be done from a CloudScript called in the context of the initiating user.
Is this possible and how would it be done?
I want a user to be able to initiate a currency transfer to another user. I was thinking that it would be done from a CloudScript called in the context of the initiating user.
Is this possible and how would it be done?
The most secure way would be to provide a way for the player to purchase a Container that holds the VC, and then put it in a Trade for the other player. You would then need to write to that other player's user data or a shared group data belonging to that user, to let him know about the Trade ID (we'll be providing a generic message system in a future update, as well as discoverability options for trades).
But alternately, yes, you could simply do this in a Cloud Script call, adding the VC to the target player, and subtracting it from the current player. Bear in mind that a) you should check the player's balance to ensure he has as much as he wants to send first, as the subtract call does allow VC to go negative (by design - some titles need that), and that if a player issues several calls to the Cloud Script in question rapidly (a hacker, usually), it's possible that he could manage to go negative anyway, since he could get lucky and have the two calls processing simultaneous (should be rare, but it's technically possible).
1 Person is following this question.