I'd like to create a sending money function!
I'am using Unity3D.
I saved values in the Player data and created the Get and Set functions to finish the function check.
I want to change the data using the ID of another user as a parameter here.
Is it possible? What should I do if it is impossible?
like this func : void SetPlayerData(string playFabPlayerId, string Value)
Answer by Andy · Oct 01, 2018 at 05:48 PM
I'm not sure I entirely follow your scenario, so if I misunderstand, could you please explain it in more detail? I think you want to create functionality that will remove some currency from one player and grant it to another. This can be accomplished through our server API from either Cloud Script or a dedicated server. The only prerequisite is that you have to know the ids of both players to be able to call the write data or virtual currency update methods.
yes correct. I find server API. so I can make this func now. However, the way I call it is for users to use server APIs. Is this going to be okay?
I wasn't sure whether you'd resolved this specific question. To be clear, you should not be calling the server API from your game client. It is meant to be called from Cloud Script or your own servers. Especially when it comes to transferring in-game resources from one player to another, you want the server to be authoritative of the transfer.
I've never used a cloud script. you says it needs to be called, but I don't know how to configure it. Do you have a tutorial to follow?
If the Player wants to send money, it is a way of receiving and input another player ID
Right now, we don't provide a built-in way to notify players of things like this. You could either right to player data and periodically (and infrequently) query from the client, or you could facilitate it with a dedicated server. It depends on the architecture of your game. In the coming months, we will have an early release of our two-way communication feature. This should help with your scenario.
Additionally, how do I use the Server API on Android?