question

Roshan Singh avatar image
Roshan Singh asked

How to save Player levels

We are making a Multiplayer FPS game where players will level up after gaining some certain XP. Which method should I use to save that data in the server and how can I update it every time a player levels up.

Player DatamultiplayerPlayer Inventory
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

·
Rick Chen avatar image
Rick Chen answered

>> Which method should I use to save that data in the server

You could use the server API UpdateUserReadOnlyData or UpdatePlayerStatistics in your custom server or CloudScript to save the player’s level and XP in the Player’s readonly data or statistic.

>> how can I update it every time a player levels up

You can write a function in your custom server or CloudScript that checks if the player is really getting that level, do some cheat detection logic with it and then use those APIs to Update the level. In your client side, you can call this function when the player levels up. For more discussion about cheat prevention, you could refer to this thread: https://community.playfab.com/questions/44662/guidance-for-cheat-prevention.html

10 |1200

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

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.