I'm interested in converting a
to a
so that I can use the same function on a single player profile as on the result of
https://api.playfab.com/documentation/Server/method/GetPlayersInSegment
How can I do this?
I'm interested in converting a
to a
so that I can use the same function on a single player profile as on the result of
https://api.playfab.com/documentation/Server/method/GetPlayersInSegment
How can I do this?
Obviously, it would have been best for them to use the same class, but since it would be a breaking change to update the return from either, that's clearly not an option. For now, I would simply suggest creating a copy constructor in your code, and using it to map one to the other.
I am trying to follow your recommendation on creating a copy constructor; however, the PlayerProfileModel fetched from PlayFabServerAPI.GetPlayerProfileAsync is returning null for the Statistics property, which I am trying to convert to a PlayerStatistics property.
Can you check that your Settings->Client Profile Options has Statistics turned on? If it's not, or the player has no statistics, there won't be anything to return there (hence, null).
Yes, Statistics are turned on in the Client Profile Options, and the player has statistics (I checked via the web interface).
Currently, my workaround is just calling GetPlayersInSegmentAsync and iterating through all 10,000+ players, and finding the one I need, then running the function on that. It works fine if I do it that way, which suggests that the data is in place.
2 People are following this question.