question

Fortin Jeremy avatar image
Fortin Jeremy asked

Access Member Group EntityID/TitlePlayerID

Hi,

I am on Blueprints on UE4 (and a beginner in programming).

For my clan system I am trying to access the Entity ID/Title Player ID of all members of a group. I use List Group Members to access Members and For Each Loop the list. Unfortunately I do not seem to find how to access the ID. I have been going through the https://docs.microsoft.com/en-us/rest/api/playfab/groups/groups/listgroupmembers?view=playfab-rest documentations but I cannot seem to understand what needs to be typed down to retrieve that information.

I have tried using "Get Field"+"As String" and type "Id", "EntityId", etc but none of them give me the right information. I also have tried getting the Members node from "Break Groups List Group Members Response" into "Make Profiles Get Entity Profiles Request" and then "Break Profiles Get Entity Profiles Request"+For Each loop but without success too...

Is there any solution to this problem?

Jeremy

entities
1 comment
10 |1200

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

Seth Du avatar image Seth Du ♦ commented ·

I will dig into it later.

0 Likes 0 ·
Seth Du avatar image
Seth Du answered

I am not familiar with UE4, but to output something in the callback response of an API like ListGroupMembers, you need to know the structure of the response. Please always refer to the documentation. And if the documentation is not well-clarified, you can use Restful testing tools like Postman to look into the response.

Here is my testing example for your reference. I am using ListGroupMembers to output all the Entity IDs:

1. Construct an GroupEntityKey for the request.

2. Call ListGroupMembers API:


1 comment
10 |1200

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

Seth Du avatar image Seth Du ♦ commented ·

3. Use get field of Memebers to get the list of group data, basically the full text json code will be like below: “init” Members contains the items classified by the Role ID, I have 3 roles in this group, hence, there will be 3 items. Then “second” Members inside sub-item contains each player belongs to the Role. I will find “Key”, then output “Id”.

I cannot paste the full result because it exceeds the words limit. Please review on https://github.com/sethdu0525/TestPage/blob/master/SampleofGroupResult.md. Please tell us If you cannot see it.

Outlog sample:

LogBlueprintUserMessages: [Untitled_C_14] 3137CF37B569EF36

LogBlueprintUserMessages: [Untitled_C_14] 965E430D3C6D5B93

LogBlueprintUserMessages: [Untitled_C_14] 4C6579BB73EBFCF

LogBlueprintUserMessages: [Untitled_C_14] BF07AF11EC9FCF9C

LogBlueprintUserMessages: [Untitled_C_14] 4443CCDBB2E5C754

LogBlueprintUserMessages: [Untitled_C_14] E9E4129A0E0228F7

0 Likes 0 ·
-20200130140909.png (236.0 KiB)
Fortin Jeremy avatar image
Fortin Jeremy answered

Thank you SethDu, it works like a charm...

You made me understand the way Playfab works! (Or at least a part of it)

For information to anyone having the same trouble through Groups. After accessing the Title ID following SethDu's images, you can use Get Profile to access PlayFab ID (Using Lineage + MasterPlayerAccountId), and then Get Player Profile to access the DisplayName.

10 |1200

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

Fortin Jeremy avatar image
Fortin Jeremy answered

@SethDu Actually I am having one more problem. It seems using Get Profile after List Group Members works but only for the client who logged in previously. The other "Get Profile" fail and show an Non authorized error code 1089. Would you know a way to make it Authorized? Or to access to the Playfab ID directly from what you showed me, instead of the title player ID?

1 comment
10 |1200

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

Seth Du avatar image Seth Du ♦ commented ·

To get target player's profile via GetProfile API, the Entity Key is required in the request, which is a Title Player Account Entity Key,

Have you changed the Global Entity Policy or Entity Group Policy?

Otherwise, it will be better to indicate your work flow of the corresponding part of the code. An sample of your Get Profile call will also help. If you don't know clearly on the API usage, you can try RESTful API tool like Postman. Please refer to: https://docs.microsoft.com/en-us/gaming/playfab/sdks/postman/

0 Likes 0 ·
mawiel avatar image
mawiel answered

Hello, @Fortin Jeremy I am also stuck on the "On Authorized Error Code 1089" error for other players than me. Did you find a solution?

10 |1200

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

Fortin Jeremy avatar image
Fortin Jeremy answered

Hi @Mawiel I actually have not tried again since then as I did not want to waste too much time in that dead end. I did not receive any notification email to let me know about Seth's answer moreover. I will have to get back into it at some point... Sorry for the late reply btw, I was quite busy these days. If you ever get a solution before I do, I think that would be great to leave it in this post for any other person getting stuck at this point too.

1 comment
10 |1200

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

Fortin Jeremy avatar image Fortin Jeremy commented ·
    {
            "Action": "Read",
            "Effect": "Allow",
            "Resource": "pfrn:data--*!*/Profile/Files/*", 
            Condition : null,
            Principal : "*"
   }

Finally... Here is the code to be added into the Global Entity Policy! Hopefully that will save some time to others!

1 Like 1 ·

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.