question

khattabkhairdeen avatar image
khattabkhairdeen asked

Entity Key lineage array? for what

hey again, so, im a bit confused on why the entity key lineage in the ListGroupMembersResponse API is an array.. how do i get their actual entity key from there? (i need to do some comparing since i already have their entity key id) do i just do `response.Members[i].Members[0].Key.Id'? or does the index of the second Members (entity lineage) matter?

apisentities
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Gosen Gao avatar image
Gosen Gao answered

Because the players belong to different Roles, the return value is grouped by Role. And the index of the second Members matters. You can use double foreach to iterate through all players.

foreach (var role in response.Members){
    foreach (var member in role.Members){
        Debug.Log("Member:" + member.Key.Id);
    }
}
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

khattabkhairdeen avatar image khattabkhairdeen commented ·

so is response.Members a role? and then response.Members[i].members the player who is in that role? that makes a lot of sense actually. thank you a lot

0 Likes 0 ·
Gosen Gao avatar image Gosen Gao khattabkhairdeen commented ·

Yes, you are right. For other similar issues, you can check the official API documentation to understand the definition of each parameter, or you can use POSTMAN to visually view the structure of the response.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.