So I'm new to PlayFab and am at a loss since there are no youtube video examples on how exactly to code and troubleshoot issues with CloudScript and the newer "Functions" feature.
I would like to know what's the best way to test run this code? In Unity, normally I'd know if the code has any syntax error or missing libraries but in CloudScript there's no warning if I'm trying to access something that doesn't exist.
Also is this roughly the correct way to have the server create Grant a Character to the user?
I not could anyone advice and show some sample code and kindly indicate if the code is meant to be in Unity or Cloudscript. From what I know, all "Server" logic code should be in cloudscript for a game that does not have a dedicated server.
Also is this the correct way to get the PlayFab to list the amount of Characters the Player has? I used this in Unity end with the ClientAPI and it works, but I just can't understand and don't have a clue how to go about the server side code in cloudscript without a proper editor/compiler to correct my syntax etc.
handlers.GrantCharacterToUser = function (args) { var listUsersCharactersRequest = { PlayFabId: currentPlayerId }; server.ListUsersCharactersRequest(listUsersCharactersRequest) if (listUsersCharactersRequest.length != 0) return { messageValue: "A Character already exist for this Player." }; var request = { PlayFabId: currentPlayerId, Character: [{ CharacterName: args.characterName, CharacterID: 1, PlayFabID: currentPlayerId }] }; // The pre-defined "server" object has functions corresponding to each PlayFab server API // (https://api.playfab.com/Documentation/Server). It is automatically // authenticated as your title and handles all communication with // the PlayFab API, so you don't have to write extra code to issue HTTP requests. var grantCharacterToUserRequest = server.GrantCharacterToUser(request); };