First call this func on client:
public void MakeRent() { PlayFabClientAPI.ExecuteCloudScript(new ExecuteCloudScriptRequest() { FunctionName = "RentItem", FunctionParameter = new { ItemId = "Colt", CatalogVers = "Pistols" }, GeneratePlayStreamEvent = true, }, OnRent, OnPlayFabError); }
Then server-side revision. I use this: https://docs.microsoft.com/en-us/rest/api/playfab/client/title-wide-data-management/getcatalogitems?view=playfab-rest)
But always see nothing on the return.
handlers.RentItem = function(args) { var GetCatalogItemsResult = server.GetCatalogItems({ "CatalogVersion": args.CatalogVers }); for(var catalogItem in GetCatalogItemsResult.Catalog) { if(catalogItem.ItemId === args.ItemId) { return catalogItem.ItemId; // test } } }
For this example:
args.CatalogVers is "Pistols"
args.ItemId is "Colt"
This is a test. At the finish i need check virtual currency price for this item on the server-side by this way:
var ItemPrice; if(catalogItem.ItemId == args.ItemId){ ItemPrice = catalogItem.VirtualCurrencyPrices // not working at this phase ItemPrice = catalogItem.VirtualCurrencyPrices["GL"] // same }