KUP playfab

Overview:

The CloudScript.js file is a collection of functions that can be called by the game client using the PlayFab API. These functions allow developers to perform a variety of tasks, such as updating player leaderboards, logging messages and errors, and making server and entity API calls.

Function Details:

  1. updatePlayerLeaderboard - This function updates a player's leaderboard statistics for daily, weekly, and total scores. It takes two arguments: LeaderboardName and Value, which represent the name of the leaderboard and the value to be set for the player's score. The function uses the UpdatePlayerStatistics API to update the player's statistics.

  2. helloWorld - This function is a simple example of a Cloud Script function that returns a message to the game client. It takes two arguments: args and context. The args argument is set to the value of the "FunctionParameter" parameter of the ExecuteCloudScript API, and the context argument contains additional information when the function is called from a PlayStream action. The function uses the log object to write out debugging statements and returns a message value to the game client.

  3. makeAPICall - This function is an example of making a PlayFab server API call. It uses the UpdatePlayerStatistics API to update a player's "Level" statistic to 2.

  4. makeEntityAPICall - This function is an example of calling a PlayFab Entity API. It uses the SetObjects API to set the value of an object on an entity's profile.

  5. writeToDataStore - This function writes a key-value pair to the PlayFab data store for the current player. It takes two arguments: Key and Value, which represent the key and value to be written to the data store. The function uses the SetObjects API to set the value of the object in the data store.

  6. readFromDataStore - This function reads the value of a key from the PlayFab data store for the current player. It takes one argument: Key, which represents the key to be read from the data store. The function uses the GetObjects API to retrieve the value of the object from the data store.

  7. deleteFromDataStore - This function deletes a key-value pair from the PlayFab data store for the current player. It takes one argument: Key, which represents the key of the pair to be deleted. The function uses the DeleteObjects API to delete the object from the data store.

Last updated