Hi,
I wanted to know where I can find the developer document of Cloud Code because there's no Intellisense while writing code. So I want to see what built-in functions are already there and how can I access them using which type of object.
There should be an API document or Intellisense if there isn't one. Gamesparks already providing this in their Cloud code.
Answer by Citrus Yan · Nov 21, 2019 at 08:21 AM
Sorry, currently there is no public documentation specifying the Cloud Script environment (built-in functions, variables, etc. ) and Intellisense for writing Cloud Script code. However, you can refer to the CloudScript.d.ts file when writing your Cloud Script code, it’s a Cloud Script typing file which defines the PlayFab environment for you. For instance, if you want to use SetProfileLanguage API in Cloud Script but you don’t know whether it’s a built-in function, you can search for it in this file. You will find that the SetProfileLanguage API is defined in the file: SetProfileLanguage(request: PlayFabPro..., this is defined in the IPlayFabEntiyAPI scope, which can be accessed by the entity object. Therefore, you can call this API by typing entity.SetProfileLanguage({<parameters>}) in Cloud Script (parameters are listed in the SetProfileLanguageRequest interface).
@Citrus Yan Hmm... Well it is very important to have an API document don't you think? And what can you tell me about introducing it? Are you guys planning to launch these two things?
Now I want to do multiple tasks using cloud code and I can do them on client side but I want to shift them on cloud. Giving the condition that there is no document then it means I have to issue a support ticket each time and then wait for the response which is pretty slow to me
You guys should definitely launch document and intellisense
You can make feature requests about this to help us improve PlayFab here: https://community.playfab.com/spaces/24/index.html
@Citrus Yan Yeah I have already requested this feature here
Looks like you already did it, great!
How to get player profile with constraints mentioned using cloud script?
Here is the sample code:
handlers.test = function (args, context){ var profile = server.GetPlayerProfile({ PlayFabId: currentPlayerId, ProfileConstraints : { "ShowLastLogin" : true } }); return profile; }
For all available Player Profile View Constraints, you call refer to the API reference here: PlayerProfileViewConstraints
@Citrus Yan Yes I know about the API document but I wanted to know if it's already built-in function to avoid writing the code again
Thank you for the code snippet though
Answer by Muhammad Roshaan Tariq · Dec 18, 2019 at 10:07 AM
@Citrus Yan I want to write a cloud code function for granting items to user because it can only be accessed using server API. So, is it available already in cloud code or should I create one?
Saving data in Unity on Pause/Quit/Lose Focus 1 Answer
UnlockContainer and CloudScriptAPIRequestError 1 Answer
cloud script handlers 1 Answer
Scheduled task to update Store 1 Answer