question

tohrque avatar image
tohrque asked

Beginner - User Authentication & Simple Player Data

So I'm an absolute beginner, but I really want to figure this out.

Now I was able to create a Player Login authentication and give my player the virtual currency, buy an item from the shop, and consume the item. However, this was all client-side through Unity code. I'm now trying to get the same functionality through PlayFab's CloudScript because I don't want the user to be able to just give their self money and items client-side.

I've been staring at the https://api.playfab.com/Documentation/Client page and categories, and I've looked through the https://api.playfab.com/Documentation/Server page. My lack of knowledge makes the code provided difficult for me to interpret. I'm not entirely sure how to communicate the same functionality in PlayFab's CloudScript.

I was just wanting a simple User Authentication by letting the player create an account (Username & Password), logging in, checking to make sure it is an existing account, then the ability to give the user virtual currency or items from my catalog. I want it to be server-side because providing this client-side would expose the game to exploits.

I learn best from examples, but the examples provided are an enigma to me since they are in JSON. I'm not quite familiar with it or how to translate it into CloudScript.

Am I even making sense? I hope I am haha

10 |1200

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

1 Answer

·
brendan avatar image
brendan answered

I'd recommend starting with our ProgressiveRewards sample in our GitHub samples repo: https://github.com/PlayFab/PlayFab-Samples/tree/master/Recipes/ProgressiveRewards. It has both the client and the Cloud Script code, to show you how to do this.

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.

katamaran avatar image katamaran commented ·

in this sample some links broken:

https://api.playfab.com/docs/building-blocks#Accounts

0 Likes 0 ·
brendan avatar image brendan katamaran commented ·

Thanks, I've opened a bug with the tools team to get the GitHub readme updated with the current links.

0 Likes 0 ·
brendan avatar image brendan brendan commented ·

It's fixed. :)

0 Likes 0 ·
katamaran avatar image katamaran commented ·
0 Likes 0 ·
brendan avatar image brendan katamaran commented ·

Thanks - appreciate your diligence on this. The tutorial for using Photon is here (https://api.playfab.com/docs/tutorials/landing-tournaments/photon-unity), and we'll open a bug to have the add-ons page updated with the correct link.

0 Likes 0 ·

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.