I am slowly losing my mind at the moment:
We have a development title that had a bunch of CloudScript JS code. With that being made legacy, we have chosen to migrate code to Azure Cloud Functions.
Using PlayFab.Plugins.CloudScript and the FunctionContext to unpack the values coming in from PlayFab.
So far so good.
However, the problem arises in that API calls require the PlayFab user ID, but the .CurrentPlayerId that is attached to the function context is the entity id for the player's account.
I can find no way to get a valid PlayFab user ID for a given entity, which means I am able to call the cloud function, but I'm unable to actually use any of the PlayFab REST API calls through PlayFabServerInstanceAPI to do anything.
What am I missing here?
- There is a recent post that suggests that PlayFab.Plugins.CloudScript is obsolete and that I should be using https://github.com/PlayFab/PlayFab-Samples/blob/master/Samples/CSharp/AzureFunctions/CS2AFHelperClasses.cs
- Yet, when you look at the examples - ExampleFunctions and TicTacToe - they are using PlayFab.Plugins.CloudScript, so what am I supposed to be doing?
- Looking at TicTacToe, the client passes up the PlayFab ID to the server to then apply things to an account, this seems insecure to me, is this how we should be doing things? How can we validate that the PlayFab Id provided by the client matches the same account the entity links to?