We have this CloudScript to get all the PlayFab Ids from player in a segment:
handlers.onGetOnlinePlayers = function(args, context) { var onlineList = {}; onlineList = server.GetPlayersInSegment({ "SegmentId": "DF433C53264DE4EF" }) var playerListIDs = {"onlinePlayers":[]}; for(i =0; i < onlineList.ProfilesInSegment; i++) { playerListIDs.onlinePlayers.push(onlineList.PlayerProfiles[i].PlayerId); } return playerListIDs; };
It works exactly how it should sometimes and finds all the players in the segment, however, this message is often received when executing it from the dashboard
{ "FunctionResult": null, "Logs": [ { "Level": "Error", "Message": "PlayFab API request failure", "Data": [ [ [] ], [ [ [ [] ] ] ], [ [] ] ] } ], "ExecutionTimeSeconds": 7.0001722, "MemoryConsumedBytes": 108888, "APIRequestsIssued": 1, "HttpRequestsIssued": 0, "Error": { "Error": "InternalServerError", "Message": "InternalServerError", "StackTrace": "Error\n at handlers.onGetOnlinePlayers (9BBE-main.js:416:23)" } }