(Unity) My application has a separate Admin functionality which will use the PlayerIds of all the players to Get and Update their PlayerData. The client executes a cloudscript that executes GetPlayersInSegment and returns the PlayerProfile[] as a FunctionResult. I do not want to make a class object for PlayerProfile all I want is a list of all the PlayerIds returned. I have spend way too much time looking for a way to solve this can someone please give me a pointer? I am having trouble with the FunctionResult JSON I believe and none of the PlayFab tutorials explain anything to do with working with FunctionResult.
Answer by Made Wang · Jun 30 at 09:06 AM
If you don't want to process JSON objects on the client side, then you can process the data in Cloud Script (Leagcy) and return it to the client side, refer to the code below. Note that doing this still requires some simple processing on the client side.
Also, we do not recommend calling GetPlayersInSegment in Cloud Script (Leagcy), because this API is resource intensive and should not be used in scenarios which might generate high request volumes. Using this API in Cloud Script (Leagcy) may result in timeout error.
handlers.GetPlayerIdInSegment=function(args,context){ var result=server.GetPlayersInSegment({ SegmentId: " " }); var playerIds=new Array(); result.PlayerProfiles.forEach(Item=>{ playerIds.push(Item.PlayerId); }) return playerIds; }
Setting up Playfab + Photon on Unity... which SDKs do I need? 1 Answer
SDK for Unity 2017.4 LTS (probably 2018 too) has no Editor asmdef. Fails to build standalone. 2 Answers
OAuth consent screen and Playfab: Can't verify because I don't own playfab.com domain 3 Answers
Unicorn Battle iOS build returns "GetAccountInfo Timed out after 10 seconds." 1 Answer